Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: dts: rockchip: rename and label gpio-led subnodes

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. A test with the command
below gives a screen full of warnings like:

arch/arm/boot/dts/rk3188-radxarock.dt.yaml: gpio-leds:
'blue', 'green', 'sleep'
do not match any of the regexes:
'(^led-[0-9a-f]$|led)', 'pinctrl-[0-9]+'

Fix these errors 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.

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>
Link: https://lore.kernel.org/r/20200428144933.10953-1-jbx6244@gmail.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>

authored by

Johan Jonker and committed by
Heiko Stuebner
f0344b33 8f3d9f35

+27 -27
+1 -1
arch/arm/boot/dts/rk3036-kylin.dts
··· 16 16 leds: gpio-leds { 17 17 compatible = "gpio-leds"; 18 18 19 - work { 19 + work_led: led-0 { 20 20 gpios = <&gpio2 RK_PD6 GPIO_ACTIVE_HIGH>; 21 21 label = "kylin:red:led"; 22 22 pinctrl-names = "default";
+1 -1
arch/arm/boot/dts/rk3066a-mk808.dts
··· 22 22 gpio-leds { 23 23 compatible = "gpio-leds"; 24 24 25 - blue { 25 + blue_led: led-0 { 26 26 label = "mk808:blue:power"; 27 27 gpios = <&gpio0 RK_PA3 GPIO_ACTIVE_HIGH>; 28 28 default-state = "off";
+3 -3
arch/arm/boot/dts/rk3188-radxarock.dts
··· 33 33 gpio-leds { 34 34 compatible = "gpio-leds"; 35 35 36 - green { 36 + green_led: led-0 { 37 37 label = "rock:green:user1"; 38 38 gpios = <&gpio0 RK_PB4 GPIO_ACTIVE_LOW>; 39 39 default-state = "off"; 40 40 }; 41 41 42 - blue { 42 + blue_led: led-1 { 43 43 label = "rock:blue:user2"; 44 44 gpios = <&gpio0 RK_PB6 GPIO_ACTIVE_LOW>; 45 45 default-state = "off"; 46 46 }; 47 47 48 - sleep { 48 + sleep_led: led-2 { 49 49 label = "rock:red:power"; 50 50 gpios = <&gpio0 RK_PB7 GPIO_ACTIVE_HIGH>; 51 51 default-state = "off";
+1 -1
arch/arm/boot/dts/rk3229-xms6.dts
··· 33 33 power-led { 34 34 compatible = "gpio-leds"; 35 35 36 - blue { 36 + blue_led: led-0 { 37 37 gpios = <&gpio3 21 GPIO_ACTIVE_HIGH>; 38 38 default-state = "on"; 39 39 };
+6 -6
arch/arm/boot/dts/rk3288-firefly-reload.dts
··· 45 45 leds { 46 46 compatible = "gpio-leds"; 47 47 48 - power { 48 + power_led: led-0 { 49 49 gpios = <&gpio8 RK_PA2 GPIO_ACTIVE_LOW>; 50 50 label = "firefly:blue:power"; 51 51 pinctrl-names = "default"; 52 - pinctrl-0 = <&power_led>; 52 + pinctrl-0 = <&power_led_pin>; 53 53 panic-indicator; 54 54 }; 55 55 56 - work { 56 + work_led: led-1 { 57 57 gpios = <&gpio8 RK_PA1 GPIO_ACTIVE_LOW>; 58 58 label = "firefly:blue:user"; 59 59 linux,default-trigger = "rc-feedback"; 60 60 pinctrl-names = "default"; 61 - pinctrl-0 = <&work_led>; 61 + pinctrl-0 = <&work_led_pin>; 62 62 }; 63 63 }; 64 64 ··· 334 334 }; 335 335 336 336 leds { 337 - power_led: power-led { 337 + power_led_pin: power-led-pin { 338 338 rockchip,pins = <8 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>; 339 339 }; 340 340 341 - work_led: work-led { 341 + work_led_pin: work-led-pin { 342 342 rockchip,pins = <8 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>; 343 343 }; 344 344 };
+6 -6
arch/arm/boot/dts/rk3288-firefly.dtsi
··· 62 62 leds { 63 63 compatible = "gpio-leds"; 64 64 65 - work { 65 + work_led: led-0 { 66 66 gpios = <&gpio8 RK_PA1 GPIO_ACTIVE_LOW>; 67 67 label = "firefly:blue:user"; 68 68 linux,default-trigger = "rc-feedback"; 69 69 pinctrl-names = "default"; 70 - pinctrl-0 = <&work_led>; 70 + pinctrl-0 = <&work_led_pin>; 71 71 }; 72 72 73 - power { 73 + power_led: led-1 { 74 74 gpios = <&gpio8 RK_PA2 GPIO_ACTIVE_LOW>; 75 75 label = "firefly:green:power"; 76 76 linux,default-trigger = "default-on"; 77 77 pinctrl-names = "default"; 78 - pinctrl-0 = <&power_led>; 78 + pinctrl-0 = <&power_led_pin>; 79 79 }; 80 80 }; 81 81 ··· 429 429 }; 430 430 431 431 leds { 432 - power_led: power-led { 432 + power_led_pin: power-led-pin { 433 433 rockchip,pins = <8 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>; 434 434 }; 435 435 436 - work_led: work-led { 436 + work_led_pin: work-led-pin { 437 437 rockchip,pins = <8 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>; 438 438 }; 439 439 };
+1 -1
arch/arm/boot/dts/rk3288-miqi.dts
··· 30 30 leds { 31 31 compatible = "gpio-leds"; 32 32 33 - work { 33 + work_led: led-0 { 34 34 gpios = <&gpio7 RK_PA2 GPIO_ACTIVE_HIGH>; 35 35 label = "miqi:green:user"; 36 36 linux,default-trigger = "timer";
+3 -3
arch/arm/boot/dts/rk3288-phycore-som.dtsi
··· 36 36 leds: user-leds { 37 37 compatible = "gpio-leds"; 38 38 pinctrl-names = "default"; 39 - pinctrl-0 = <&user_led>; 39 + pinctrl-0 = <&user_led_pin>; 40 40 41 - user { 41 + user_led: led-0 { 42 42 label = "green_led"; 43 43 gpios = <&gpio7 2 GPIO_ACTIVE_HIGH>; 44 44 linux,default-trigger = "heartbeat"; ··· 372 372 }; 373 373 374 374 leds { 375 - user_led: user-led { 375 + user_led_pin: user-led-pin { 376 376 rockchip,pins = <7 RK_PA2 RK_FUNC_GPIO &pcfg_output_high>; 377 377 }; 378 378 };
+2 -2
arch/arm/boot/dts/rk3288-rock2-square.dts
··· 41 41 gpio-leds { 42 42 compatible = "gpio-leds"; 43 43 44 - heartbeat { 44 + heartbeat_led: led-0 { 45 45 gpios = <&gpio7 RK_PB7 GPIO_ACTIVE_LOW>; 46 46 label = "rock2:green:state1"; 47 47 linux,default-trigger = "heartbeat"; 48 48 }; 49 49 50 - mmc { 50 + mmc_led: led-1 { 51 51 gpios = <&gpio0 RK_PB3 GPIO_ACTIVE_LOW>; 52 52 label = "rock2:blue:state2"; 53 53 linux,default-trigger = "mmc0";
+3 -3
arch/arm/boot/dts/rk3288-tinker.dtsi
··· 46 46 gpio-leds { 47 47 compatible = "gpio-leds"; 48 48 49 - act-led { 49 + act_led: led-0 { 50 50 gpios = <&gpio1 RK_PD0 GPIO_ACTIVE_HIGH>; 51 51 linux,default-trigger = "mmc0"; 52 52 }; 53 53 54 - heartbeat-led { 54 + heartbeat_led: led-1 { 55 55 gpios = <&gpio1 RK_PD1 GPIO_ACTIVE_HIGH>; 56 56 linux,default-trigger = "heartbeat"; 57 57 }; 58 58 59 - pwr-led { 59 + pwr_led: led-2 { 60 60 gpios = <&gpio0 RK_PA3 GPIO_ACTIVE_HIGH>; 61 61 linux,default-trigger = "default-on"; 62 62 };