1
0
Fork 0
forked from len0rd/rockbox

imx233: implement alarm wake up

This adds the application part of alarm wake up. On some targets
like the Fuze+, it will also require a bootloader change to make
sure that the device doesn't power down on alarm wake up (for
example on the Fuze+ the bootloader requires the power button to
be hold sufficiently long, thus preventing alarm wake up to work)

Change-Id: I5d01957852355fddbd48110d3d75a5533f07879e
This commit is contained in:
Amaury Pouly 2013-07-02 00:36:21 +02:00
parent 2773673733
commit d8024df105
3 changed files with 67 additions and 12 deletions

View file

@ -38,6 +38,11 @@ void imx233_rtc_write_persistent(int idx, uint32_t val)
imx233_rtc_write_reg(&HW_RTC_PERSISTENTn(idx), val);
}
void imx233_rtc_write_alarm(uint32_t seconds)
{
imx233_rtc_write_reg(&HW_RTC_ALARM, seconds);
}
struct imx233_rtc_info_t imx233_rtc_get_info(void)
{
struct imx233_rtc_info_t info;
@ -45,5 +50,10 @@ struct imx233_rtc_info_t imx233_rtc_get_info(void)
info.seconds = HW_RTC_SECONDS;
for(int i = 0; i < 6; i++)
info.persistent[i] = HW_RTC_PERSISTENTn(i);
info.alarm = imx233_rtc_read_alarm();
info.alarm_en = BF_RD(RTC_PERSISTENT0, ALARM_EN);
info.alarm_wake_en = BF_RD(RTC_PERSISTENT0, ALARM_WAKE_EN);
info.alarm_wake = BF_RD(RTC_PERSISTENT0, ALARM_WAKE);
info.alarm_irq = BF_RD(RTC_CTRL, ALARM_IRQ);
return info;
}