summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorPali Rohár <pali.rohar@gmail.com>2011-02-26 21:18:58 +0100
committerMatthew Garrett <mjg@redhat.com>2011-03-28 06:28:09 -0400
commit9a0b74fd873005122145364d3dfe4e1c9da1dad2 (patch)
treeea87e38d0d35ffe7a040ff8a7ea1b7b06fb9053b /drivers
parent143a4c0284dc2378b3ce78866b3548d90121d843 (diff)
downloadlinux-3.10-9a0b74fd873005122145364d3dfe4e1c9da1dad2.tar.gz
linux-3.10-9a0b74fd873005122145364d3dfe4e1c9da1dad2.tar.bz2
linux-3.10-9a0b74fd873005122145364d3dfe4e1c9da1dad2.zip
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')
-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 a8acf35d747..4c820937698 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)
static void acer_led_exit(void)
{
+ set_u32(LED_OFF, ACER_CAP_MAILLED);
led_classdev_unregister(&mail_led);
}
@@ -1553,6 +1554,7 @@ pm_message_t state)
if (has_cap(ACER_CAP_MAILLED)) {
get_u32(&value, ACER_CAP_MAILLED);
+ set_u32(LED_OFF, ACER_CAP_MAILLED);
data->mailled = value;
}
@@ -1580,6 +1582,17 @@ static int acer_platform_resume(struct platform_device *device)
return 0;
}
+static void acer_platform_shutdown(struct platform_device *device)
+{
+ struct acer_data *data = &interface->data;
+
+ if (!data)
+ return;
+
+ if (has_cap(ACER_CAP_MAILLED))
+ set_u32(LED_OFF, ACER_CAP_MAILLED);
+}
+
static struct platform_driver acer_platform_driver = {
.driver = {
.name = "acer-wmi",
@@ -1589,6 +1602,7 @@ static struct platform_driver acer_platform_driver = {
.remove = acer_platform_remove,
.suspend = acer_platform_suspend,
.resume = acer_platform_resume,
+ .shutdown = acer_platform_shutdown,
};
static struct platform_device *acer_platform_device;