All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heiko Stuebner <heiko@sntech.de>
To: Johan Jonker <jbx6244@gmail.com>
Cc: robh+dt@kernel.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1 1/2] ARM: dts: rockchip: rename and label gpio-led subnodes part 3
Date: Sun, 30 Aug 2020 22:43:50 +0200	[thread overview]
Message-ID: <3705366.uVpFMHbKpm@phil> (raw)
In-Reply-To: <20200813193455.19772-1-jbx6244@gmail.com>

Hi Johan,

Am Donnerstag, 13. August 2020, 21:34:54 CEST schrieb Johan Jonker:
> Current dts files with 'gpio-led' nodes were manually verified.
> In order to automate this process leds-gpio.txt
> has been converted to yaml. With this conversion a check
> for pattern properties was added. In part 3 rename and label
> gpio-led subnodes with pinctrl. To make things equal to other
> dts files move pinctrl below the compatible property.
> 
> Fix with help of the following rules:
> 
> 1: Add nodename in the preferred form.
> 
> 2: Always add a label that ends with '_led' to prevent conflicts
>    with other labels such as 'power' and 'mmc'
> 
> 3: If leds need pinctrl add a label that ends with '_led_pin'
>    also to prevent conflicts with other labels.

I'm undecided about this ... and while thinking about this,
realized that we already have some changes doing that in the tree.

To explain, in general the pinctrl names should come from the names used
in the actual device schematics, as this makes it easier to find and compare
them between devicetree and schematics files.

So creating an arbitrary foo_led_pin pinctrl instead breaks this searchability
which I'd really like to keep.


Heiko


> 
> 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)":
> 
> make ARCH=arm dtbs_check
> DT_SCHEMA_FILES=Documentation/devicetree/bindings/leds/
> leds-gpio.yaml
> 
> Signed-off-by: Johan Jonker <jbx6244@gmail.com>
> ---
>  arch/arm/boot/dts/rk3036-kylin.dts | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/rk3036-kylin.dts b/arch/arm/boot/dts/rk3036-kylin.dts
> index 7154b827e..bf808cda6 100644
> --- a/arch/arm/boot/dts/rk3036-kylin.dts
> +++ b/arch/arm/boot/dts/rk3036-kylin.dts
> @@ -15,12 +15,12 @@
>  
>  	leds: gpio-leds {
>  		compatible = "gpio-leds";
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&work_led_pin>;
>  
>  		work_led: led-0 {
>  			gpios = <&gpio2 RK_PD6 GPIO_ACTIVE_HIGH>;
>  			label = "kylin:red:led";
> -			pinctrl-names = "default";
> -			pinctrl-0 = <&led_ctl>;
>  		};
>  	};
>  
> @@ -367,7 +367,7 @@
>  
>  &pinctrl {
>  	leds {
> -		led_ctl: led-ctl {
> +		work_led_pin: work-led-pin {
>  			rockchip,pins = <2 RK_PD6 RK_FUNC_GPIO &pcfg_pull_none>;
>  		};
>  	};
> 





WARNING: multiple messages have this Message-ID (diff)
From: Heiko Stuebner <heiko@sntech.de>
To: Johan Jonker <jbx6244@gmail.com>
Cc: devicetree@vger.kernel.org, robh+dt@kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org
Subject: Re: [PATCH v1 1/2] ARM: dts: rockchip: rename and label gpio-led subnodes part 3
Date: Sun, 30 Aug 2020 22:43:50 +0200	[thread overview]
Message-ID: <3705366.uVpFMHbKpm@phil> (raw)
In-Reply-To: <20200813193455.19772-1-jbx6244@gmail.com>

Hi Johan,

Am Donnerstag, 13. August 2020, 21:34:54 CEST schrieb Johan Jonker:
> Current dts files with 'gpio-led' nodes were manually verified.
> In order to automate this process leds-gpio.txt
> has been converted to yaml. With this conversion a check
> for pattern properties was added. In part 3 rename and label
> gpio-led subnodes with pinctrl. To make things equal to other
> dts files move pinctrl below the compatible property.
> 
> Fix with help of the following rules:
> 
> 1: Add nodename in the preferred form.
> 
> 2: Always add a label that ends with '_led' to prevent conflicts
>    with other labels such as 'power' and 'mmc'
> 
> 3: If leds need pinctrl add a label that ends with '_led_pin'
>    also to prevent conflicts with other labels.

I'm undecided about this ... and while thinking about this,
realized that we already have some changes doing that in the tree.

To explain, in general the pinctrl names should come from the names used
in the actual device schematics, as this makes it easier to find and compare
them between devicetree and schematics files.

So creating an arbitrary foo_led_pin pinctrl instead breaks this searchability
which I'd really like to keep.


Heiko


> 
> 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)":
> 
> make ARCH=arm dtbs_check
> DT_SCHEMA_FILES=Documentation/devicetree/bindings/leds/
> leds-gpio.yaml
> 
> Signed-off-by: Johan Jonker <jbx6244@gmail.com>
> ---
>  arch/arm/boot/dts/rk3036-kylin.dts | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/rk3036-kylin.dts b/arch/arm/boot/dts/rk3036-kylin.dts
> index 7154b827e..bf808cda6 100644
> --- a/arch/arm/boot/dts/rk3036-kylin.dts
> +++ b/arch/arm/boot/dts/rk3036-kylin.dts
> @@ -15,12 +15,12 @@
>  
>  	leds: gpio-leds {
>  		compatible = "gpio-leds";
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&work_led_pin>;
>  
>  		work_led: led-0 {
>  			gpios = <&gpio2 RK_PD6 GPIO_ACTIVE_HIGH>;
>  			label = "kylin:red:led";
> -			pinctrl-names = "default";
> -			pinctrl-0 = <&led_ctl>;
>  		};
>  	};
>  
> @@ -367,7 +367,7 @@
>  
>  &pinctrl {
>  	leds {
> -		led_ctl: led-ctl {
> +		work_led_pin: work-led-pin {
>  			rockchip,pins = <2 RK_PD6 RK_FUNC_GPIO &pcfg_pull_none>;
>  		};
>  	};
> 





_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

WARNING: multiple messages have this Message-ID (diff)
From: Heiko Stuebner <heiko@sntech.de>
To: Johan Jonker <jbx6244@gmail.com>
Cc: devicetree@vger.kernel.org, robh+dt@kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org
Subject: Re: [PATCH v1 1/2] ARM: dts: rockchip: rename and label gpio-led subnodes part 3
Date: Sun, 30 Aug 2020 22:43:50 +0200	[thread overview]
Message-ID: <3705366.uVpFMHbKpm@phil> (raw)
In-Reply-To: <20200813193455.19772-1-jbx6244@gmail.com>

Hi Johan,

Am Donnerstag, 13. August 2020, 21:34:54 CEST schrieb Johan Jonker:
> Current dts files with 'gpio-led' nodes were manually verified.
> In order to automate this process leds-gpio.txt
> has been converted to yaml. With this conversion a check
> for pattern properties was added. In part 3 rename and label
> gpio-led subnodes with pinctrl. To make things equal to other
> dts files move pinctrl below the compatible property.
> 
> Fix with help of the following rules:
> 
> 1: Add nodename in the preferred form.
> 
> 2: Always add a label that ends with '_led' to prevent conflicts
>    with other labels such as 'power' and 'mmc'
> 
> 3: If leds need pinctrl add a label that ends with '_led_pin'
>    also to prevent conflicts with other labels.

I'm undecided about this ... and while thinking about this,
realized that we already have some changes doing that in the tree.

To explain, in general the pinctrl names should come from the names used
in the actual device schematics, as this makes it easier to find and compare
them between devicetree and schematics files.

So creating an arbitrary foo_led_pin pinctrl instead breaks this searchability
which I'd really like to keep.


Heiko


> 
> 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)":
> 
> make ARCH=arm dtbs_check
> DT_SCHEMA_FILES=Documentation/devicetree/bindings/leds/
> leds-gpio.yaml
> 
> Signed-off-by: Johan Jonker <jbx6244@gmail.com>
> ---
>  arch/arm/boot/dts/rk3036-kylin.dts | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/rk3036-kylin.dts b/arch/arm/boot/dts/rk3036-kylin.dts
> index 7154b827e..bf808cda6 100644
> --- a/arch/arm/boot/dts/rk3036-kylin.dts
> +++ b/arch/arm/boot/dts/rk3036-kylin.dts
> @@ -15,12 +15,12 @@
>  
>  	leds: gpio-leds {
>  		compatible = "gpio-leds";
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&work_led_pin>;
>  
>  		work_led: led-0 {
>  			gpios = <&gpio2 RK_PD6 GPIO_ACTIVE_HIGH>;
>  			label = "kylin:red:led";
> -			pinctrl-names = "default";
> -			pinctrl-0 = <&led_ctl>;
>  		};
>  	};
>  
> @@ -367,7 +367,7 @@
>  
>  &pinctrl {
>  	leds {
> -		led_ctl: led-ctl {
> +		work_led_pin: work-led-pin {
>  			rockchip,pins = <2 RK_PD6 RK_FUNC_GPIO &pcfg_pull_none>;
>  		};
>  	};
> 





_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2020-08-30 20:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-13 19:34 [PATCH v1 1/2] ARM: dts: rockchip: rename and label gpio-led subnodes part 3 Johan Jonker
2020-08-13 19:34 ` Johan Jonker
2020-08-13 19:34 ` Johan Jonker
2020-08-13 19:34 ` [PATCH v1 2/2] arm64: " Johan Jonker
2020-08-13 19:34   ` Johan Jonker
2020-08-13 19:34   ` Johan Jonker
2020-08-30 20:43 ` Heiko Stuebner [this message]
2020-08-30 20:43   ` [PATCH v1 1/2] ARM: " Heiko Stuebner
2020-08-30 20:43   ` Heiko Stuebner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3705366.uVpFMHbKpm@phil \
    --to=heiko@sntech.de \
    --cc=devicetree@vger.kernel.org \
    --cc=jbx6244@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.