Fix gpio and irq wakeup irq handling.
authorLars-Peter Clausen <lars@metafoo.de>
Mon, 8 Mar 2010 20:34:01 +0000 (20:34 +0000)
committerLars-Peter Clausen <lars@metafoo.de>
Mon, 8 Mar 2010 20:34:01 +0000 (20:34 +0000)
SVN-Revision: 20070

target/linux/xburst/files-2.6.32/arch/mips/jz4740/gpio.c
target/linux/xburst/files-2.6.32/arch/mips/jz4740/irq.c

index ccaa0602a95587c3e140b76f1c32571ba122b46c..df5df5cd0b4d0cbc0fc8b0262360537cb1b880e0 100644 (file)
@@ -446,6 +446,7 @@ int jz_gpio_suspend(void)
                gpio = chip->gpio_chip.base;
                chip->suspend_mask = readl(GPIO_TO_REG(gpio, JZ_REG_GPIO_MASK));
                writel(~(chip->wakeup), GPIO_TO_REG(gpio, JZ_REG_GPIO_MASK_SET));
+               writel(chip->wakeup, GPIO_TO_REG(gpio, JZ_REG_GPIO_MASK_CLEAR));
        }
 
        chip = jz_gpio_chips;
@@ -459,7 +460,10 @@ int jz_gpio_resume(void)
        int i;
 
        for (i = 0; i < ARRAY_SIZE(jz_gpio_chips); ++i, ++chip) {
-               writel(~(chip->suspend_mask), GPIO_TO_REG(chip->gpio_chip.base, JZ_REG_GPIO_MASK_CLEAR));
+               writel(~(chip->suspend_mask), GPIO_TO_REG(chip->gpio_chip.base,
+                       JZ_REG_GPIO_MASK_CLEAR));
+               writel(chip->suspend_mask, GPIO_TO_REG(chip->gpio_chip.base,
+                       JZ_REG_GPIO_MASK_SET));
        }
 
        return 0;
index a6f4bbf28c03e0a7310d52e1e07c44ed33e15ee5..11e5a63f7a4abd64cbf334e361f4781a173bdca1 100644 (file)
@@ -122,11 +122,13 @@ void jz4740_intc_suspend(void)
 {
        jz_intc_saved = readl(jz_intc_base + JZ_REG_INTC_MASK);
        writel(~jz_intc_wakeup, jz_intc_base + JZ_REG_INTC_SET_MASK);
+       writel(jz_intc_wakeup, jz_intc_base + JZ_REG_INTC_CLEAR_MASK);
 }
 
 void jz4740_intc_resume(void)
 {
        writel(~jz_intc_saved, jz_intc_base + JZ_REG_INTC_CLEAR_MASK);
+       writel(jz_intc_saved, jz_intc_base + JZ_REG_INTC_SET_MASK);
 }
 
 #ifdef CONFIG_DEBUG_FS