charge:disable wm831x_on irq before charging display
authorroot <root@lw.(none)>
Thu, 16 Jun 2011 09:56:56 +0000 (17:56 +0800)
committerroot <root@lw.(none)>
Thu, 16 Jun 2011 09:56:56 +0000 (17:56 +0800)
drivers/mfd/wm831x-irq.c
drivers/power/wm831x_charger_display.c

index 8fcc7364d5906c52998bd3a7eb9975ed4a6ce65b..d33c6f28e916e95c54781df15939349dc26962f7 100755 (executable)
@@ -396,6 +396,15 @@ static void wm831x_irq_mask(unsigned int irq)
        //printk("%s:irq=%d\n",__FUNCTION__,irq);
 }
 
+static void wm831x_irq_disable(unsigned int irq)
+{
+       struct wm831x *wm831x = get_irq_chip_data(irq);
+       struct wm831x_irq_data *irq_data = irq_to_wm831x_irq(wm831x, irq);
+
+       wm831x->irq_masks_cur[irq_data->reg - 1] |= irq_data->mask;
+       //printk("%s:irq=%d\n",__FUNCTION__,irq);
+}
+
 static int wm831x_irq_set_type(unsigned int irq, unsigned int type)
 {
        struct wm831x *wm831x = get_irq_chip_data(irq);
@@ -454,6 +463,7 @@ static struct irq_chip wm831x_irq_chip = {
        .name = "wm831x",
        .bus_lock = wm831x_irq_lock,
        .bus_sync_unlock = wm831x_irq_sync_unlock,
+       .disable = wm831x_irq_disable,
        .mask = wm831x_irq_mask,
        .unmask = wm831x_irq_unmask,
        .set_type = wm831x_irq_set_type,
index 08b2df0075b42d73a9e0be8b6c41e76cff4a63b5..f6a0ff93293801ee123d0f08f746d10f1062c12e 100755 (executable)
@@ -35,6 +35,7 @@
 #include <linux/mfd/wm831x/auxadc.h>
 #include <linux/mfd/wm831x/pmu.h>
 #include <linux/mfd/wm831x/pdata.h>
+#include <linux/mfd/wm831x/irq.h>
 #include <linux/power_supply.h>
 
 
@@ -388,9 +389,9 @@ static int __devinit wm831x_chg_probe(struct platform_device *pdev)
        wm831x_chg->flag_suspend = 0;
        
        platform_set_drvdata(pdev, wm831x_chg);
-
+       disable_irq_nosync(wm831x_chg->wm831x->irq_base + WM831X_IRQ_ON);
        ret = rk29_charger_display(wm831x_chg);
-
+       enable_irq(wm831x_chg->wm831x->irq_base + WM831X_IRQ_ON);
        wm831x_chg->flag_chg = 0;
        wm831x_chg->flag_bl = 1;
        wm831x_chg->cnt_on = 0;