summaryrefslogtreecommitdiffstats
path: root/drivers/leds
diff options
context:
space:
mode:
authorHeiko Schocher <hs@denx.de>2015-10-13 07:17:12 +0200
committerJacek Anaszewski <j.anaszewski@samsung.com>2015-11-03 08:59:48 +0100
commit707f33ed85ff423016674d27bb2e60fe8fa352ce (patch)
treea5e4bb2b7791af80978c058b70ada6b555efbf0d /drivers/leds
parent1d3ff22d633d35048c35c3deeead7ab116cebc32 (diff)
downloadlinux-stable-707f33ed85ff423016674d27bb2e60fe8fa352ce.tar.gz
linux-stable-707f33ed85ff423016674d27bb2e60fe8fa352ce.tar.bz2
linux-stable-707f33ed85ff423016674d27bb2e60fe8fa352ce.zip
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 <hs@denx.de> Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
Diffstat (limited to 'drivers/leds')
-rw-r--r--drivers/leds/leds-gpio.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c
index af1876a3a77c..5db4515a4fd7 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,