ARM: sa1111: fix PWM state on suspend
authorRussell King <rmk+kernel@arm.linux.org.uk>
Fri, 3 Feb 2012 19:05:13 +0000 (19:05 +0000)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Thu, 9 Feb 2012 15:34:48 +0000 (15:34 +0000)
We should not write to the SA1111 registers after setting the SLEEP
bit.  Moreover, the manual says that the PWM registers should be
disabled before we enter sleep.  So, move the clearing of these
registers earlier in the suspend sequence.

Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/common/sa1111.c

index c7bed309b3aaeaabac189fb2f00bda49f319184d..f0d9faadcc3f0a598d5a553faaab98a0fc61d27a 100644 (file)
@@ -905,6 +905,9 @@ static int sa1111_suspend(struct platform_device *dev, pm_message_t state)
        save->skpwm0   = sa1111_readl(base + SA1111_SKPWM0);
        save->skpwm1   = sa1111_readl(base + SA1111_SKPWM1);
 
+       sa1111_writel(0, sachip->base + SA1111_SKPWM0);
+       sa1111_writel(0, sachip->base + SA1111_SKPWM1);
+
        base = sachip->base + SA1111_INTC;
        save->intpol0  = sa1111_readl(base + SA1111_INTPOL0);
        save->intpol1  = sa1111_readl(base + SA1111_INTPOL1);
@@ -920,8 +923,6 @@ static int sa1111_suspend(struct platform_device *dev, pm_message_t state)
         */
        val = sa1111_readl(sachip->base + SA1111_SKCR);
        sa1111_writel(val | SKCR_SLEEP, sachip->base + SA1111_SKCR);
-       sa1111_writel(0, sachip->base + SA1111_SKPWM0);
-       sa1111_writel(0, sachip->base + SA1111_SKPWM1);
 
        clk_disable(sachip->clk);
 
This page took 0.029715 seconds and 5 git commands to generate.