From: Russell King Date: Sat, 6 May 2006 10:26:30 +0000 (+0100) Subject: [ARM] Allow SA1100 RTC alarm to be configured for wakeup X-Git-Tag: v2.6.17-rc4~25^2~7 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=19ca5d27e15c10d8529984ecd98dcba2637edcd2;p=linux-2.6 [ARM] Allow SA1100 RTC alarm to be configured for wakeup The SA1100 RTC alarm can be configured to wake up the CPU from sleep mode, and the RTC driver has been using the API to configure this mode. Unfortunately, the code was which sets the required bit in the hardware was missing. Signed-off-by: Russell King --- diff --git a/arch/arm/mach-sa1100/irq.c b/arch/arm/mach-sa1100/irq.c index c131a5201b..b3a5602418 100644 --- a/arch/arm/mach-sa1100/irq.c +++ b/arch/arm/mach-sa1100/irq.c @@ -199,10 +199,26 @@ static void sa1100_unmask_irq(unsigned int irq) ICMR |= (1 << irq); } +/* + * Apart form GPIOs, only the RTC alarm can be a wakeup event. + */ +static int sa1100_set_wake(unsigned int irq, unsigned int on) +{ + if (irq == IRQ_RTCAlrm) { + if (on) + PWER |= PWER_RTC; + else + PWER &= ~PWER_RTC; + return 0; + } + return -EINVAL; +} + static struct irqchip sa1100_normal_chip = { .ack = sa1100_mask_irq, .mask = sa1100_mask_irq, .unmask = sa1100_unmask_irq, + .set_wake = sa1100_set_wake, }; static struct resource irq_resource = {