diff options
-rw-r--r-- | arch/x86/platform/olpc/olpc-xo1-sci.c | 17 | ||||
-rw-r--r-- | include/linux/cs5535.h | 1 |
2 files changed, 16 insertions, 2 deletions
diff --git a/arch/x86/platform/olpc/olpc-xo1-sci.c b/arch/x86/platform/olpc/olpc-xo1-sci.c index 4b93ff46cec3..04b8c73659c5 100644 --- a/arch/x86/platform/olpc/olpc-xo1-sci.c +++ b/arch/x86/platform/olpc/olpc-xo1-sci.c | |||
@@ -236,6 +236,18 @@ static irqreturn_t xo1_sci_intr(int irq, void *dev_id) | |||
236 | pm_wakeup_event(&power_button_idev->dev, 0); | 236 | pm_wakeup_event(&power_button_idev->dev, 0); |
237 | } | 237 | } |
238 | 238 | ||
239 | if ((sts & (CS5536_RTC_FLAG | CS5536_WAK_FLAG)) == | ||
240 | (CS5536_RTC_FLAG | CS5536_WAK_FLAG)) { | ||
241 | /* When the system is woken by the RTC alarm, report the | ||
242 | * event on the rtc device. */ | ||
243 | struct device *rtc = bus_find_device_by_name( | ||
244 | &platform_bus_type, NULL, "rtc_cmos"); | ||
245 | if (rtc) { | ||
246 | pm_wakeup_event(rtc, 0); | ||
247 | put_device(rtc); | ||
248 | } | ||
249 | } | ||
250 | |||
239 | if (gpe & CS5536_GPIOM7_PME_FLAG) { /* EC GPIO */ | 251 | if (gpe & CS5536_GPIOM7_PME_FLAG) { /* EC GPIO */ |
240 | cs5535_gpio_set(OLPC_GPIO_ECSCI, GPIO_NEGATIVE_EDGE_STS); | 252 | cs5535_gpio_set(OLPC_GPIO_ECSCI, GPIO_NEGATIVE_EDGE_STS); |
241 | schedule_work(&sci_work); | 253 | schedule_work(&sci_work); |
@@ -326,9 +338,10 @@ static int __devinit setup_sci_interrupt(struct platform_device *pdev) | |||
326 | outb(lo, CS5536_PIC_INT_SEL2); | 338 | outb(lo, CS5536_PIC_INT_SEL2); |
327 | } | 339 | } |
328 | 340 | ||
329 | /* Enable SCI from power button, and clear pending interrupts */ | 341 | /* Enable interesting SCI events, and clear pending interrupts */ |
330 | sts = inl(acpi_base + CS5536_PM1_STS); | 342 | sts = inl(acpi_base + CS5536_PM1_STS); |
331 | outl((CS5536_PM_PWRBTN << 16) | 0xffff, acpi_base + CS5536_PM1_STS); | 343 | outl(((CS5536_PM_PWRBTN | CS5536_PM_RTC) << 16) | 0xffff, |
344 | acpi_base + CS5536_PM1_STS); | ||
332 | 345 | ||
333 | r = request_irq(sci_irq, xo1_sci_intr, 0, DRV_NAME, pdev); | 346 | r = request_irq(sci_irq, xo1_sci_intr, 0, DRV_NAME, pdev); |
334 | if (r) | 347 | if (r) |
diff --git a/include/linux/cs5535.h b/include/linux/cs5535.h index c077aec3a6ff..cfe83239d7f0 100644 --- a/include/linux/cs5535.h +++ b/include/linux/cs5535.h | |||
@@ -95,6 +95,7 @@ static inline int cs5535_pic_unreqz_select_high(unsigned int group, | |||
95 | 95 | ||
96 | /* CS5536_PM1_STS bits */ | 96 | /* CS5536_PM1_STS bits */ |
97 | #define CS5536_WAK_FLAG (1 << 15) | 97 | #define CS5536_WAK_FLAG (1 << 15) |
98 | #define CS5536_RTC_FLAG (1 << 10) | ||
98 | #define CS5536_PWRBTN_FLAG (1 << 8) | 99 | #define CS5536_PWRBTN_FLAG (1 << 8) |
99 | 100 | ||
100 | /* CS5536_PM1_EN bits */ | 101 | /* CS5536_PM1_EN bits */ |