]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[ARM] 4694/1: IXP4xx: Update clockevent support for shutdown and resume
authorKevin Hilman <khilman@mvista.com>
Tue, 11 Dec 2007 23:32:58 +0000 (00:32 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Mon, 17 Dec 2007 17:18:01 +0000 (17:18 +0000)
Add proper support for CLOCK_EVT_MODE_RESUME and in the process fix
CLOCK_EVT_MODE_SHUTDOWN so that only the enable bits are toggled for both.

Signed-off-by: Kevin Hilman <khilman@mvista.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/mach-ixp4xx/common.c

index c1271c449246ecf743d6bdce0e77e052ad1e74a1..f6d66dce68523f736056aa8d14c76f167fc02049 100644 (file)
@@ -442,7 +442,8 @@ static int ixp4xx_set_next_event(unsigned long evt,
 static void ixp4xx_set_mode(enum clock_event_mode mode,
                            struct clock_event_device *evt)
 {
-       unsigned long opts, osrt = *IXP4XX_OSRT1 & ~IXP4XX_OST_RELOAD_MASK;
+       unsigned long opts = *IXP4XX_OSRT1 & IXP4XX_OST_RELOAD_MASK;
+       unsigned long osrt = *IXP4XX_OSRT1 & ~IXP4XX_OST_RELOAD_MASK;
 
        switch (mode) {
        case CLOCK_EVT_MODE_PERIODIC:
@@ -455,12 +456,15 @@ static void ixp4xx_set_mode(enum clock_event_mode mode,
                opts = IXP4XX_OST_ENABLE | IXP4XX_OST_ONE_SHOT;
                break;
        case CLOCK_EVT_MODE_SHUTDOWN:
+               opts &= ~IXP4XX_OST_ENABLE;
+               break;
+       case CLOCK_EVT_MODE_RESUME:
+               opts |= IXP4XX_OST_ENABLE;
+               break;
        case CLOCK_EVT_MODE_UNUSED:
        default:
                osrt = opts = 0;
                break;
-       case CLOCK_EVT_MODE_RESUME:
-               break;
        }
 
        *IXP4XX_OSRT1 = osrt | opts;