Skip to content

Commit

Permalink
[ARM] Allow SA1100 RTC alarm to be configured for wakeup
Browse files Browse the repository at this point in the history
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 <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Russell King authored and Russell King committed May 6, 2006
1 parent 5528e56 commit 19ca5d2
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions arch/arm/mach-sa1100/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit 19ca5d2

Please sign in to comment.