Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 283423
b: refs/heads/master
c: cae659a
h: refs/heads/master
i:
  283421: 91a37f3
  283419: 0e0f009
  283415: 7536a66
  283407: e2dda3f
  283391: c0cafde
v: v3
  • Loading branch information
Daniel Drake authored and Anton Vorontsov committed Aug 19, 2011
1 parent 111fa0a commit 2747263
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c3503fd02558245ebbb0b48f3ae1d62416e3fd2a
refs/heads/master: cae659af87288a4b1723cdf94d713ef7fb4c56d9
24 changes: 24 additions & 0 deletions trunk/drivers/power/olpc_battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,24 @@ void olpc_battery_trigger_uevent(unsigned long cause)
kobject_uevent(&olpc_bat.dev->kobj, KOBJ_CHANGE);
}

static int olpc_battery_suspend(struct platform_device *pdev,
pm_message_t state)
{
if (device_may_wakeup(olpc_ac.dev))
olpc_ec_wakeup_set(EC_SCI_SRC_ACPWR);
else
olpc_ec_wakeup_clear(EC_SCI_SRC_ACPWR);

if (device_may_wakeup(olpc_bat.dev))
olpc_ec_wakeup_set(EC_SCI_SRC_BATTERY | EC_SCI_SRC_BATSOC
| EC_SCI_SRC_BATERR);
else
olpc_ec_wakeup_clear(EC_SCI_SRC_BATTERY | EC_SCI_SRC_BATSOC
| EC_SCI_SRC_BATERR);

return 0;
}

static int __devinit olpc_battery_probe(struct platform_device *pdev)
{
int ret;
Expand Down Expand Up @@ -578,6 +596,11 @@ static int __devinit olpc_battery_probe(struct platform_device *pdev)
if (ret)
goto error_failed;

if (olpc_ec_wakeup_available()) {
device_set_wakeup_capable(olpc_ac.dev, true);
device_set_wakeup_capable(olpc_bat.dev, true);
}

return 0;

error_failed:
Expand Down Expand Up @@ -612,6 +635,7 @@ static struct platform_driver olpc_battery_drv = {
},
.probe = olpc_battery_probe,
.remove = __devexit_p(olpc_battery_remove),
.suspend = olpc_battery_suspend,
};

static int __init olpc_bat_init(void)
Expand Down

0 comments on commit 2747263

Please sign in to comment.