Skip to content

Commit

Permalink
mfd: tps65086: Make interrupt line optional
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Rob Herring <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
  • Loading branch information
esmil authored and Lee Jones committed Aug 16, 2021
1 parent 68f0ba7 commit e06f4ab
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
3 changes: 0 additions & 3 deletions Documentation/devicetree/bindings/mfd/ti,tps65086.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,6 @@ additionalProperties: false
required:
- compatible
- reg
- interrupts
- interrupt-controller
- '#interrupt-cells'
- gpio-controller
- '#gpio-cells'
- regulators
Expand Down
21 changes: 11 additions & 10 deletions drivers/mfd/tps65086.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,29 +100,30 @@ static int tps65086_probe(struct i2c_client *client,
(char)((version & TPS65086_DEVICEID_OTP_MASK) >> 4) + 'A',
(version & TPS65086_DEVICEID_REV_MASK) >> 6);

ret = regmap_add_irq_chip(tps->regmap, tps->irq, IRQF_ONESHOT, 0,
&tps65086_irq_chip, &tps->irq_data);
if (ret) {
dev_err(tps->dev, "Failed to register IRQ chip\n");
return ret;
if (tps->irq > 0) {
ret = regmap_add_irq_chip(tps->regmap, tps->irq, IRQF_ONESHOT, 0,
&tps65086_irq_chip, &tps->irq_data);
if (ret) {
dev_err(tps->dev, "Failed to register IRQ chip\n");
return ret;
}
}

ret = mfd_add_devices(tps->dev, PLATFORM_DEVID_AUTO, tps65086_cells,
ARRAY_SIZE(tps65086_cells), NULL, 0,
regmap_irq_get_domain(tps->irq_data));
if (ret) {
if (ret && tps->irq > 0)
regmap_del_irq_chip(tps->irq, tps->irq_data);
return ret;
}

return 0;
return ret;
}

static int tps65086_remove(struct i2c_client *client)
{
struct tps65086 *tps = i2c_get_clientdata(client);

regmap_del_irq_chip(tps->irq, tps->irq_data);
if (tps->irq > 0)
regmap_del_irq_chip(tps->irq, tps->irq_data);

return 0;
}
Expand Down

0 comments on commit e06f4ab

Please sign in to comment.