Skip to contentSkip to conversation

Suggestion and patch about the alarm of TWL4030-RTC

PATCH Kim Kyuwon 3 participants 3 messages Apr 22, 2009 Real time clock (RTC)

lore
Share & tools
lore

Kim Kyuwon

author
#0 lore raw

Hi All,

Quoted 1 line

From the twl4030_rtc_suspend() in rtc-twl4030.c, the alarm signal of TWL4030 RTC can't wake up the system form suspend.

However, I think it is more reasonable to alarm wake up the system and this is just we do. (Mobile phone is mostly in suspend state, especially in the morning, thus alarm signal can wake up the phone!) So I'm sending following patch.

Please give your comments.
I really want to apply this patch.

Thanks & Regards,
Kyuwon

--

Quoted 1 line

From 9d70ffc38653b1fb0dc7ae0950502e4adfe06c50 Mon Sep 17 00:00:00 2001

From: Kim Kyuwon <[email protected]>
Date: Wed, 22 Apr 2009 13:29:50 +0900
Subject: [PATCH] rtc: rtc-twl4030 don't mask alarm interrupts on suspend

This patch enables the alarm interrupt of TWL4030 RTC to wake up the system from suspend

---
 drivers/rtc/rtc-twl4030.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
drivers/rtc/rtc-twl4030.c +1 -3
index ad35f76..c185939 100644
@@ -495,9 +495,7 @@ static int twl4030_rtc_suspend(struct platform_device *pdev, pm_message_t state)
 {
 	irqstat = rtc_irq_bits;
 
-	/* REVISIT alarm may need to wake us from sleep */
-	mask_rtc_irq_bit(BIT_RTC_INTERRUPTS_REG_IT_TIMER_M |
-			 BIT_RTC_INTERRUPTS_REG_IT_ALARM_M);
+	mask_rtc_irq_bit(BIT_RTC_INTERRUPTS_REG_IT_TIMER_M);
 	return 0;
 }
 
Signature · 1 line
1.5.2.5
#1 lore raw
Quoted 14 lines · Kim Kyuwon

Hi All,

Quoted 1 line

From the twl4030_rtc_suspend() in rtc-twl4030.c, the alarm signal of TWL4030 RTC can't wake up the system form suspend.

However, I think it is more reasonable to alarm wake up the system and this is just we do. (Mobile phone is mostly in suspend state, especially in the morning, thus alarm signal can wake up the phone!) So I'm sending following patch.

Please give your comments.
I really want to apply this patch.

Thanks & Regards,
Kyuwon

--

Quoted 8 lines
Quoted 1 line

From 9d70ffc38653b1fb0dc7ae0950502e4adfe06c50 Mon Sep 17 00:00:00 2001

From: Kim Kyuwon <[email protected]>
Date: Wed, 22 Apr 2009 13:29:50 +0900
Subject: [PATCH] rtc: rtc-twl4030 don't mask alarm interrupts on suspend

This patch enables the alarm interrupt of TWL4030 RTC to wake up the system from suspend

Looks right to me. If you've tested thhis:

The reason I left that original clearly-wrong code in place was that I had yet to see an OMAP3-based system which could use the system suspend state, so it was unclear that change would suffice...

Quoted 23 lines
---
 drivers/rtc/rtc-twl4030.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
drivers/rtc/rtc-twl4030.c +1 -3
index ad35f76..c185939 100644
@@ -495,9 +495,7 @@ static int twl4030_rtc_suspend(struct platform_device *pdev, pm_message_t state)
 {
 	irqstat = rtc_irq_bits;
 
-	/* REVISIT alarm may need to wake us from sleep */
-	mask_rtc_irq_bit(BIT_RTC_INTERRUPTS_REG_IT_TIMER_M |
-			 BIT_RTC_INTERRUPTS_REG_IT_ALARM_M);
+	mask_rtc_irq_bit(BIT_RTC_INTERRUPTS_REG_IT_TIMER_M);
 	return 0;
 }
 
Signature · 1 line
1.5.2.5
#2 lore raw
Quoted 20 lines · David Brownell
Quoted 19 lines · Kim Kyuwon

Hi All,

Quoted 1 line

From the twl4030_rtc_suspend() in rtc-twl4030.c, the alarm signal of TWL4030 RTC can't wake up the system form suspend.

However, I think it is more reasonable to alarm wake up the system and this is just we do. (Mobile phone is mostly in suspend state, especially in the morning, thus alarm signal can wake up the phone!) So I'm sending following patch.

Please give your comments.
I really want to apply this patch.

Thanks & Regards,
Kyuwon

--

Quoted 1 line

From 9d70ffc38653b1fb0dc7ae0950502e4adfe06c50 Mon Sep 17 00:00:00 2001

From: Kim Kyuwon <[email protected]>
Date: Wed, 22 Apr 2009 13:29:50 +0900
Subject: [PATCH] rtc: rtc-twl4030 don't mask alarm interrupts on suspend

Quoted 5 lines
Quoted 3 lines

This patch enables the alarm interrupt of TWL4030 RTC to wake up the system from suspend

Looks right to me.  If you've tested thhis:

I tested with following commands,

# echo +10 > sys/class/rtc/rtc0/wakealarm; echo mem > /sys/power/state;

I confirm that the system wake up after 10 seconds. Thank you.

Quoted 27 lines

The reason I left that original clearly-wrong code in place was that I had yet to see an OMAP3-based system which could use the system suspend state, so it was unclear that change would suffice...

Quoted 19 lines

---
 drivers/rtc/rtc-twl4030.c |    4 +---

 1 files changed, 1 insertions(+), 3 deletions(-)
drivers/rtc/rtc-twl4030.c +1 -3
index ad35f76..c185939 100644
@@ -495,9 +495,7 @@ static int twl4030_rtc_suspend(struct platform_device *pdev, pm_message_t state)
  {
       irqstat = rtc_irq_bits;
 
-     /* REVISIT alarm may need to wake us from sleep */
-     mask_rtc_irq_bit(BIT_RTC_INTERRUPTS_REG_IT_TIMER_M |
-                      BIT_RTC_INTERRUPTS_REG_IT_ALARM_M);
+     mask_rtc_irq_bit(BIT_RTC_INTERRUPTS_REG_IT_TIMER_M);
       return 0;
  }
 
Quoted 7 lines
Quoted 4 lines

--
1.5.2.5

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html