Message ID | 20090108113418.4819.56434.stgit@i1501.lan.towertech.it |
---|---|
State | Accepted, archived |
Headers | show |
On Thursday 08 January 2009, Alessandro Zummo wrote: > From: Matti Halme <matti.halme@nokia.com> > > A triggering RTC alarm should be able to power on a device that has been > powered off. This patch enables that on twl4030 by not masking the alarm > interrupt at shutdown. > > Signed-off-by: Matti Halme <matti.halme@nokia.com> > Signed-off-by: Alessandro Zummo <a.zummo@towertech.it> > Cc: David Brownell <dbrownell@users.sourceforge.net> Acked-by: David Brownell <dbrownell@users.sourceforge.net> I had the same thought, but nothing to really test it with. Matti, were you able to test this? This resembles recent changes in rtc-cmos to make it ignore the S4/S5 distinction and always allow wake alarms where the hardware allows them. If you don't want a wake alarm, don't enable it ... or use a hard power-off. > Cc: Tony Lindgren <tony@atomide.com> > Cc: Samuel Ortiz <sameo@openedhand.com> > Cc: rtc-linux@googlegroups.com > --- > > drivers/rtc/rtc-twl4030.c | 5 +++-- > 1 files changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/rtc/rtc-twl4030.c b/drivers/rtc/rtc-twl4030.c > index 25dc3e1..ad35f76 100644 > --- a/drivers/rtc/rtc-twl4030.c > +++ b/drivers/rtc/rtc-twl4030.c > @@ -482,8 +482,9 @@ static int __devexit twl4030_rtc_remove(struct platform_device *pdev) > > static void twl4030_rtc_shutdown(struct platform_device *pdev) > { > - mask_rtc_irq_bit(BIT_RTC_INTERRUPTS_REG_IT_TIMER_M | > - BIT_RTC_INTERRUPTS_REG_IT_ALARM_M); > + /* mask timer interrupts, but leave alarm interrupts on to enable > + power-on when alarm is triggered */ > + mask_rtc_irq_bit(BIT_RTC_INTERRUPTS_REG_IT_TIMER_M); > } > > #ifdef CONFIG_PM > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to "rtc-linux". Membership options at http://groups.google.com/group/rtc-linux . Please read http://groups.google.com/group/rtc-linux/web/checklist before submitting a driver. -~----------~----~----~----~------~----~------~--~---
Yes, I was able to test the basic wake-up case. Matti > -----Original Message----- > From: ext David Brownell [mailto:david-b@pacbell.net] > Sent: 08 January, 2009 22:17 > To: Alessandro Zummo > Cc: akpm@linux-foundation.org; Halme Matti > (Nokia-D/Helsinki); Tony Lindgren; Samuel Ortiz; > rtc-linux@googlegroups.com > Subject: Re: [PATCH] rtc: rtc-twl4030 don't mask alarm > interrupts on shutdown > > On Thursday 08 January 2009, Alessandro Zummo wrote: > > From: Matti Halme <matti.halme@nokia.com> > > > > A triggering RTC alarm should be able to power on a device > that has been > > powered off. This patch enables that on twl4030 by not > masking the alarm > > interrupt at shutdown. > > > > Signed-off-by: Matti Halme <matti.halme@nokia.com> > > Signed-off-by: Alessandro Zummo <a.zummo@towertech.it> > > Cc: David Brownell <dbrownell@users.sourceforge.net> > > Acked-by: David Brownell <dbrownell@users.sourceforge.net> > > I had the same thought, but nothing to really test it with. > Matti, were you able to test this? > > This resembles recent changes in rtc-cmos to make it ignore > the S4/S5 distinction and always allow wake alarms where the > hardware allows them. If you don't want a wake alarm, don't > enable it ... or use a hard power-off. > > > > Cc: Tony Lindgren <tony@atomide.com> > > Cc: Samuel Ortiz <sameo@openedhand.com> > > Cc: rtc-linux@googlegroups.com > > --- > > > > drivers/rtc/rtc-twl4030.c | 5 +++-- > > 1 files changed, 3 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/rtc/rtc-twl4030.c b/drivers/rtc/rtc-twl4030.c > > index 25dc3e1..ad35f76 100644 > > --- a/drivers/rtc/rtc-twl4030.c > > +++ b/drivers/rtc/rtc-twl4030.c > > @@ -482,8 +482,9 @@ static int __devexit > twl4030_rtc_remove(struct platform_device *pdev) > > > > static void twl4030_rtc_shutdown(struct platform_device *pdev) > > { > > - mask_rtc_irq_bit(BIT_RTC_INTERRUPTS_REG_IT_TIMER_M | > > - BIT_RTC_INTERRUPTS_REG_IT_ALARM_M); > > + /* mask timer interrupts, but leave alarm interrupts on > to enable > > + power-on when alarm is triggered */ > > + mask_rtc_irq_bit(BIT_RTC_INTERRUPTS_REG_IT_TIMER_M); > > } > > > > #ifdef CONFIG_PM > > > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to "rtc-linux". Membership options at http://groups.google.com/group/rtc-linux . Please read http://groups.google.com/group/rtc-linux/web/checklist before submitting a driver. -~----------~----~----~----~------~----~------~--~---
diff --git a/drivers/rtc/rtc-twl4030.c b/drivers/rtc/rtc-twl4030.c index 25dc3e1..ad35f76 100644 --- a/drivers/rtc/rtc-twl4030.c +++ b/drivers/rtc/rtc-twl4030.c @@ -482,8 +482,9 @@ static int __devexit twl4030_rtc_remove(struct platform_device *pdev) static void twl4030_rtc_shutdown(struct platform_device *pdev) { - mask_rtc_irq_bit(BIT_RTC_INTERRUPTS_REG_IT_TIMER_M | - BIT_RTC_INTERRUPTS_REG_IT_ALARM_M); + /* mask timer interrupts, but leave alarm interrupts on to enable + power-on when alarm is triggered */ + mask_rtc_irq_bit(BIT_RTC_INTERRUPTS_REG_IT_TIMER_M); } #ifdef CONFIG_PM