Commit ae298d4a5a55786aee7df53aa8f1a4addad8ab1d
Committed by
Vaibhav Hiremath
1 parent
0666fe9e72
Exists in
v3.2_SMARCT335xPSP_04.06.00.11
and in
3 other branches
ARM: OMAP: AM33XX: PM: Enable RTC wakeup for standby
Add support for rtc wakeup from standby by keeping RTC module enabled during standby. RTC wakeup is corrected in the PG2.0 and hence it is supported only on PG2.x boards. To test RTC wakeup use below command: @ rtcwake -d /dev/rtc0 -m standby -s 5 Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Showing 1 changed file with 18 additions and 1 deletions Side-by-side Diff
arch/arm/mach-omap2/pm33xx.c
... | ... | @@ -102,11 +102,12 @@ |
102 | 102 | { |
103 | 103 | int state, ret = 0; |
104 | 104 | |
105 | - struct omap_hwmod *gpmc_oh, *usb_oh, *gpio1_oh; | |
105 | + struct omap_hwmod *gpmc_oh, *usb_oh, *gpio1_oh, *rtc_oh; | |
106 | 106 | |
107 | 107 | usb_oh = omap_hwmod_lookup("usb_otg_hs"); |
108 | 108 | gpmc_oh = omap_hwmod_lookup("gpmc"); |
109 | 109 | gpio1_oh = omap_hwmod_lookup("gpio1"); /* WKUP domain GPIO */ |
110 | + rtc_oh = omap_hwmod_lookup("rtc"); | |
110 | 111 | |
111 | 112 | omap_hwmod_enable(usb_oh); |
112 | 113 | omap_hwmod_enable(gpmc_oh); |
... | ... | @@ -123,6 +124,14 @@ |
123 | 124 | omap_hwmod_idle(gpmc_oh); |
124 | 125 | |
125 | 126 | /* |
127 | + * Keep RTC module enabled during standby | |
128 | + * for PG2.x to enable wakeup from RTC. | |
129 | + */ | |
130 | + if ((omap_rev() >= AM335X_REV_ES2_0) && | |
131 | + (suspend_state == PM_SUSPEND_STANDBY)) | |
132 | + omap_hwmod_enable(rtc_oh); | |
133 | + | |
134 | + /* | |
126 | 135 | * Disable the GPIO module. This ensure that |
127 | 136 | * only sWAKEUP interrupts to Cortex-M3 get generated |
128 | 137 | * |
... | ... | @@ -200,6 +209,14 @@ |
200 | 209 | */ |
201 | 210 | if (suspend_state == PM_SUSPEND_STANDBY) |
202 | 211 | omap_hwmod_idle(usb_oh); |
212 | + | |
213 | + /* | |
214 | + * Put RTC module to idle on resume from standby | |
215 | + * for PG2.x. | |
216 | + */ | |
217 | + if ((omap_rev() >= AM335X_REV_ES2_0) && | |
218 | + (suspend_state == PM_SUSPEND_STANDBY)) | |
219 | + omap_hwmod_idle(rtc_oh); | |
203 | 220 | |
204 | 221 | ret = am33xx_verify_lp_state(ret); |
205 | 222 |