Commit e916d85b authored by Johan Jonker's avatar Johan Jonker Committed by Heiko Stuebner
Browse files

arm64: 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/arm64/boot/dts/rockchip/rk3368-r88.dt.yaml: gpio-leds:
'work' does 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=arm64 dtbs_check
DT_SCHEMA_FILES=Documentation/devicetree/bindings/leds/
leds-gpio.yaml

Signed-off-by: default avatarJohan Jonker <jbx6244@gmail.com>
Link: https://lore.kernel.org/r/20200428144933.10953-2-jbx6244@gmail.com


Signed-off-by: default avatarHeiko Stuebner <heiko@sntech.de>
parent 84836ded
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -28,14 +28,14 @@
	leds {
		compatible = "gpio-leds";

		power {
		power_led: led-0 {
			label = "firefly:red:power";
			linux,default-trigger = "ir-power-click";
			default-state = "on";
			gpios = <&gpio0 RK_PA6 GPIO_ACTIVE_HIGH>;
		};

		user {
		user_led: led-1 {
			label = "firefly:blue:user";
			linux,default-trigger = "ir-user-click";
			default-state = "off";
+3 −3
Original line number Diff line number Diff line
@@ -128,9 +128,9 @@
	leds: gpio-leds {
		compatible = "gpio-leds";
		pinctrl-names = "led_pins";
		pinctrl-0 = <&led_pins>;
		pinctrl-0 = <&blue_led_pin>;

		led-0 {
		blue_led: led-0 {
			label = "blue:heartbeat";
			gpios = <&gpio0 RK_PC1 GPIO_ACTIVE_HIGH>;
			linux,default-trigger = "heartbeat";
@@ -528,7 +528,7 @@
	};

	leds {
		led_pins: led-pins {
		blue_led_pin: blue-led-pin {
			rockchip,pins = <0 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};
+2 −2
Original line number Diff line number Diff line
@@ -86,7 +86,7 @@
	leds {
		compatible = "gpio-leds";

		power {
		power_led: led-0 {
			label = "firefly:blue:power";
			linux,default-trigger = "heartbeat";
			gpios = <&rk805 1 GPIO_ACTIVE_LOW>;
@@ -94,7 +94,7 @@
			mode = <0x23>;
		};

		user {
		user_led: led-1 {
			label = "firefly:yellow:user";
			linux,default-trigger = "mmc1";
			gpios = <&rk805 0 GPIO_ACTIVE_LOW>;
+2 −2
Original line number Diff line number Diff line
@@ -73,12 +73,12 @@
	leds {
		compatible = "gpio-leds";

		power {
		power_led: led-0 {
			gpios = <&rk805 1 GPIO_ACTIVE_LOW>;
			linux,default-trigger = "mmc0";
		};

		standby {
		standby_led: led-1 {
			gpios = <&rk805 0 GPIO_ACTIVE_LOW>;
			linux,default-trigger = "heartbeat";
		};
+2 −2
Original line number Diff line number Diff line
@@ -50,13 +50,13 @@
	leds: gpio-leds {
		compatible = "gpio-leds";

		blue {
		blue_led: led-0 {
			gpios = <&gpio2 RK_PA2 GPIO_ACTIVE_HIGH>;
			label = "geekbox:blue:led";
			default-state = "on";
		};

		red {
		red_led: led-1 {
			gpios = <&gpio2 RK_PA3 GPIO_ACTIVE_HIGH>;
			label = "geekbox:red:led";
			default-state = "off";
Loading