All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] acer-wmi: deactive mail led when power off
@ 2011-02-26 20:18 Pali Rohár
  2011-02-27 10:29 ` Carlos Corbacho
  2011-03-11 17:30 ` Matthew Garrett
  0 siblings, 2 replies; 3+ messages in thread
From: Pali Rohár @ 2011-02-26 20:18 UTC (permalink / raw)
  To: platform-driver-x86, carlos

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>

--- a/drivers/platform/x86/acer-wmi.c/acer-wmi.c	2011-01-30
00:28:04.000000000 +0100
+++ b/drivers/platform/x86/acer-wmi.c/acer-wmi.c	2011-01-30
01:30:02.000000000 +0100
@@ -887,6 +887,7 @@ static int __devinit acer_led_init(struc

 static void acer_led_exit(void)
 {
+	set_u32(LED_OFF, ACER_CAP_MAILLED);
 	led_classdev_unregister(&mail_led);
 }

@@ -1166,6 +1167,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;
 	}

@@ -1193,6 +1195,17 @@ static int acer_platform_resume(struct p
 	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",
@@ -1202,6 +1215,7 @@ static struct platform_driver acer_platf
 	.remove = acer_platform_remove,
 	.suspend = acer_platform_suspend,
 	.resume = acer_platform_resume,
+	.shutdown = acer_platform_shutdown,
 };

 static struct platform_device *acer_platform_device;


--
Pali Rohár
pali.rohar@gmail.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] acer-wmi: deactive mail led when power off
  2011-02-26 20:18 [PATCH] acer-wmi: deactive mail led when power off Pali Rohár
@ 2011-02-27 10:29 ` Carlos Corbacho
  2011-03-11 17:30 ` Matthew Garrett
  1 sibling, 0 replies; 3+ messages in thread
From: Carlos Corbacho @ 2011-02-27 10:29 UTC (permalink / raw)
  To: Pali Rohár; +Cc: platform-driver-x86

On Saturday 26 Feb 2011 20:18:58 Pali Rohár wrote:
> 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>

Acked-by: Carlos Corbacho <carlos@strangeworlds.co.uk>

> Tested-by: Pali Rohár <pali.rohar@gmail.com>
> 
> --- a/drivers/platform/x86/acer-wmi.c/acer-wmi.c	2011-01-30
> 00:28:04.000000000 +0100
> +++ b/drivers/platform/x86/acer-wmi.c/acer-wmi.c	2011-01-30
> 01:30:02.000000000 +0100
> @@ -887,6 +887,7 @@ static int __devinit acer_led_init(struc
> 
>  static void acer_led_exit(void)
>  {
> +	set_u32(LED_OFF, ACER_CAP_MAILLED);
>  	led_classdev_unregister(&mail_led);
>  }
> 
> @@ -1166,6 +1167,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;
>  	}
> 
> @@ -1193,6 +1195,17 @@ static int acer_platform_resume(struct p
>  	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",
> @@ -1202,6 +1215,7 @@ static struct platform_driver acer_platf
>  	.remove = acer_platform_remove,
>  	.suspend = acer_platform_suspend,
>  	.resume = acer_platform_resume,
> +	.shutdown = acer_platform_shutdown,
>  };
> 
>  static struct platform_device *acer_platform_device;
> 
> 
> --
> Pali Rohár
> pali.rohar@gmail.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] acer-wmi: deactive mail led when power off
  2011-02-26 20:18 [PATCH] acer-wmi: deactive mail led when power off Pali Rohár
  2011-02-27 10:29 ` Carlos Corbacho
@ 2011-03-11 17:30 ` Matthew Garrett
  1 sibling, 0 replies; 3+ messages in thread
From: Matthew Garrett @ 2011-03-11 17:30 UTC (permalink / raw)
  To: Pali Rohár; +Cc: platform-driver-x86, carlos

Applied, thanks.

-- 
Matthew Garrett | mjg59@srcf.ucam.org

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-03-11 17:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-26 20:18 [PATCH] acer-wmi: deactive mail led when power off Pali Rohár
2011-02-27 10:29 ` Carlos Corbacho
2011-03-11 17:30 ` Matthew Garrett

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.