Skip to content

Commit 6dd5e12

Browse files
Johan Jonkermmind
authored andcommitted
arm64: dts: rockchip: rename and label gpio-led subnodes part 2
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 2 rename and label gpio-led subnodes that passed the regex, but still don't have the preferred form. Any pin subnode that ends with '-gpio' in the pinctrl node generates a warning. 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. 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=arm64 dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/leds/ leds-gpio.yaml make ARCH=arm64 dtbs_check DT_SCHEMA_FILES=~/.local/lib/python3.5/site-packages/dtschema/ schemas/gpio/gpio.yaml Signed-off-by: Johan Jonker <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Heiko Stuebner <[email protected]>
1 parent 2bc65fe commit 6dd5e12

File tree

8 files changed

+33
-33
lines changed

8 files changed

+33
-33
lines changed

arch/arm64/boot/dts/rockchip/rk3368-lion-haikou.dts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
};
2626

2727
leds {
28-
pinctrl-0 = <&led_pins_module>, <&led_sd_haikou>;
28+
pinctrl-0 = <&module_led_pins>, <&sd_card_led_pin>;
2929

30-
sd-card-led {
30+
sd_card_led: led-3 {
3131
label = "sd_card_led";
3232
gpios = <&gpio0 RK_PD2 GPIO_ACTIVE_HIGH>;
3333
linux,default-trigger = "mmc0";
@@ -118,7 +118,7 @@
118118
};
119119

120120
leds {
121-
led_sd_haikou: led-sd-gpio {
121+
sd_card_led_pin: sd-card-led-pin {
122122
rockchip,pins =
123123
<0 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>;
124124
};

arch/arm64/boot/dts/rockchip/rk3368-lion.dtsi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,16 @@
7676
leds {
7777
compatible = "gpio-leds";
7878
pinctrl-names = "default";
79-
pinctrl-0 = <&led_pins_module>;
79+
pinctrl-0 = <&module_led_pins>;
8080

81-
module_led1 {
81+
module_led1: led-1 {
8282
label = "module_led1";
8383
gpios = <&gpio2 RK_PB5 GPIO_ACTIVE_HIGH>;
8484
linux,default-trigger = "heartbeat";
8585
panic-indicator;
8686
};
8787

88-
module_led2 {
88+
module_led2: led-2 {
8989
label = "module_led2";
9090
gpios = <&gpio3 RK_PA3 GPIO_ACTIVE_HIGH>;
9191
default-state = "off";
@@ -270,7 +270,7 @@
270270

271271
&pinctrl {
272272
leds {
273-
led_pins_module: led-module-gpio {
273+
module_led_pins: module-led-pins {
274274
rockchip,pins =
275275
<2 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>,
276276
<3 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>;

arch/arm64/boot/dts/rockchip/rk3399-khadas-edge.dtsi

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,15 +141,15 @@
141141
leds {
142142
compatible = "gpio-leds";
143143
pinctrl-names = "default";
144-
pinctrl-0 = <&sys_led_gpio>, <&user_led_gpio>;
144+
pinctrl-0 = <&sys_led_pin>, <&user_led_pin>;
145145

146-
sys-led {
146+
sys_led: led-0 {
147147
label = "sys_led";
148148
linux,default-trigger = "heartbeat";
149149
gpios = <&gpio0 RK_PA6 GPIO_ACTIVE_HIGH>;
150150
};
151151

152-
user-led {
152+
user_led: led-1 {
153153
label = "user_led";
154154
default-state = "off";
155155
gpios = <&gpio4 RK_PD0 GPIO_ACTIVE_HIGH>;
@@ -586,11 +586,11 @@
586586
};
587587

588588
leds {
589-
sys_led_gpio: sys_led-gpio {
589+
sys_led_pin: sys-led-pin {
590590
rockchip,pins = <0 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>;
591591
};
592592

593-
user_led_gpio: user_led-gpio {
593+
user_led_pin: user-led-pin {
594594
rockchip,pins = <4 RK_PD0 RK_FUNC_GPIO &pcfg_pull_none>;
595595
};
596596
};

arch/arm64/boot/dts/rockchip/rk3399-nanopi4.dtsi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,9 @@
117117
leds: gpio-leds {
118118
compatible = "gpio-leds";
119119
pinctrl-names = "default";
120-
pinctrl-0 = <&leds_gpio>;
120+
pinctrl-0 = <&status_led_pin>;
121121

122-
status {
122+
status_led: led-0 {
123123
gpios = <&gpio0 RK_PB5 GPIO_ACTIVE_HIGH>;
124124
label = "status_led";
125125
linux,default-trigger = "heartbeat";
@@ -520,7 +520,7 @@
520520
};
521521

522522
gpio-leds {
523-
leds_gpio: leds-gpio {
523+
status_led_pin: status-led-pin {
524524
rockchip,pins = <0 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>;
525525
};
526526
};

arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
};
1616

1717
leds {
18-
pinctrl-0 = <&led_pin_module>, <&led_sd_haikou>;
18+
pinctrl-0 = <&module_led_pin>, <&sd_card_led_pin>;
1919

20-
sd-card-led {
20+
sd_card_led: led-1 {
2121
label = "sd_card_led";
2222
gpios = <&gpio1 RK_PA2 GPIO_ACTIVE_HIGH>;
2323
linux,default-trigger = "mmc0";
@@ -179,7 +179,7 @@
179179
};
180180

181181
leds {
182-
led_sd_haikou: led-sd-gpio {
182+
sd_card_led_pin: sd-card-led-pin {
183183
rockchip,pins =
184184
<1 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
185185
};

arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
leds {
1212
compatible = "gpio-leds";
1313
pinctrl-names = "default";
14-
pinctrl-0 = <&led_pin_module>;
14+
pinctrl-0 = <&module_led_pin>;
1515

16-
module-led {
16+
module_led: led-0 {
1717
label = "module_led";
1818
gpios = <&gpio2 RK_PD1 GPIO_ACTIVE_HIGH>;
1919
linux,default-trigger = "heartbeat";
@@ -450,7 +450,7 @@
450450
};
451451

452452
leds {
453-
led_pin_module: led-module-gpio {
453+
module_led_pin: module-led-pin {
454454
rockchip,pins =
455455
<2 RK_PD1 RK_FUNC_GPIO &pcfg_pull_none>;
456456
};

arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,23 +61,23 @@
6161
leds {
6262
compatible = "gpio-leds";
6363
pinctrl-names = "default";
64-
pinctrl-0 = <&work_led_gpio>, <&diy_led_gpio>, <&yellow_led_gpio>;
64+
pinctrl-0 = <&work_led_pin>, <&diy_led_pin>, <&yellow_led_pin>;
6565

66-
work-led {
66+
work_led: led-0 {
6767
label = "green:work";
6868
gpios = <&gpio2 RK_PD3 GPIO_ACTIVE_HIGH>;
6969
default-state = "on";
7070
linux,default-trigger = "heartbeat";
7171
};
7272

73-
diy-led {
73+
diy_led: led-1 {
7474
label = "red:diy";
7575
gpios = <&gpio0 RK_PB5 GPIO_ACTIVE_HIGH>;
7676
default-state = "off";
7777
linux,default-trigger = "mmc1";
7878
};
7979

80-
yellow-led {
80+
yellow_led: led-2 {
8181
label = "yellow:yellow-led";
8282
gpios = <&gpio0 RK_PA2 GPIO_ACTIVE_HIGH>;
8383
default-state = "off";
@@ -595,15 +595,15 @@
595595
};
596596

597597
leds {
598-
diy_led_gpio: diy_led-gpio {
598+
diy_led_pin: diy-led-pin {
599599
rockchip,pins = <0 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>;
600600
};
601601

602-
work_led_gpio: work_led-gpio {
602+
work_led_pin: work-led-pin {
603603
rockchip,pins = <2 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>;
604604
};
605605

606-
yellow_led_gpio: yellow_led-gpio {
606+
yellow_led_pin: yellow-led-pin {
607607
rockchip,pins = <0 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
608608
};
609609
};

arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dtsi

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@
3939
leds {
4040
compatible = "gpio-leds";
4141
pinctrl-names = "default";
42-
pinctrl-0 = <&work_led_gpio>, <&diy_led_gpio>;
42+
pinctrl-0 = <&work_led_pin>, <&diy_led_pin>;
4343

44-
work-led {
44+
work_led: led-0 {
4545
label = "work";
4646
default-state = "on";
4747
gpios = <&gpio0 RK_PB3 GPIO_ACTIVE_HIGH>;
4848
};
4949

50-
diy-led {
50+
diy_led: led-1 {
5151
label = "diy";
5252
default-state = "off";
5353
gpios = <&gpio0 RK_PA2 GPIO_ACTIVE_HIGH>;
@@ -588,11 +588,11 @@
588588
};
589589

590590
leds {
591-
work_led_gpio: work_led-gpio {
591+
work_led_pin: work-led-pin {
592592
rockchip,pins = <0 RK_PB3 RK_FUNC_GPIO &pcfg_pull_none>;
593593
};
594594

595-
diy_led_gpio: diy_led-gpio {
595+
diy_led_pin: diy-led-pin {
596596
rockchip,pins = <0 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
597597
};
598598
};

0 commit comments

Comments
 (0)