Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 305483
b: refs/heads/master
c: c2c21e9
h: refs/heads/master
i:
  305481: fa3b606
  305479: 24a1e86
v: v3
  • Loading branch information
Daniel Drake authored and Ingo Molnar committed May 7, 2012
1 parent 20a3694 commit 8542ee6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d2aa37411b8e65d57d2c5ae36f0222274292020d
refs/heads/master: c2c21e9bb17549e8add4ff76931bcec2e2d3ad48
17 changes: 15 additions & 2 deletions trunk/arch/x86/platform/olpc/olpc-xo1-sci.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,18 @@ static irqreturn_t xo1_sci_intr(int irq, void *dev_id)
pm_wakeup_event(&power_button_idev->dev, 0);
}

if ((sts & (CS5536_RTC_FLAG | CS5536_WAK_FLAG)) ==
(CS5536_RTC_FLAG | CS5536_WAK_FLAG)) {
/* When the system is woken by the RTC alarm, report the
* event on the rtc device. */
struct device *rtc = bus_find_device_by_name(
&platform_bus_type, NULL, "rtc_cmos");
if (rtc) {
pm_wakeup_event(rtc, 0);
put_device(rtc);
}
}

if (gpe & CS5536_GPIOM7_PME_FLAG) { /* EC GPIO */
cs5535_gpio_set(OLPC_GPIO_ECSCI, GPIO_NEGATIVE_EDGE_STS);
schedule_work(&sci_work);
Expand Down Expand Up @@ -326,9 +338,10 @@ static int __devinit setup_sci_interrupt(struct platform_device *pdev)
outb(lo, CS5536_PIC_INT_SEL2);
}

/* Enable SCI from power button, and clear pending interrupts */
/* Enable interesting SCI events, and clear pending interrupts */
sts = inl(acpi_base + CS5536_PM1_STS);
outl((CS5536_PM_PWRBTN << 16) | 0xffff, acpi_base + CS5536_PM1_STS);
outl(((CS5536_PM_PWRBTN | CS5536_PM_RTC) << 16) | 0xffff,
acpi_base + CS5536_PM1_STS);

r = request_irq(sci_irq, xo1_sci_intr, 0, DRV_NAME, pdev);
if (r)
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/cs5535.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ static inline int cs5535_pic_unreqz_select_high(unsigned int group,

/* CS5536_PM1_STS bits */
#define CS5536_WAK_FLAG (1 << 15)
#define CS5536_RTC_FLAG (1 << 10)
#define CS5536_PWRBTN_FLAG (1 << 8)

/* CS5536_PM1_EN bits */
Expand Down

0 comments on commit 8542ee6

Please sign in to comment.