]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ENGR00295892-1: leds: leds-gpio: keep charger led state while system suspended
authorRobin Gong <b38343@freescale.com>
Tue, 21 Jan 2014 02:41:46 +0000 (10:41 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Mon, 16 Jun 2014 16:10:06 +0000 (18:10 +0200)
gpio-leds driver common framework didn't take care of this case if use CONFIG_OF
, add property "retain-state-suspended" in dts and check it while gpio-leds
device created.

Signed-off-by: Robin Gong <b38343@freescale.com>
(cherry picked from commit 118c650de0bb518d377b0e6427b38fc101fe31aa)

drivers/leds/leds-gpio.c

index 57ff20fecf57e16e9963db1692206b923593258f..5650e487d8a6465a58762b2f1e2f74f7faf63056 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (C) 2007 8D Technologies inc.
  * Raphael Assenat <raph@8d.com>
- * Copyright (C) 2008 Freescale Semiconductor, Inc.
+ * Copyright (C) 2008, 2014 Freescale Semiconductor, Inc.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
@@ -202,6 +202,8 @@ static struct gpio_leds_priv *gpio_leds_create_of(struct platform_device *pdev)
                        else
                                led.default_state = LEDS_GPIO_DEFSTATE_OFF;
                }
+               if (of_get_property(child, "retain-state-suspended", NULL))
+                       led.retain_state_suspended = 1;
 
                if (of_get_property(child, "retain-state-suspended", NULL))
                        led.retain_state_suspended = 1;