* [PATCH] leds: leds-gpio: add shutdown function
@ 2015-10-13 5:17 Heiko Schocher
2015-10-13 9:13 ` Jacek Anaszewski
0 siblings, 1 reply; 2+ messages in thread
From: Heiko Schocher @ 2015-10-13 5:17 UTC (permalink / raw)
To: linux-kernel
Cc: Heiko Schocher, Jacek Anaszewski, Richard Purdie, linux-leds,
Georg.Soffel
add a shutdown function for setting the gpio-leds
into off state when shuting down.
Signed-off-by: Heiko Schocher <hs@denx.de>
---
drivers/leds/leds-gpio.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c
index af1876a..5db4515 100644
--- a/drivers/leds/leds-gpio.c
+++ b/drivers/leds/leds-gpio.c
@@ -291,9 +291,22 @@ static int gpio_led_remove(struct platform_device *pdev)
return 0;
}
+static void gpio_led_shutdown(struct platform_device *pdev)
+{
+ struct gpio_leds_priv *priv = platform_get_drvdata(pdev);
+ int i;
+
+ for (i = 0; i < priv->num_leds; i++) {
+ struct gpio_led_data *led = &priv->leds[i];
+
+ gpio_led_set(&led->cdev, LED_OFF);
+ }
+}
+
static struct platform_driver gpio_led_driver = {
.probe = gpio_led_probe,
.remove = gpio_led_remove,
+ .shutdown = gpio_led_shutdown,
.driver = {
.name = "leds-gpio",
.of_match_table = of_gpio_leds_match,
--
2.1.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] leds: leds-gpio: add shutdown function
2015-10-13 5:17 [PATCH] leds: leds-gpio: add shutdown function Heiko Schocher
@ 2015-10-13 9:13 ` Jacek Anaszewski
0 siblings, 0 replies; 2+ messages in thread
From: Jacek Anaszewski @ 2015-10-13 9:13 UTC (permalink / raw)
To: Heiko Schocher; +Cc: linux-kernel, Richard Purdie, linux-leds, Georg.Soffel
Hi Heiko,
On 10/13/2015 07:17 AM, Heiko Schocher wrote:
> add a shutdown function for setting the gpio-leds
> into off state when shuting down.
>
> Signed-off-by: Heiko Schocher <hs@denx.de>
> ---
>
> drivers/leds/leds-gpio.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c
> index af1876a..5db4515 100644
> --- a/drivers/leds/leds-gpio.c
> +++ b/drivers/leds/leds-gpio.c
> @@ -291,9 +291,22 @@ static int gpio_led_remove(struct platform_device *pdev)
> return 0;
> }
>
> +static void gpio_led_shutdown(struct platform_device *pdev)
> +{
> + struct gpio_leds_priv *priv = platform_get_drvdata(pdev);
> + int i;
> +
> + for (i = 0; i < priv->num_leds; i++) {
> + struct gpio_led_data *led = &priv->leds[i];
> +
> + gpio_led_set(&led->cdev, LED_OFF);
> + }
> +}
> +
> static struct platform_driver gpio_led_driver = {
> .probe = gpio_led_probe,
> .remove = gpio_led_remove,
> + .shutdown = gpio_led_shutdown,
> .driver = {
> .name = "leds-gpio",
> .of_match_table = of_gpio_leds_match,
>
Merged, thanks.
--
Best Regards,
Jacek Anaszewski
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-10-13 9:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-13 5:17 [PATCH] leds: leds-gpio: add shutdown function Heiko Schocher
2015-10-13 9:13 ` Jacek Anaszewski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).