Skip to contentSkip to conversation

leds: rgb: leds-group-multicolor: allow leds to stay on in suspend

PATCH Superseded Aren Moynihan 3 participants 11 messages Jan 28, 2024 – Feb 1, 2024

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 leds: rgb: leds-group-multicolor: allow leds to stay on in suspend

If none of the managed leds enable LED_CORE_SUSPENDRESUME, then we shouldn't need to set it here. This makes it possible to use multicolor groups with gpio leds that enable retain-state-suspended in the device tree.

---

 drivers/leds/rgb/leds-group-multicolor.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/leds/rgb/leds-group-multicolor.c +6 -2
index 39f58be32af5..194c6a33640b 100644
@@ -69,7 +69,7 @@ static int leds_gmc_probe(struct platform_device *pdev)
 	struct mc_subled *subled;
 	struct leds_multicolor *priv;
 	unsigned int max_brightness = 0;
-	int i, ret, count = 0;
+	int i, ret, count, common_flags = 0;
 
 	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
 	if (!priv)
@@ -91,6 +91,7 @@ static int leds_gmc_probe(struct platform_device *pdev)
 		if (!priv->monochromatics)
 			return -ENOMEM;
 
+		common_flags |= led_cdev->flags;
 		priv->monochromatics[count] = led_cdev;
 
 		max_brightness = max(max_brightness, led_cdev->max_brightness);
@@ -114,12 +115,15 @@ static int leds_gmc_probe(struct platform_device *pdev)
 
 	/* Initialise the multicolor's LED class device */
 	cdev = &priv->mc_cdev.led_cdev;
-	cdev->flags = LED_CORE_SUSPENDRESUME;
 	cdev->brightness_set_blocking = leds_gmc_set;
 	cdev->max_brightness = max_brightness;
 	cdev->color = LED_COLOR_ID_MULTI;
 	priv->mc_cdev.num_colors = count;
 
+	/* we only need suspend/resume if a sub-led requests it */
+	if (common_flags & LED_CORE_SUSPENDRESUME)
+		cdev->flags = LED_CORE_SUSPENDRESUME;
+
 	init_data.fwnode = dev_fwnode(dev);
 	ret = devm_led_classdev_multicolor_register_ext(dev, &priv->mc_cdev, &init_data);
 	if (ret)
Signature · 1 line
2.43.0
#5 lore raw

PATCH 3/4 arm64: dts: sun50i-a64-pinephone: add multicolor led node

The red, green, and blue leds currently in the device tree represent a single rgb led on the front of the PinePhone.

---

 .../boot/dts/allwinner/sun50i-a64-pinephone.dtsi    | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi +10 -3
index ad2476ee01e4..6eab61a12cd8 100644
@@ -39,21 +39,21 @@ chosen {
 	leds {
 		compatible = "gpio-leds";
 
-		led-0 {
+		led0: led-0 {
 			function = LED_FUNCTION_INDICATOR;
 			color = <LED_COLOR_ID_BLUE>;
 			gpios = <&pio 3 20 GPIO_ACTIVE_HIGH>; /* PD20 */
 			retain-state-suspended;
 		};
 
-		led-1 {
+		led1: led-1 {
 			function = LED_FUNCTION_INDICATOR;
 			color = <LED_COLOR_ID_GREEN>;
 			gpios = <&pio 3 18 GPIO_ACTIVE_HIGH>; /* PD18 */
 			retain-state-suspended;
 		};
 
-		led-2 {
+		led2: led-2 {
 			function = LED_FUNCTION_INDICATOR;
 			color = <LED_COLOR_ID_RED>;
 			gpios = <&pio 3 19 GPIO_ACTIVE_HIGH>; /* PD19 */
@@ -61,6 +61,13 @@ led-2 {
 		};
 	};
 
+	multi-led {
+		compatible = "leds-group-multicolor";
+		color = <LED_COLOR_ID_RGB>;
+		function = LED_FUNCTION_INDICATOR;
+		leds = <&led0>, <&led1>, <&led2>;
+	};
+
 	reg_ps: ps-regulator {
 		compatible = "regulator-fixed";
 		regulator-name = "ps";
Signature · 1 line
2.43.0
#1 lore raw

PATCH 2/4 arm64: dts: sun50i-a64-pinephone: Retain leds state in suspend

In reply to Aren Moynihan

From: Miles Alan <[email protected]>

Allows user to set a led before entering suspend to know that the phone is still on (or could be used for notifications etc.)

---

 arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi | 3 +++
 1 file changed, 3 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi +3 -0
index 87847116ab6d..ad2476ee01e4 100644
@@ -43,18 +43,21 @@ led-0 {
 			function = LED_FUNCTION_INDICATOR;
 			color = <LED_COLOR_ID_BLUE>;
 			gpios = <&pio 3 20 GPIO_ACTIVE_HIGH>; /* PD20 */
+			retain-state-suspended;
 		};
 
 		led-1 {
 			function = LED_FUNCTION_INDICATOR;
 			color = <LED_COLOR_ID_GREEN>;
 			gpios = <&pio 3 18 GPIO_ACTIVE_HIGH>; /* PD18 */
+			retain-state-suspended;
 		};
 
 		led-2 {
 			function = LED_FUNCTION_INDICATOR;
 			color = <LED_COLOR_ID_RED>;
 			gpios = <&pio 3 19 GPIO_ACTIVE_HIGH>; /* PD19 */
+			retain-state-suspended;
 		};
 	};
 
Signature · 1 line
2.43.0
#8 lore raw

PATCH 4/4 arm64: dts: sun50i-a64-pinephone: change led type to status

In reply to Aren Moynihan

The status function is described in the documentation as being a rgb led used for system notifications on phones[1][2]. This is exactly what this led is used for on the PinePhone, so using status is probably more accurate than indicator.

1: Documentation/leds/well-known-leds.txt
2: include/dt-bindings/leds/common.h

---
I can't find any documentation describing the indicator function, so it's definitely less specific than status, but besides that I'm not sure how it compares.

Please ignore this patch if it's not useful and/or just causing churn.

 arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi +4 -4
index 6eab61a12cd8..4f39cfeb13ec 100644
@@ -40,21 +40,21 @@ leds {
 		compatible = "gpio-leds";
 
 		led0: led-0 {
-			function = LED_FUNCTION_INDICATOR;
+			function = LED_FUNCTION_STATUS;
 			color = <LED_COLOR_ID_BLUE>;
 			gpios = <&pio 3 20 GPIO_ACTIVE_HIGH>; /* PD20 */
 			retain-state-suspended;
 		};
 
 		led1: led-1 {
-			function = LED_FUNCTION_INDICATOR;
+			function = LED_FUNCTION_STATUS;
 			color = <LED_COLOR_ID_GREEN>;
 			gpios = <&pio 3 18 GPIO_ACTIVE_HIGH>; /* PD18 */
 			retain-state-suspended;
 		};
 
 		led2: led-2 {
-			function = LED_FUNCTION_INDICATOR;
+			function = LED_FUNCTION_STATUS;
 			color = <LED_COLOR_ID_RED>;
 			gpios = <&pio 3 19 GPIO_ACTIVE_HIGH>; /* PD19 */
 			retain-state-suspended;
@@ -64,7 +64,7 @@ led2: led-2 {
 	multi-led {
 		compatible = "leds-group-multicolor";
 		color = <LED_COLOR_ID_RGB>;
-		function = LED_FUNCTION_INDICATOR;
+		function = LED_FUNCTION_STATUS;
 		leds = <&led0>, <&led1>, <&led2>;
 	};
 
Signature · 1 line
2.43.0
maintainer Reviewed-by on v1 2/4
#2 lore raw

Re: [PATCH 2/4] arm64: dts: sun50i-a64-pinephone: Retain leds state in suspend

In reply to Aren Moynihan

Dne nedelja, 28. januar 2024 ob 21:45:08 CET je Aren Moynihan napisal(a):

Quoted 8 lines

From: Miles Alan <[email protected]>

Allows user to set a led before entering suspend to know that the phone is still on (or could be used for notifications etc.)

Where is patch 1 and possibly cover letter? Please resend with all patches.

However, this particular patch is:

Best regards,
Jernej

Quoted 32 lines

---

 arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi | 3 +++
 1 file changed, 3 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi +3 -0
index 87847116ab6d..ad2476ee01e4 100644
@@ -43,18 +43,21 @@ led-0 {
 			function = LED_FUNCTION_INDICATOR;
 			color = <LED_COLOR_ID_BLUE>;
 			gpios = <&pio 3 20 GPIO_ACTIVE_HIGH>; /* PD20 */
+			retain-state-suspended;
 		};
 
 		led-1 {
 			function = LED_FUNCTION_INDICATOR;
 			color = <LED_COLOR_ID_GREEN>;
 			gpios = <&pio 3 18 GPIO_ACTIVE_HIGH>; /* PD18 */
+			retain-state-suspended;
 		};
 
 		led-2 {
 			function = LED_FUNCTION_INDICATOR;
 			color = <LED_COLOR_ID_RED>;
 			gpios = <&pio 3 19 GPIO_ACTIVE_HIGH>; /* PD19 */
+			retain-state-suspended;
 		};
 	};
 
maintainer
#6 lore raw

Re: [PATCH 3/4] arm64: dts: sun50i-a64-pinephone: add multicolor led node

In reply to Aren Moynihan

Dne nedelja, 28. januar 2024 ob 21:45:09 CET je Aren Moynihan napisal(a):

Quoted 39 lines

The red, green, and blue leds currently in the device tree represent a single rgb led on the front of the PinePhone.

---

 .../boot/dts/allwinner/sun50i-a64-pinephone.dtsi    | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi +3 -3
index ad2476ee01e4..6eab61a12cd8 100644
@@ -39,21 +39,21 @@ chosen {
 	leds {
 		compatible = "gpio-leds";
 
-		led-0 {
+		led0: led-0 {
 			function = LED_FUNCTION_INDICATOR;
 			color = <LED_COLOR_ID_BLUE>;
 			gpios = <&pio 3 20 GPIO_ACTIVE_HIGH>; /* PD20 */
 			retain-state-suspended;
 		};
 
-		led-1 {
+		led1: led-1 {
 			function = LED_FUNCTION_INDICATOR;
 			color = <LED_COLOR_ID_GREEN>;
 			gpios = <&pio 3 18 GPIO_ACTIVE_HIGH>; /* PD18 */
 			retain-state-suspended;
 		};
 
-		led-2 {
+		led2: led-2 {
 			function = LED_FUNCTION_INDICATOR;
 			color = <LED_COLOR_ID_RED>;
 			gpios = <&pio 3 19 GPIO_ACTIVE_HIGH>; /* PD19 */

arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi led-2 { · line 67

Quoted 7 lines
arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi +4 -0
@@ -61,6 +61,13 @@ led-2 {
 		};
 	};
 
+	multi-led {
+		compatible = "leds-group-multicolor";
+		color = <LED_COLOR_ID_RGB>;
+		function = LED_FUNCTION_INDICATOR;

Does it make sense to have function specified here and above? Example specifies it only in multi-led node.

Best regards,
Jernej

Quoted 7 lines
arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi +3 -0
+		leds = <&led0>, <&led1>, <&led2>;
+	};
+
 	reg_ps: ps-regulator {
 		compatible = "regulator-fixed";
 		regulator-name = "ps";
#9 lore raw
In reply to Aren Moynihan
Quoted 16 lines · Aren Moynihan

If none of the managed leds enable LED_CORE_SUSPENDRESUME, then we shouldn't need to set it here. This makes it possible to use multicolor groups with gpio leds that enable retain-state-suspended in the device tree.

---

  drivers/leds/rgb/leds-group-multicolor.c | 8 ++++++--
  1 file changed, 6 insertions(+), 2 deletions(-)
drivers/leds/rgb/leds-group-multicolor.c +0 -0
index 39f58be32af5..194c6a33640b 100644

drivers/leds/rgb/leds-group-multicolor.c static int leds_gmc_probe(struct platform_device *pdev) · line 72

Quoted 5 lines
drivers/leds/rgb/leds-group-multicolor.c +1 -1
@@ -69,7 +69,7 @@ static int leds_gmc_probe(struct platform_device *pdev)
  	struct mc_subled *subled;
  	struct leds_multicolor *priv;
  	unsigned int max_brightness = 0;
-	int i, ret, count = 0;
+	int i, ret, count, common_flags = 0;

count is not initialized anymore. Isn't it a problem ?

Quoted 28 lines
drivers/leds/rgb/leds-group-multicolor.c +5 -1
  	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
  	if (!priv)
@@ -91,6 +91,7 @@ static int leds_gmc_probe(struct platform_device *pdev)
  		if (!priv->monochromatics)
  			return -ENOMEM;
 
+		common_flags |= led_cdev->flags;
  		priv->monochromatics[count] = led_cdev;
 
  		max_brightness = max(max_brightness, led_cdev->max_brightness);
@@ -114,12 +115,15 @@ static int leds_gmc_probe(struct platform_device *pdev)
 
  	/* Initialise the multicolor's LED class device */
  	cdev = &priv->mc_cdev.led_cdev;
-	cdev->flags = LED_CORE_SUSPENDRESUME;
  	cdev->brightness_set_blocking = leds_gmc_set;
  	cdev->max_brightness = max_brightness;
  	cdev->color = LED_COLOR_ID_MULTI;
  	priv->mc_cdev.num_colors = count;
 
+	/* we only need suspend/resume if a sub-led requests it */
+	if (common_flags & LED_CORE_SUSPENDRESUME)
+		cdev->flags = LED_CORE_SUSPENDRESUME;
+
  	init_data.fwnode = dev_fwnode(dev);
  	ret = devm_led_classdev_multicolor_register_ext(dev, &priv->mc_cdev, &init_data);
  	if (ret)
author
#7 lore raw

Re: [PATCH 3/4] arm64: dts: sun50i-a64-pinephone: add multicolor led node

In reply to Jernej Škrabec
Quoted 43 lines · Jernej Škrabec

Dne nedelja, 28. januar 2024 ob 21:45:09 CET je Aren Moynihan napisal(a):

Quoted 42 lines

The red, green, and blue leds currently in the device tree represent a single rgb led on the front of the PinePhone.

---

 .../boot/dts/allwinner/sun50i-a64-pinephone.dtsi    | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi +3 -3
index ad2476ee01e4..6eab61a12cd8 100644
@@ -39,21 +39,21 @@ chosen {
 	leds {
 		compatible = "gpio-leds";
 
-		led-0 {
+		led0: led-0 {
 			function = LED_FUNCTION_INDICATOR;
 			color = <LED_COLOR_ID_BLUE>;
 			gpios = <&pio 3 20 GPIO_ACTIVE_HIGH>; /* PD20 */
 			retain-state-suspended;
 		};
 
-		led-1 {
+		led1: led-1 {
 			function = LED_FUNCTION_INDICATOR;
 			color = <LED_COLOR_ID_GREEN>;
 			gpios = <&pio 3 18 GPIO_ACTIVE_HIGH>; /* PD18 */
 			retain-state-suspended;
 		};
 
-		led-2 {
+		led2: led-2 {
 			function = LED_FUNCTION_INDICATOR;
 			color = <LED_COLOR_ID_RED>;
 			gpios = <&pio 3 19 GPIO_ACTIVE_HIGH>; /* PD19 */
@@ -61,6 +61,13 @@ led-2 {
 		};
 	};
 
Quoted 7 lines

arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi led-2 { · line 67

Quoted 4 lines
arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi +4 -0
+	multi-led {
+		compatible = "leds-group-multicolor";
+		color = <LED_COLOR_ID_RGB>;
+		function = LED_FUNCTION_INDICATOR;

Does it make sense to have function specified here and above? Example specifies it only in multi-led node.

I'm not sure it makes much of a difference, besides perhaps confusing userspace. From what I can tell the only thing it'll change is the name of the directory in sysfs from "<color>:status" to "<color>:". I'll change this in v2 unless anyone has a reason not to.

Thanks
- Aren

Quoted 9 lines

Best regards,
Jernej

Quoted 6 lines
arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi +3 -0
+		leds = <&led0>, <&led1>, <&led2>;
+	};
+
 	reg_ps: ps-regulator {
 		compatible = "regulator-fixed";
 		regulator-name = "ps";
author
#3 lore raw

Re: [PATCH 2/4] arm64: dts: sun50i-a64-pinephone: Retain leds state in suspend

In reply to Jernej Škrabec
Quoted 11 lines · Jernej Škrabec

Dne nedelja, 28. januar 2024 ob 21:45:08 CET je Aren Moynihan napisal(a):

Quoted 8 lines

From: Miles Alan <[email protected]>

Allows user to set a led before entering suspend to know that the phone is still on (or could be used for notifications etc.)

Where is patch 1 and possibly cover letter? Please resend with all patches.

Oops, sorry about that, I'm still getting used to get_maintainer.pl. I'll resend this properly when I have time this weekend, until then the patch you missed is available at
https://lore.kernel.org/lkml/[email protected]/

Quoted 2 lines

However, this particular patch is:

Thanks
- Aren

Quoted 39 lines

Best regards,
Jernej

Quoted 32 lines

---

 arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi | 3 +++
 1 file changed, 3 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi +3 -0
index 87847116ab6d..ad2476ee01e4 100644
@@ -43,18 +43,21 @@ led-0 {
 			function = LED_FUNCTION_INDICATOR;
 			color = <LED_COLOR_ID_BLUE>;
 			gpios = <&pio 3 20 GPIO_ACTIVE_HIGH>; /* PD20 */
+			retain-state-suspended;
 		};
 
 		led-1 {
 			function = LED_FUNCTION_INDICATOR;
 			color = <LED_COLOR_ID_GREEN>;
 			gpios = <&pio 3 18 GPIO_ACTIVE_HIGH>; /* PD18 */
+			retain-state-suspended;
 		};
 
 		led-2 {
 			function = LED_FUNCTION_INDICATOR;
 			color = <LED_COLOR_ID_RED>;
 			gpios = <&pio 3 19 GPIO_ACTIVE_HIGH>; /* PD19 */
+			retain-state-suspended;
 		};
 	};
 
author
#10 lore raw
In reply to Jean-Jacques Hiblot
Quoted 14 lines · Jean-Jacques Hiblot
Quoted 11 lines · Aren Moynihan

If none of the managed leds enable LED_CORE_SUSPENDRESUME, then we shouldn't need to set it here. This makes it possible to use multicolor groups with gpio leds that enable retain-state-suspended in the device tree.

---

  drivers/leds/rgb/leds-group-multicolor.c | 8 ++++++--
  1 file changed, 6 insertions(+), 2 deletions(-)
Quoted 12 lines

drivers/leds/rgb/leds-group-multicolor.c static int leds_gmc_probe(struct platform_device *pdev) · line 72

Quoted 10 lines
drivers/leds/rgb/leds-group-multicolor.c +1 -1
index 39f58be32af5..194c6a33640b 100644
@@ -69,7 +69,7 @@ static int leds_gmc_probe(struct platform_device *pdev)
  	struct mc_subled *subled;
  	struct leds_multicolor *priv;
  	unsigned int max_brightness = 0;
-	int i, ret, count = 0;
+	int i, ret, count, common_flags = 0;

count is not initialized anymore. Isn't it a problem ?

Yes, good catch, thanks!

I'm not sure how I missed that when I tested this, I must've gotten (un)lucky with the value that was in ram before.

- Aren

Quoted 23 lines
Quoted 23 lines
drivers/leds/rgb/leds-group-multicolor.c +5 -1
  	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
  	if (!priv)
@@ -91,6 +91,7 @@ static int leds_gmc_probe(struct platform_device *pdev)
  		if (!priv->monochromatics)
  			return -ENOMEM;
+		common_flags |= led_cdev->flags;
  		priv->monochromatics[count] = led_cdev;
  		max_brightness = max(max_brightness, led_cdev->max_brightness);
@@ -114,12 +115,15 @@ static int leds_gmc_probe(struct platform_device *pdev)
  	/* Initialise the multicolor's LED class device */
  	cdev = &priv->mc_cdev.led_cdev;
-	cdev->flags = LED_CORE_SUSPENDRESUME;
  	cdev->brightness_set_blocking = leds_gmc_set;
  	cdev->max_brightness = max_brightness;
  	cdev->color = LED_COLOR_ID_MULTI;
  	priv->mc_cdev.num_colors = count;
+	/* we only need suspend/resume if a sub-led requests it */
+	if (common_flags & LED_CORE_SUSPENDRESUME)
+		cdev->flags = LED_CORE_SUSPENDRESUME;
+
  	init_data.fwnode = dev_fwnode(dev);
  	ret = devm_led_classdev_multicolor_register_ext(dev, &priv->mc_cdev, &init_data);
  	if (ret)
maintainer
#4 lore raw

Re: [PATCH 2/4] arm64: dts: sun50i-a64-pinephone: Retain leds state in suspend

In reply to Aren

Dne četrtek, 01. februar 2024 ob 02:36:46 CET je Aren napisal(a):

Quoted 11 lines · Jernej Škrabec
Quoted 10 lines

Dne nedelja, 28. januar 2024 ob 21:45:08 CET je Aren Moynihan napisal(a):

Quoted 8 lines

From: Miles Alan <[email protected]>

Allows user to set a led before entering suspend to know that the phone is still on (or could be used for notifications etc.)

Quoted 6 lines
Quoted 1 line

Where is patch 1 and possibly cover letter? Please resend with all patches.

Oops, sorry about that, I'm still getting used to get_maintainer.pl. I'll resend this properly when I have time this weekend, until then the patch you missed is available at
https://lore.kernel.org/lkml/[email protected]/

When sending patch series it's customary to send all patches to all maintainers and mailing lists (to have a context). In case of large patch series, you can send only selected patches to each maintainer and mailing lists, but then send cover letter to all involved and explain general idea behind the series.

Best regards,
Jernej

Quoted 47 lines
Quoted 3 lines

However, this particular patch is:

Thanks
- Aren

Quoted 39 lines

Best regards,
Jernej

Quoted 32 lines

---

 arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi | 3 +++
 1 file changed, 3 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi +3 -0
index 87847116ab6d..ad2476ee01e4 100644
@@ -43,18 +43,21 @@ led-0 {
 			function = LED_FUNCTION_INDICATOR;
 			color = <LED_COLOR_ID_BLUE>;
 			gpios = <&pio 3 20 GPIO_ACTIVE_HIGH>; /* PD20 */
+			retain-state-suspended;
 		};
 
 		led-1 {
 			function = LED_FUNCTION_INDICATOR;
 			color = <LED_COLOR_ID_GREEN>;
 			gpios = <&pio 3 18 GPIO_ACTIVE_HIGH>; /* PD18 */
+			retain-state-suspended;
 		};
 
 		led-2 {
 			function = LED_FUNCTION_INDICATOR;
 			color = <LED_COLOR_ID_RED>;
 			gpios = <&pio 3 19 GPIO_ACTIVE_HIGH>; /* PD19 */
+			retain-state-suspended;
 		};
 	};