Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mfd: tps65086: Make interrupt line optional

The BeagleV Starlight v0.9 board[1] doesn't have the IRQB line routed to
the SoC, but it is still useful to be able to reach the PMIC over I2C
for the other functionality it provides such as GPIOs and regulator
settings.

[1] https://github.com/beagleboard/beaglev-starlight

Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

authored by

Emil Renner Berthing and committed by
Lee Jones
e06f4abb 68f0ba70

+11 -13
-3
Documentation/devicetree/bindings/mfd/ti,tps65086.yaml
··· 87 87 required: 88 88 - compatible 89 89 - reg 90 - - interrupts 91 - - interrupt-controller 92 - - '#interrupt-cells' 93 90 - gpio-controller 94 91 - '#gpio-cells' 95 92 - regulators
+11 -10
drivers/mfd/tps65086.c
··· 100 100 (char)((version & TPS65086_DEVICEID_OTP_MASK) >> 4) + 'A', 101 101 (version & TPS65086_DEVICEID_REV_MASK) >> 6); 102 102 103 - ret = regmap_add_irq_chip(tps->regmap, tps->irq, IRQF_ONESHOT, 0, 104 - &tps65086_irq_chip, &tps->irq_data); 105 - if (ret) { 106 - dev_err(tps->dev, "Failed to register IRQ chip\n"); 107 - return ret; 103 + if (tps->irq > 0) { 104 + ret = regmap_add_irq_chip(tps->regmap, tps->irq, IRQF_ONESHOT, 0, 105 + &tps65086_irq_chip, &tps->irq_data); 106 + if (ret) { 107 + dev_err(tps->dev, "Failed to register IRQ chip\n"); 108 + return ret; 109 + } 108 110 } 109 111 110 112 ret = mfd_add_devices(tps->dev, PLATFORM_DEVID_AUTO, tps65086_cells, 111 113 ARRAY_SIZE(tps65086_cells), NULL, 0, 112 114 regmap_irq_get_domain(tps->irq_data)); 113 - if (ret) { 115 + if (ret && tps->irq > 0) 114 116 regmap_del_irq_chip(tps->irq, tps->irq_data); 115 - return ret; 116 - } 117 117 118 - return 0; 118 + return ret; 119 119 } 120 120 121 121 static int tps65086_remove(struct i2c_client *client) 122 122 { 123 123 struct tps65086 *tps = i2c_get_clientdata(client); 124 124 125 - regmap_del_irq_chip(tps->irq, tps->irq_data); 125 + if (tps->irq > 0) 126 + regmap_del_irq_chip(tps->irq, tps->irq_data); 126 127 127 128 return 0; 128 129 }