From: Heiko Schocher Date: Tue, 13 Oct 2015 05:17:12 +0000 (+0200) Subject: leds: leds-gpio: add shutdown function X-Git-Tag: submit/tizen/20160607.132125~1530^2~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=707f33ed85ff423016674d27bb2e60fe8fa352ce;p=sdk%2Femulator%2Femulator-kernel.git leds: leds-gpio: add shutdown function add a shutdown function for setting the gpio-leds into off state when shuting down. Signed-off-by: Heiko Schocher Signed-off-by: Jacek Anaszewski --- 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,