arm64: dts: freescale: debix-som: Add heartbeat LED

Message ID 20231021005100.3490929-1-kieran.bingham@ideasonboard.com
State New
Headers
Series arm64: dts: freescale: debix-som: Add heartbeat LED |

Commit Message

Kieran Bingham Oct. 21, 2023, 12:50 a.m. UTC
  Map the 'RUN' LED present on the Debix-SOM as a heartbeat.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
 .../dts/freescale/imx8mp-debix-som-a.dtsi     | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
  

Comments

Marco Felsch Oct. 21, 2023, 2:08 p.m. UTC | #1
Hi Kieran,

On 23-10-21, Kieran Bingham wrote:
> Map the 'RUN' LED present on the Debix-SOM as a heartbeat.
> 
> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> ---
>  .../dts/freescale/imx8mp-debix-som-a.dtsi     | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/freescale/imx8mp-debix-som-a.dtsi b/arch/arm64/boot/dts/freescale/imx8mp-debix-som-a.dtsi
> index bc312aa1bfc8..c9a81486da48 100644
> --- a/arch/arm64/boot/dts/freescale/imx8mp-debix-som-a.dtsi
> +++ b/arch/arm64/boot/dts/freescale/imx8mp-debix-som-a.dtsi
> @@ -20,6 +20,19 @@ reg_usdhc2_vmmc: regulator-usdhc2 {
>  		gpio = <&gpio2 19 GPIO_ACTIVE_HIGH>;
>  		enable-active-high;
>  	};
> +
> +	gpio-leds {
> +		compatible = "gpio-leds";
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&pinctrl_gpio_led>;
> +
> +		status {

according the bindings-doc, this should be:

		'led-status' or 'led-0'

> +			label = "yellow:status";

label is deprecated, instead function and color should be used.

With that fixed feel to add my:

Reviewed-by: Marco Felsch <m.felsch@pengutronix.de>

> +			gpios = <&gpio3 16 GPIO_ACTIVE_HIGH>;
> +			default-state = "on";
> +			linux,default-trigger = "heartbeat";
> +		};
> +	};
>  };
>  
>  &A53_0 {
> @@ -203,6 +216,12 @@ &wdog1 {
>  };
>  
>  &iomuxc {
> +	pinctrl_gpio_led: gpioledgrp {
> +		fsl,pins = <
> +			MX8MP_IOMUXC_NAND_READY_B__GPIO3_IO16		0x19
> +		>;
> +	};
> +
>  	pinctrl_i2c1: i2c1grp {
>  		fsl,pins = <
>  			MX8MP_IOMUXC_I2C1_SCL__I2C1_SCL			0x400001c2
> -- 
> 2.34.1
> 
>
  
Kieran Bingham Oct. 23, 2023, 12:57 p.m. UTC | #2
Hi Marco,

Quoting Marco Felsch (2023-10-21 15:08:02)
> Hi Kieran,
> 
> On 23-10-21, Kieran Bingham wrote:
> > Map the 'RUN' LED present on the Debix-SOM as a heartbeat.
> > 
> > Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> > ---
> >  .../dts/freescale/imx8mp-debix-som-a.dtsi     | 19 +++++++++++++++++++
> >  1 file changed, 19 insertions(+)
> > 
> > diff --git a/arch/arm64/boot/dts/freescale/imx8mp-debix-som-a.dtsi b/arch/arm64/boot/dts/freescale/imx8mp-debix-som-a.dtsi
> > index bc312aa1bfc8..c9a81486da48 100644
> > --- a/arch/arm64/boot/dts/freescale/imx8mp-debix-som-a.dtsi
> > +++ b/arch/arm64/boot/dts/freescale/imx8mp-debix-som-a.dtsi
> > @@ -20,6 +20,19 @@ reg_usdhc2_vmmc: regulator-usdhc2 {
> >               gpio = <&gpio2 19 GPIO_ACTIVE_HIGH>;
> >               enable-active-high;
> >       };
> > +
> > +     gpio-leds {
> > +             compatible = "gpio-leds";
> > +             pinctrl-names = "default";
> > +             pinctrl-0 = <&pinctrl_gpio_led>;
> > +
> > +             status {
> 
> according the bindings-doc, this should be:
> 
>                 'led-status' or 'led-0'

Interesting - I can see 'led-0' is supported, but I can't see if
led-status is supported.

Documentation/devicetree/bindings/leds/leds-gpio.yaml:

patternProperties:
  # The first form is preferred, but fall back to just 'led' anywhere in the
  # node name to at least catch some child nodes.
  "(^led-[0-9a-f]$|led)":
    type: object
    $ref: common.yaml#
    unevaluatedProperties: false

That regex looks like it wouldn't support 'led-status'. Otherwise I'd
probably label it as 'led-run' to match how the LED is physically
labelled.

I've set led-0 locally for now.

> 
> > +                     label = "yellow:status";
> 
> label is deprecated, instead function and color should be used.

Ohh - I knew that, and I should have remembered this from the last time
I did an LED.  That was too long ago and too small a task I guess.

Looking more closely, the LED is green - not yellow too! so I've udpated
this with:

	led-0 {
		gpios = <&gpio3 16 GPIO_ACTIVE_HIGH>;
		default-state = "on";
		linux,default-trigger = "heartbeat";
		function = LED_FUNCTION_STATUS;
		color = <LED_COLOR_ID_GREEN>;
	};


Updating, for a v2.

> With that fixed feel to add my:
> 
> Reviewed-by: Marco Felsch <m.felsch@pengutronix.de>

Thanks.

--
Kieran


> 
> > +                     gpios = <&gpio3 16 GPIO_ACTIVE_HIGH>;
> > +                     default-state = "on";
> > +                     linux,default-trigger = "heartbeat";
> > +             };
> > +     };
> >  };
> >  
> >  &A53_0 {
> > @@ -203,6 +216,12 @@ &wdog1 {
> >  };
> >  
> >  &iomuxc {
> > +     pinctrl_gpio_led: gpioledgrp {
> > +             fsl,pins = <
> > +                     MX8MP_IOMUXC_NAND_READY_B__GPIO3_IO16           0x19
> > +             >;
> > +     };
> > +
> >       pinctrl_i2c1: i2c1grp {
> >               fsl,pins = <
> >                       MX8MP_IOMUXC_I2C1_SCL__I2C1_SCL                 0x400001c2
> > -- 
> > 2.34.1
> > 
> >
  
Krzysztof Kozlowski Oct. 23, 2023, 1:20 p.m. UTC | #3
On 21/10/2023 02:50, Kieran Bingham wrote:
> Map the 'RUN' LED present on the Debix-SOM as a heartbeat.
> 
> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> ---
>  .../dts/freescale/imx8mp-debix-som-a.dtsi     | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/freescale/imx8mp-debix-som-a.dtsi b/arch/arm64/boot/dts/freescale/imx8mp-debix-som-a.dtsi
> index bc312aa1bfc8..c9a81486da48 100644
> --- a/arch/arm64/boot/dts/freescale/imx8mp-debix-som-a.dtsi
> +++ b/arch/arm64/boot/dts/freescale/imx8mp-debix-som-a.dtsi
> @@ -20,6 +20,19 @@ reg_usdhc2_vmmc: regulator-usdhc2 {
>  		gpio = <&gpio2 19 GPIO_ACTIVE_HIGH>;
>  		enable-active-high;
>  	};
> +
> +	gpio-leds {
> +		compatible = "gpio-leds";
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&pinctrl_gpio_led>;
> +
> +		status {

Missing led prefix. I think I fixed it everywhere some time ago, so I
wonder from where did you copy it. :/

It does not look like you tested the DTS against bindings. Please run
`make dtbs_check W=1` (see
Documentation/devicetree/bindings/writing-schema.rst or
https://www.linaro.org/blog/tips-and-tricks-for-validating-devicetree-sources-with-the-devicetree-schema/
for instructions).

> +			label = "yellow:status";

Drop label. Use color and function.


Best regards,
Krzysztof
  

Patch

diff --git a/arch/arm64/boot/dts/freescale/imx8mp-debix-som-a.dtsi b/arch/arm64/boot/dts/freescale/imx8mp-debix-som-a.dtsi
index bc312aa1bfc8..c9a81486da48 100644
--- a/arch/arm64/boot/dts/freescale/imx8mp-debix-som-a.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mp-debix-som-a.dtsi
@@ -20,6 +20,19 @@  reg_usdhc2_vmmc: regulator-usdhc2 {
 		gpio = <&gpio2 19 GPIO_ACTIVE_HIGH>;
 		enable-active-high;
 	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_gpio_led>;
+
+		status {
+			label = "yellow:status";
+			gpios = <&gpio3 16 GPIO_ACTIVE_HIGH>;
+			default-state = "on";
+			linux,default-trigger = "heartbeat";
+		};
+	};
 };
 
 &A53_0 {
@@ -203,6 +216,12 @@  &wdog1 {
 };
 
 &iomuxc {
+	pinctrl_gpio_led: gpioledgrp {
+		fsl,pins = <
+			MX8MP_IOMUXC_NAND_READY_B__GPIO3_IO16		0x19
+		>;
+	};
+
 	pinctrl_i2c1: i2c1grp {
 		fsl,pins = <
 			MX8MP_IOMUXC_I2C1_SCL__I2C1_SCL			0x400001c2