summaryrefslogtreecommitdiff
path: root/drivers/leds/leds-gpio.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-11-03 23:20:29 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2015-11-03 23:20:29 +0300
commite8a2a176dd0f3e4c7252b79dc5cea6bd4acaf78e (patch)
tree40404416b0461248b115f323119bffbe938744aa /drivers/leds/leds-gpio.c
parent5062ecdb662bf3aed6dc975019c53ffcd3b01d1c (diff)
parentffdc307d038f02617041f8e5c7e3cd00a1706a2a (diff)
downloadlinux-e8a2a176dd0f3e4c7252b79dc5cea6bd4acaf78e.tar.xz
Merge tag 'leds_for_4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds
Pull LED updates from Jacek Anaszewski: - Move the out-of-LED-tree led-sead3 driver to the LED subsystem. - Add 'invert' sysfs attribute to the heartbeat trigger. - Add Device Tree support to the leds-netxbig driver and add related DT nodes to the kirkwood-netxbig.dtsi and kirkwood-net5big.dts files. Remove static LED setup from the related board files. - Remove redundant brightness conversion operation from leds-netxbig. - Improve leds-bcm6328 driver: improve default-state handling, add more init configuration options, print invalid LED instead of warning only about maximum LED value. - Add a shutdown function for setting gpio-leds into off state when shutting down. - Fix DT flash timeout property naming in leds-aat1290.txt. - Switch to using devm prefixed version of led_classdev_register() (leds-cobalt-qube, leds-hp6xx, leds-ot200, leds-ipaq-micro, leds-netxbig, leds-locomo, leds-menf21bmc, leds-net48xx, leds-wrap). - Add missing of_node_put (leds-powernv, leds-bcm6358, leds-bcm6328, leds-88pm860x). - Coding style fixes and cleanups: led-class/led-core, leds-ipaq-micro. * tag 'leds_for_4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds: (27 commits) leds: 88pm860x: add missing of_node_put leds: bcm6328: add missing of_node_put leds: bcm6358: add missing of_node_put powerpc/powernv: add missing of_node_put leds: leds-wrap.c: Use devm_led_classdev_register leds: aat1290: Fix property naming of flash-timeout-us leds: leds-net48xx: Use devm_led_classdev_register leds: leds-menf21bmc.c: Use devm_led_class_register leds: leds-locomo.c: Use devm_led_classdev_register leds: leds-gpio: add shutdown function Documentation: leds: update DT bindings for leds-bcm6328 leds-bcm6328: add more init configuration options leds-bcm6328: simplify and improve default-state handling leds-bcm6328: print invalid LED leds: netxbig: set led_classdev max_brightness leds: netxbig: convert to use the devm_ functions ARM: mvebu: remove static LED setup for netxbig boards ARM: Kirkwood: add LED DT entries for netxbig boards leds: netxbig: add device tree binding leds: triggers: add invert to heartbeat ...
Diffstat (limited to 'drivers/leds/leds-gpio.c')
-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,