mfd: tps6591x: Acks the enabled interrupts only
Laxman Dewangan [Mon, 14 Nov 2011 14:20:13 +0000 (19:20 +0530)]
Acknowledge the tps6591x interrupt by processor only
when it is enabled by client. The acknowledge is done
by writing 1 to INT_STS register.

bug 896151

Reviewed-on: http://git-master/r/64824
(cherry picked from commit 31fbb94516e5b600ad536e35c95e64b525b21f61)

Change-Id: I7f4328f6084f6e94884ac4a87c5c3a247f7fa99d
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/65453

Rebase-Id: R4803a1635b5404226679de09dc15260ff60d44e6

drivers/mfd/tps6591x.c

index 0831a03..cc3ff23 100644 (file)
@@ -519,6 +519,7 @@ static irqreturn_t tps6591x_irq(int irq, void *data)
        struct tps6591x *tps6591x = data;
        int ret = 0;
        u8 tmp[3];
+       u8 int_ack;
        u32 acks, mask = 0;
        int i;
 
@@ -531,8 +532,10 @@ static irqreturn_t tps6591x_irq(int irq, void *data)
                        return IRQ_NONE;
                }
                if (tmp[i]) {
+                       /* Ack only those interrupts which are enabled */
+                       int_ack = tmp[i] & (~(tps6591x->mask_cache[i]));
                        ret = tps6591x_write(tps6591x->dev,
-                                       TPS6591X_INT_STS + 2*i, tmp[i]);
+                                       TPS6591X_INT_STS + 2*i, int_ack);
                        if (ret < 0) {
                                dev_err(tps6591x->dev,
                                        "failed to write interrupt status\n");