aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorPali Rohár <pali.rohar@gmail.com>2011-02-26 15:18:58 -0500
committerMatthew Garrett <mjg@redhat.com>2011-03-28 06:28:09 -0400
commit9a0b74fd873005122145364d3dfe4e1c9da1dad2 (patch)
treeea87e38d0d35ffe7a040ff8a7ea1b7b06fb9053b /drivers/platform
parent143a4c0284dc2378b3ce78866b3548d90121d843 (diff)
acer-wmi: deactive mail led when power off
This patch deactive mail led when laptop is going to hibernete/suspend or power off. After resume from hibernate/suspend correctly restore mail led state. Signed-off-by: Pali Rohár <pali.rohar@gmail.com> Tested-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/acer-wmi.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
index a8acf35d7475..4c8209376985 100644
--- a/drivers/platform/x86/acer-wmi.c
+++ b/drivers/platform/x86/acer-wmi.c
@@ -991,6 +991,7 @@ static int __devinit acer_led_init(struct device *dev)
991 991
992static void acer_led_exit(void) 992static void acer_led_exit(void)
993{ 993{
994 set_u32(LED_OFF, ACER_CAP_MAILLED);
994 led_classdev_unregister(&mail_led); 995 led_classdev_unregister(&mail_led);
995} 996}
996 997
@@ -1553,6 +1554,7 @@ pm_message_t state)
1553 1554
1554 if (has_cap(ACER_CAP_MAILLED)) { 1555 if (has_cap(ACER_CAP_MAILLED)) {
1555 get_u32(&value, ACER_CAP_MAILLED); 1556 get_u32(&value, ACER_CAP_MAILLED);
1557 set_u32(LED_OFF, ACER_CAP_MAILLED);
1556 data->mailled = value; 1558 data->mailled = value;
1557 } 1559 }
1558 1560
@@ -1580,6 +1582,17 @@ static int acer_platform_resume(struct platform_device *device)
1580 return 0; 1582 return 0;
1581} 1583}
1582 1584
1585static void acer_platform_shutdown(struct platform_device *device)
1586{
1587 struct acer_data *data = &interface->data;
1588
1589 if (!data)
1590 return;
1591
1592 if (has_cap(ACER_CAP_MAILLED))
1593 set_u32(LED_OFF, ACER_CAP_MAILLED);
1594}
1595
1583static struct platform_driver acer_platform_driver = { 1596static struct platform_driver acer_platform_driver = {
1584 .driver = { 1597 .driver = {
1585 .name = "acer-wmi", 1598 .name = "acer-wmi",
@@ -1589,6 +1602,7 @@ static struct platform_driver acer_platform_driver = {
1589 .remove = acer_platform_remove, 1602 .remove = acer_platform_remove,
1590 .suspend = acer_platform_suspend, 1603 .suspend = acer_platform_suspend,
1591 .resume = acer_platform_resume, 1604 .resume = acer_platform_resume,
1605 .shutdown = acer_platform_shutdown,
1592}; 1606};
1593 1607
1594static struct platform_device *acer_platform_device; 1608static struct platform_device *acer_platform_device;