Commit 7d811771 authored by Doug Anderson's avatar Doug Anderson Committed by Lee Jones

mfd: tps65090: Don't tell child devices we have an IRQ if we don't

If we weren't given an interrupt we shouldn't tell child devices (like
the tps65090 charger) that they have an interrupt.  This is needed so
that we can support polling mode in the tps65090 charger driver.

See also (charger: tps65090: Allow charger module to be used when no
irq).
Signed-off-by: default avatarDoug Anderson <dianders@chromium.org>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent a798c10f
...@@ -64,11 +64,16 @@ static struct resource charger_resources[] = { ...@@ -64,11 +64,16 @@ static struct resource charger_resources[] = {
} }
}; };
static const struct mfd_cell tps65090s[] = { enum tps65090_cells {
{ PMIC = 0,
CHARGER = 1,
};
static struct mfd_cell tps65090s[] = {
[PMIC] = {
.name = "tps65090-pmic", .name = "tps65090-pmic",
}, },
{ [CHARGER] = {
.name = "tps65090-charger", .name = "tps65090-charger",
.num_resources = ARRAY_SIZE(charger_resources), .num_resources = ARRAY_SIZE(charger_resources),
.resources = &charger_resources[0], .resources = &charger_resources[0],
...@@ -211,6 +216,9 @@ static int tps65090_i2c_probe(struct i2c_client *client, ...@@ -211,6 +216,9 @@ static int tps65090_i2c_probe(struct i2c_client *client,
"IRQ init failed with err: %d\n", ret); "IRQ init failed with err: %d\n", ret);
return ret; return ret;
} }
} else {
/* Don't tell children they have an IRQ that'll never fire */
tps65090s[CHARGER].num_resources = 0;
} }
ret = mfd_add_devices(tps65090->dev, -1, tps65090s, ret = mfd_add_devices(tps65090->dev, -1, tps65090s,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment