linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/2] leds: leds-gpio: add retain-state-suspended property
@ 2014-01-20 11:41 Robin Gong
  2014-01-20 11:41 ` [PATCH v1 2/2] update binding doc of leds-gpio.txt Robin Gong
  2014-02-06 19:24 ` [PATCH v1 1/2] leds: leds-gpio: add retain-state-suspended property Bryan Wu
  0 siblings, 2 replies; 3+ messages in thread
From: Robin Gong @ 2014-01-20 11:41 UTC (permalink / raw)
  To: rob.herring, pawel.moll, mark.rutland, ijc+devicetree, galak,
	rob, cooloney, rpurdie, grant.likely
  Cc: devicetree, linux-doc, linux-kernel, linux-leds

Some gpio-leds need retain the state even in suspend, such as charger led.
But this property missed in devicetree, add it.

Signed-off-by: Robin Gong <b38343@freescale.com>
---
 drivers/leds/leds-gpio.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c
index 78b0e27..1bb3f1a 100644
--- a/drivers/leds/leds-gpio.c
+++ b/drivers/leds/leds-gpio.c
@@ -204,6 +204,9 @@ static struct gpio_leds_priv *gpio_leds_create_of(struct platform_device *pdev)
 				led.default_state = LEDS_GPIO_DEFSTATE_OFF;
 		}
 
+		if (of_get_property(child, "retain-state-suspended", NULL))
+			led.retain_state_suspended = 1;
+
 		ret = create_gpio_led(&led, &priv->leds[priv->num_leds++],
 				      &pdev->dev, NULL);
 		if (ret < 0) {
-- 
1.7.5.4



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH v1 2/2] update binding doc of leds-gpio.txt
  2014-01-20 11:41 [PATCH v1 1/2] leds: leds-gpio: add retain-state-suspended property Robin Gong
@ 2014-01-20 11:41 ` Robin Gong
  2014-02-06 19:24 ` [PATCH v1 1/2] leds: leds-gpio: add retain-state-suspended property Bryan Wu
  1 sibling, 0 replies; 3+ messages in thread
From: Robin Gong @ 2014-01-20 11:41 UTC (permalink / raw)
  To: rob.herring, pawel.moll, mark.rutland, ijc+devicetree, galak,
	rob, cooloney, rpurdie, grant.likely
  Cc: devicetree, linux-doc, linux-kernel, linux-leds

Update the binding doc for new property: "retain-state-suspended"

Signed-off-by: Robin Gong <b38343@freescale.com>
---
 .../devicetree/bindings/leds/leds-gpio.txt         |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/Documentation/devicetree/bindings/leds/leds-gpio.txt b/Documentation/devicetree/bindings/leds/leds-gpio.txt
index df1b308..f77148f 100644
--- a/Documentation/devicetree/bindings/leds/leds-gpio.txt
+++ b/Documentation/devicetree/bindings/leds/leds-gpio.txt
@@ -21,6 +21,8 @@ LED sub-node properties:
   on).  The "keep" setting will keep the LED at whatever its current
   state is, without producing a glitch.  The default is off if this
   property is not present.
+- retain-state-suspended: (optional) The suspend state can be retained.Such
+  as charge-led gpio.
 
 Examples:
 
@@ -50,3 +52,13 @@ run-control {
 		default-state = "on";
 	};
 };
+
+leds {
+	compatible = "gpio-leds";
+
+	charger-led {
+		gpios = <&gpio1 2 0>;
+		linux,default-trigger = "max8903-charger-charging";
+		retain-state-suspended;
+	};
+};
-- 
1.7.5.4



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v1 1/2] leds: leds-gpio: add retain-state-suspended property
  2014-01-20 11:41 [PATCH v1 1/2] leds: leds-gpio: add retain-state-suspended property Robin Gong
  2014-01-20 11:41 ` [PATCH v1 2/2] update binding doc of leds-gpio.txt Robin Gong
@ 2014-02-06 19:24 ` Bryan Wu
  1 sibling, 0 replies; 3+ messages in thread
From: Bryan Wu @ 2014-02-06 19:24 UTC (permalink / raw)
  To: Robin Gong
  Cc: Pawel Moll, Mark Rutland, Ian Campbell, galak, Rob Landley,
	rpurdie, Grant Likely, devicetree, linux-doc, lkml,
	Linux LED Subsystem, Rob Herring

On Mon, Jan 20, 2014 at 3:41 AM, Robin Gong <b38343@freescale.com> wrote:
> Some gpio-leds need retain the state even in suspend, such as charger led.
> But this property missed in devicetree, add it.
>

Good catch, I just fold these 2 patches into one patch and applied.
Thanks,
-Bryan


> Signed-off-by: Robin Gong <b38343@freescale.com>
> ---
>  drivers/leds/leds-gpio.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c
> index 78b0e27..1bb3f1a 100644
> --- a/drivers/leds/leds-gpio.c
> +++ b/drivers/leds/leds-gpio.c
> @@ -204,6 +204,9 @@ static struct gpio_leds_priv *gpio_leds_create_of(struct platform_device *pdev)
>                                 led.default_state = LEDS_GPIO_DEFSTATE_OFF;
>                 }
>
> +               if (of_get_property(child, "retain-state-suspended", NULL))
> +                       led.retain_state_suspended = 1;
> +
>                 ret = create_gpio_led(&led, &priv->leds[priv->num_leds++],
>                                       &pdev->dev, NULL);
>                 if (ret < 0) {
> --
> 1.7.5.4
>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-02-06 19:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-20 11:41 [PATCH v1 1/2] leds: leds-gpio: add retain-state-suspended property Robin Gong
2014-01-20 11:41 ` [PATCH v1 2/2] update binding doc of leds-gpio.txt Robin Gong
2014-02-06 19:24 ` [PATCH v1 1/2] leds: leds-gpio: add retain-state-suspended property Bryan Wu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).