From: Robin Gong Date: Tue, 21 Jan 2014 02:41:46 +0000 (+0800) Subject: ENGR00295892-1: leds: leds-gpio: keep charger led state while system suspended X-Git-Tag: KARO-TX6-2014-08-21~1^2~65 X-Git-Url: https://git.karo-electronics.de/?p=karo-tx-linux.git;a=commitdiff_plain;h=85b49f461463ecf79720135b202b135113c095a6 ENGR00295892-1: leds: leds-gpio: keep charger led state while system suspended 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 (cherry picked from commit 118c650de0bb518d377b0e6427b38fc101fe31aa) --- diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c index 57ff20fecf57..5650e487d8a6 100644 --- a/drivers/leds/leds-gpio.c +++ b/drivers/leds/leds-gpio.c @@ -3,7 +3,7 @@ * * Copyright (C) 2007 8D Technologies inc. * Raphael Assenat - * 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;