Skip to content

Commit f0344b3

Browse files
Johan Jonkermmind
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Heiko Stuebner <[email protected]>
1 parent 8f3d9f3 commit f0344b3

10 files changed

+27
-27
lines changed

arch/arm/boot/dts/rk3036-kylin.dts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
leds: gpio-leds {
1717
compatible = "gpio-leds";
1818

19-
work {
19+
work_led: led-0 {
2020
gpios = <&gpio2 RK_PD6 GPIO_ACTIVE_HIGH>;
2121
label = "kylin:red:led";
2222
pinctrl-names = "default";

arch/arm/boot/dts/rk3066a-mk808.dts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
gpio-leds {
2323
compatible = "gpio-leds";
2424

25-
blue {
25+
blue_led: led-0 {
2626
label = "mk808:blue:power";
2727
gpios = <&gpio0 RK_PA3 GPIO_ACTIVE_HIGH>;
2828
default-state = "off";

arch/arm/boot/dts/rk3188-radxarock.dts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,19 @@
3333
gpio-leds {
3434
compatible = "gpio-leds";
3535

36-
green {
36+
green_led: led-0 {
3737
label = "rock:green:user1";
3838
gpios = <&gpio0 RK_PB4 GPIO_ACTIVE_LOW>;
3939
default-state = "off";
4040
};
4141

42-
blue {
42+
blue_led: led-1 {
4343
label = "rock:blue:user2";
4444
gpios = <&gpio0 RK_PB6 GPIO_ACTIVE_LOW>;
4545
default-state = "off";
4646
};
4747

48-
sleep {
48+
sleep_led: led-2 {
4949
label = "rock:red:power";
5050
gpios = <&gpio0 RK_PB7 GPIO_ACTIVE_HIGH>;
5151
default-state = "off";

arch/arm/boot/dts/rk3229-xms6.dts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
power-led {
3434
compatible = "gpio-leds";
3535

36-
blue {
36+
blue_led: led-0 {
3737
gpios = <&gpio3 21 GPIO_ACTIVE_HIGH>;
3838
default-state = "on";
3939
};

arch/arm/boot/dts/rk3288-firefly-reload.dts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,20 +45,20 @@
4545
leds {
4646
compatible = "gpio-leds";
4747

48-
power {
48+
power_led: led-0 {
4949
gpios = <&gpio8 RK_PA2 GPIO_ACTIVE_LOW>;
5050
label = "firefly:blue:power";
5151
pinctrl-names = "default";
52-
pinctrl-0 = <&power_led>;
52+
pinctrl-0 = <&power_led_pin>;
5353
panic-indicator;
5454
};
5555

56-
work {
56+
work_led: led-1 {
5757
gpios = <&gpio8 RK_PA1 GPIO_ACTIVE_LOW>;
5858
label = "firefly:blue:user";
5959
linux,default-trigger = "rc-feedback";
6060
pinctrl-names = "default";
61-
pinctrl-0 = <&work_led>;
61+
pinctrl-0 = <&work_led_pin>;
6262
};
6363
};
6464

@@ -334,11 +334,11 @@
334334
};
335335

336336
leds {
337-
power_led: power-led {
337+
power_led_pin: power-led-pin {
338338
rockchip,pins = <8 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
339339
};
340340

341-
work_led: work-led {
341+
work_led_pin: work-led-pin {
342342
rockchip,pins = <8 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>;
343343
};
344344
};

arch/arm/boot/dts/rk3288-firefly.dtsi

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,20 +62,20 @@
6262
leds {
6363
compatible = "gpio-leds";
6464

65-
work {
65+
work_led: led-0 {
6666
gpios = <&gpio8 RK_PA1 GPIO_ACTIVE_LOW>;
6767
label = "firefly:blue:user";
6868
linux,default-trigger = "rc-feedback";
6969
pinctrl-names = "default";
70-
pinctrl-0 = <&work_led>;
70+
pinctrl-0 = <&work_led_pin>;
7171
};
7272

73-
power {
73+
power_led: led-1 {
7474
gpios = <&gpio8 RK_PA2 GPIO_ACTIVE_LOW>;
7575
label = "firefly:green:power";
7676
linux,default-trigger = "default-on";
7777
pinctrl-names = "default";
78-
pinctrl-0 = <&power_led>;
78+
pinctrl-0 = <&power_led_pin>;
7979
};
8080
};
8181

@@ -429,11 +429,11 @@
429429
};
430430

431431
leds {
432-
power_led: power-led {
432+
power_led_pin: power-led-pin {
433433
rockchip,pins = <8 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
434434
};
435435

436-
work_led: work-led {
436+
work_led_pin: work-led-pin {
437437
rockchip,pins = <8 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>;
438438
};
439439
};

arch/arm/boot/dts/rk3288-miqi.dts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
leds {
3131
compatible = "gpio-leds";
3232

33-
work {
33+
work_led: led-0 {
3434
gpios = <&gpio7 RK_PA2 GPIO_ACTIVE_HIGH>;
3535
label = "miqi:green:user";
3636
linux,default-trigger = "timer";

arch/arm/boot/dts/rk3288-phycore-som.dtsi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@
3636
leds: user-leds {
3737
compatible = "gpio-leds";
3838
pinctrl-names = "default";
39-
pinctrl-0 = <&user_led>;
39+
pinctrl-0 = <&user_led_pin>;
4040

41-
user {
41+
user_led: led-0 {
4242
label = "green_led";
4343
gpios = <&gpio7 2 GPIO_ACTIVE_HIGH>;
4444
linux,default-trigger = "heartbeat";
@@ -372,7 +372,7 @@
372372
};
373373

374374
leds {
375-
user_led: user-led {
375+
user_led_pin: user-led-pin {
376376
rockchip,pins = <7 RK_PA2 RK_FUNC_GPIO &pcfg_output_high>;
377377
};
378378
};

arch/arm/boot/dts/rk3288-rock2-square.dts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@
4141
gpio-leds {
4242
compatible = "gpio-leds";
4343

44-
heartbeat {
44+
heartbeat_led: led-0 {
4545
gpios = <&gpio7 RK_PB7 GPIO_ACTIVE_LOW>;
4646
label = "rock2:green:state1";
4747
linux,default-trigger = "heartbeat";
4848
};
4949

50-
mmc {
50+
mmc_led: led-1 {
5151
gpios = <&gpio0 RK_PB3 GPIO_ACTIVE_LOW>;
5252
label = "rock2:blue:state2";
5353
linux,default-trigger = "mmc0";

arch/arm/boot/dts/rk3288-tinker.dtsi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,17 @@
4646
gpio-leds {
4747
compatible = "gpio-leds";
4848

49-
act-led {
49+
act_led: led-0 {
5050
gpios = <&gpio1 RK_PD0 GPIO_ACTIVE_HIGH>;
5151
linux,default-trigger = "mmc0";
5252
};
5353

54-
heartbeat-led {
54+
heartbeat_led: led-1 {
5555
gpios = <&gpio1 RK_PD1 GPIO_ACTIVE_HIGH>;
5656
linux,default-trigger = "heartbeat";
5757
};
5858

59-
pwr-led {
59+
pwr_led: led-2 {
6060
gpios = <&gpio0 RK_PA3 GPIO_ACTIVE_HIGH>;
6161
linux,default-trigger = "default-on";
6262
};

0 commit comments

Comments
 (0)