rk31:pmu:rt5025:Optimize the interrupt process
author张晴 <zhangqing@rock-chips.com>
Fri, 1 Nov 2013 03:14:02 +0000 (11:14 +0800)
committer张晴 <zhangqing@rock-chips.com>
Fri, 1 Nov 2013 03:14:02 +0000 (11:14 +0800)
drivers/mfd/rt5025-irq.c
include/linux/mfd/rt5025-irq.h

index 6989f812553bbd91023bbb05120a3e6bb4ec20fc..76c50a9b1ce2744c1bf55971943794859a8d004c 100644 (file)
@@ -75,7 +75,9 @@ static void rt5025_work_func(struct work_struct *work)
                irq_enable[3] = rt5025_reg_read(ii->i2c, RT5025_REG_IRQEN4);
                irq_enable[4] = rt5025_reg_read(ii->i2c, RT5025_REG_IRQEN5);
                irq_enable[5] = rt5025_reg_read(ii->i2c, RT5025_REG_GAUGEIRQEN);
-               #if 0
+               #if 1
+               rt5025_reg_write(ii->i2c, RT5025_REG_IRQEN2, irq_enable[1]&(~RT5025_CHTERMI_MASK));
+               #else
                /* disable all irq enable bit first */
                rt5025_reg_write(ii->i2c, RT5025_REG_IRQEN1, irq_enable[0]&RT5025_ADAPIRQ_MASK);
                rt5025_reg_write(ii->i2c, RT5025_REG_IRQEN2, 0x00);
@@ -159,7 +161,9 @@ static void rt5025_work_func(struct work_struct *work)
        if (ii->init_once)
                ii->init_once = 0;
 
-       #if 0
+       #if 1
+       rt5025_reg_write(ii->i2c, RT5025_REG_IRQEN2, irq_enable[1]);
+       #else
        /* restore all irq enable bit */
        rt5025_reg_write(ii->i2c, RT5025_REG_IRQEN1, irq_enable[0]);
        rt5025_reg_write(ii->i2c, RT5025_REG_IRQEN2, irq_enable[1]);
index 8e9070029d37858608a7b0fb3f34edb83d4e9b6b..d826b2fc625d4298de99a6fa64d9e223badf383d 100644 (file)
@@ -29,6 +29,7 @@
 #define RT5025_INACIRQ_MASK    0x40
 #define RT5025_INUSBIRQ_MASK   0x08
 #define RT5025_ADAPIRQ_MASK    (RT5025_INACIRQ_MASK|RT5025_INUSBIRQ_MASK)
+#define RT5025_CHTERMI_MASK    0x01
 
 #define RT5025_REG_GAUGEIRQEN  0x50
 #define RT5025_REG_GAUGEIRQFLG 0x51