diff options
author | Laxman Dewangan <ldewangan@nvidia.com> | 2011-02-25 14:52:08 +0530 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-04-26 15:52:22 -0700 |
commit | fdce21db54f99ff72947d016d05418174291ac75 (patch) | |
tree | 53b6d661785f31989a2141d48e7fb8cd851ec985 /drivers | |
parent | eef5a498f1ed47aeaf996ffc156010f9df4e7804 (diff) |
mfd: tps6591x: Calling proper isrs
Calling the client isrs from tps6591x isrs.
Original-Change-Id: Ic0caf1a3802c24df1cf76087e319a3417be88117
Reviewed-on: http://git-master/r/20887
Reviewed-by: Venu Byravarasu <vbyravarasu@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Tested-by: Laxman Dewangan <ldewangan@nvidia.com>
Change-Id: I2b67d6689b9884a6917aa9882e1f86ad8b6a484c
Diffstat (limited to 'drivers')
-rwxr-xr-x | drivers/mfd/tps6591x.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/drivers/mfd/tps6591x.c b/drivers/mfd/tps6591x.c index 796db1b240b5..99c7aab4f168 100755 --- a/drivers/mfd/tps6591x.c +++ b/drivers/mfd/tps6591x.c @@ -379,7 +379,7 @@ static void tps6591x_irq_sync_unlock(unsigned int irq) for (i = 0; i < ARRAY_SIZE(tps6591x->mask_reg); i++) { if (tps6591x->mask_reg[i] != tps6591x->mask_cache[i]) { if (!WARN_ON(tps6591x_write(tps6591x->dev, - TPS6591X_INT_MSK + i, + TPS6591X_INT_MSK + 2*i, tps6591x->mask_reg[i]))) tps6591x->mask_cache[i] = tps6591x->mask_reg[i]; } @@ -388,12 +388,12 @@ static void tps6591x_irq_sync_unlock(unsigned int irq) mutex_unlock(&tps6591x->irq_lock); } -/* FIXME */ static irqreturn_t tps6591x_irq(int irq, void *data) { struct tps6591x *tps6591x = data; int ret = 0; u8 tmp[3]; + u32 acks; int i; for (i = 0; i < 3; i++) { @@ -403,13 +403,22 @@ static irqreturn_t tps6591x_irq(int irq, void *data) dev_err(tps6591x->dev, "failed to read interrupt status\n"); return IRQ_NONE; } - ret = tps6591x_write(tps6591x->dev, TPS6591X_INT_STS + 2*i, - tmp[i]); - if (ret < 0) { - dev_err(tps6591x->dev, "failed to write interrupt status\n"); - return IRQ_NONE; + if (tmp[i]) { + ret = tps6591x_write(tps6591x->dev, + TPS6591X_INT_STS + 2*i, tmp[i]); + if (ret < 0) { + dev_err(tps6591x->dev, "failed to write interrupt status\n"); + return IRQ_NONE; + } } } + acks = (tmp[2] << 16) | (tmp[1] << 8) | tmp[0]; + while (acks) { + i = __ffs(acks); + if (tps6591x->irq_en & (1 << i)) + handle_nested_irq(tps6591x->irq_base + i); + acks &= ~(1 << i); + } return IRQ_HANDLED; } |