Commit 9a0b74fd873005122145364d3dfe4e1c9da1dad2
Committed by
Matthew Garrett
1 parent
143a4c0284
Exists in
master
and in
4 other branches
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>
Showing 1 changed file with 14 additions and 0 deletions Side-by-side Diff
drivers/platform/x86/acer-wmi.c
... | ... | @@ -991,6 +991,7 @@ |
991 | 991 | |
992 | 992 | static void acer_led_exit(void) |
993 | 993 | { |
994 | + set_u32(LED_OFF, ACER_CAP_MAILLED); | |
994 | 995 | led_classdev_unregister(&mail_led); |
995 | 996 | } |
996 | 997 | |
... | ... | @@ -1553,6 +1554,7 @@ |
1553 | 1554 | |
1554 | 1555 | if (has_cap(ACER_CAP_MAILLED)) { |
1555 | 1556 | get_u32(&value, ACER_CAP_MAILLED); |
1557 | + set_u32(LED_OFF, ACER_CAP_MAILLED); | |
1556 | 1558 | data->mailled = value; |
1557 | 1559 | } |
1558 | 1560 | |
... | ... | @@ -1580,6 +1582,17 @@ |
1580 | 1582 | return 0; |
1581 | 1583 | } |
1582 | 1584 | |
1585 | +static 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 | + | |
1583 | 1596 | static struct platform_driver acer_platform_driver = { |
1584 | 1597 | .driver = { |
1585 | 1598 | .name = "acer-wmi", |
... | ... | @@ -1589,6 +1602,7 @@ |
1589 | 1602 | .remove = acer_platform_remove, |
1590 | 1603 | .suspend = acer_platform_suspend, |
1591 | 1604 | .resume = acer_platform_resume, |
1605 | + .shutdown = acer_platform_shutdown, | |
1592 | 1606 | }; |
1593 | 1607 | |
1594 | 1608 | static struct platform_device *acer_platform_device; |