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

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: default avatarJohan Jonker <jbx6244@gmail.com>
Link: https://lore.kernel.org/r/20200522154657.9472-1-jbx6244@gmail.com


Signed-off-by: default avatarHeiko Stuebner <heiko@sntech.de>
parent 2bc65fef
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -25,9 +25,9 @@
	};

	leds {
		pinctrl-0 = <&led_pins_module>, <&led_sd_haikou>;
		pinctrl-0 = <&module_led_pins>, <&sd_card_led_pin>;

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

	leds {
		led_sd_haikou: led-sd-gpio {
		sd_card_led_pin: sd-card-led-pin {
			rockchip,pins =
				<0 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>;
		};
+4 −4
Original line number Diff line number Diff line
@@ -76,16 +76,16 @@
	leds {
		compatible = "gpio-leds";
		pinctrl-names = "default";
		pinctrl-0 = <&led_pins_module>;
		pinctrl-0 = <&module_led_pins>;

		module_led1 {
		module_led1: led-1 {
			label = "module_led1";
			gpios = <&gpio2 RK_PB5 GPIO_ACTIVE_HIGH>;
			linux,default-trigger = "heartbeat";
			panic-indicator;
		};

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

&pinctrl {
	leds {
		led_pins_module: led-module-gpio {
		module_led_pins: module-led-pins {
			rockchip,pins =
				<2 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>,
				<3 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>;
+5 −5
Original line number Diff line number Diff line
@@ -141,15 +141,15 @@
	leds {
		compatible = "gpio-leds";
		pinctrl-names = "default";
		pinctrl-0 = <&sys_led_gpio>, <&user_led_gpio>;
		pinctrl-0 = <&sys_led_pin>, <&user_led_pin>;

		sys-led {
		sys_led: led-0 {
			label = "sys_led";
			linux,default-trigger = "heartbeat";
			gpios = <&gpio0 RK_PA6 GPIO_ACTIVE_HIGH>;
		};

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

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

		user_led_gpio: user_led-gpio {
		user_led_pin: user-led-pin {
			rockchip,pins = <4 RK_PD0 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};
+3 −3
Original line number Diff line number Diff line
@@ -117,9 +117,9 @@
	leds: gpio-leds {
		compatible = "gpio-leds";
		pinctrl-names = "default";
		pinctrl-0 = <&leds_gpio>;
		pinctrl-0 = <&status_led_pin>;

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

	gpio-leds {
		leds_gpio: leds-gpio {
		status_led_pin: status-led-pin {
			rockchip,pins = <0 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};
+3 −3
Original line number Diff line number Diff line
@@ -15,9 +15,9 @@
	};

	leds {
		pinctrl-0 = <&led_pin_module>, <&led_sd_haikou>;
		pinctrl-0 = <&module_led_pin>, <&sd_card_led_pin>;

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

	leds {
		led_sd_haikou: led-sd-gpio {
		sd_card_led_pin: sd-card-led-pin {
			rockchip,pins =
			  <1 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
		};
Loading