ARM: dts: bcm283x: Move ACT LED into separate dtsi
authorStefan Wahren <stefan.wahren@i2se.com>
Thu, 10 Nov 2022 17:31:05 +0000 (18:31 +0100)
committerFlorian Fainelli <f.fainelli@gmail.com>
Thu, 10 Nov 2022 19:41:58 +0000 (11:41 -0800)
The usage of the label property for gpio-leds has been deprecated
a long time ago. In bcm2835-rpi.dtsi the ACT LED uses such a label
and derive it to almost every Raspberry Pi board. Since we cannot break
userspace interface this property must be kept. But we can move the
ACT LED into a separate dtsi and include them from the board files.

This change have two benefits:
- with both new refs it's now clear the LED part is included from a dtsi
- new boards do not include the deprecated stuff automatically

Reported-by: Alexander Dahl <ada@thorsis.com>
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/20221110173105.6633-3-stefan.wahren@i2se.com
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
19 files changed:
arch/arm/boot/dts/bcm2711-rpi-4-b.dts
arch/arm/boot/dts/bcm2711-rpi-400.dts
arch/arm/boot/dts/bcm2711-rpi-cm4-io.dts
arch/arm/boot/dts/bcm2835-rpi-a-plus.dts
arch/arm/boot/dts/bcm2835-rpi-a.dts
arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts
arch/arm/boot/dts/bcm2835-rpi-b.dts
arch/arm/boot/dts/bcm2835-rpi-cm1.dtsi
arch/arm/boot/dts/bcm2835-rpi-zero-w.dts
arch/arm/boot/dts/bcm2835-rpi-zero.dts
arch/arm/boot/dts/bcm2835-rpi.dtsi
arch/arm/boot/dts/bcm2836-rpi-2-b.dts
arch/arm/boot/dts/bcm2837-rpi-3-a-plus.dts
arch/arm/boot/dts/bcm2837-rpi-3-b-plus.dts
arch/arm/boot/dts/bcm2837-rpi-3-b.dts
arch/arm/boot/dts/bcm2837-rpi-cm3.dtsi
arch/arm/boot/dts/bcm2837-rpi-zero-2-w.dts
arch/arm/boot/dts/bcm283x-rpi-led-deprecated.dtsi [new file with mode: 0644]

index aaad9b7ec6309b66973b822fc27c8c61c798d569..d5f8823230db9dd1332c8ffbb5cb76e7fe71b506 100644 (file)
@@ -2,6 +2,7 @@
 /dts-v1/;
 #include "bcm2711.dtsi"
 #include "bcm2711-rpi.dtsi"
+#include "bcm283x-rpi-led-deprecated.dtsi"
 #include "bcm283x-rpi-usb-peripheral.dtsi"
 #include "bcm283x-rpi-wifi-bt.dtsi"
 
                stdout-path = "serial1:115200n8";
        };
 
-       leds {
-               led-act {
-                       gpios = <&gpio 42 GPIO_ACTIVE_HIGH>;
-               };
-
-               led-pwr {
-                       label = "PWR";
-                       gpios = <&expgpio 2 GPIO_ACTIVE_LOW>;
-                       default-state = "keep";
-                       linux,default-trigger = "default-on";
-               };
-       };
-
        sd_io_1v8_reg: regulator-sd-io-1v8 {
                compatible = "regulator-gpio";
                regulator-name = "vdd-sd-io";
        status = "okay";
 };
 
+&led_act {
+       gpios = <&gpio 42 GPIO_ACTIVE_HIGH>;
+};
+
+&leds {
+       led_pwr: led-pwr {
+               label = "PWR";
+               gpios = <&expgpio 2 GPIO_ACTIVE_LOW>;
+               default-state = "keep";
+               linux,default-trigger = "default-on";
+       };
+};
+
 &pixelvalve0 {
        status = "okay";
 };
index c53d9eb0b80270dbcb024db02281043e3d5e6720..1ab8184302db448c2407fdc8929096dd1072cfa3 100644 (file)
                stdout-path = "serial1:115200n8";
        };
 
-       leds {
-               /delete-node/ led-act;
-
-               led-pwr {
-                       gpios = <&gpio 42 GPIO_ACTIVE_HIGH>;
-               };
-       };
-
        gpio-poweroff {
                compatible = "gpio-poweroff";
                gpios = <&expgpio 5 GPIO_ACTIVE_HIGH>;
        clock-frequency = <1950000>;
 };
 
+&led_pwr {
+       gpios = <&gpio 42 GPIO_ACTIVE_HIGH>;
+};
+
+&leds {
+       /delete-node/ led_act;
+};
+
 &pm {
        /delete-property/ system-power-controller;
 };
index 19600b629be5858d2bf3de147712d2c1db5a854e..d7ba02f586d30f6e37b4b2eeb4bb4860a6eee775 100644 (file)
@@ -1,23 +1,11 @@
 // SPDX-License-Identifier: GPL-2.0
 /dts-v1/;
 #include "bcm2711-rpi-cm4.dtsi"
+#include "bcm283x-rpi-led-deprecated.dtsi"
 #include "bcm283x-rpi-usb-host.dtsi"
 
 / {
        model = "Raspberry Pi Compute Module 4 IO Board";
-
-       leds {
-               led-act {
-                       gpios = <&gpio 42 GPIO_ACTIVE_HIGH>;
-               };
-
-               led-pwr {
-                       label = "PWR";
-                       gpios = <&expgpio 2 GPIO_ACTIVE_LOW>;
-                       default-state = "keep";
-                       linux,default-trigger = "default-on";
-               };
-       };
 };
 
 &ddc0 {
        status = "okay";
 };
 
+&led_act {
+       gpios = <&gpio 42 GPIO_ACTIVE_HIGH>;
+};
+
+&leds {
+       led-pwr {
+               label = "PWR";
+               gpios = <&expgpio 2 GPIO_ACTIVE_LOW>;
+               default-state = "keep";
+               linux,default-trigger = "default-on";
+       };
+};
+
 &pixelvalve0 {
        status = "okay";
 };
index 1470d2049f74d784f34b0080538cddfb2b4e4283..02ce817868ba76d2c15fcdb824d81a83583d1047 100644 (file)
@@ -3,6 +3,7 @@
 #include "bcm2835.dtsi"
 #include "bcm2835-rpi.dtsi"
 #include "bcm2835-rpi-common.dtsi"
+#include "bcm283x-rpi-led-deprecated.dtsi"
 #include "bcm283x-rpi-usb-host.dtsi"
 
 / {
                device_type = "memory";
                reg = <0 0x10000000>;
        };
-
-       leds {
-               led-act {
-                       gpios = <&gpio 47 GPIO_ACTIVE_HIGH>;
-               };
-
-               led-pwr {
-                       label = "PWR";
-                       gpios = <&gpio 35 GPIO_ACTIVE_HIGH>;
-                       default-state = "keep";
-                       linux,default-trigger = "default-on";
-               };
-       };
 };
 
 &gpio {
        status = "okay";
 };
 
+&led_act {
+       gpios = <&gpio 47 GPIO_ACTIVE_HIGH>;
+};
+
+&leds {
+       led-pwr {
+               label = "PWR";
+               gpios = <&gpio 35 GPIO_ACTIVE_HIGH>;
+               default-state = "keep";
+               linux,default-trigger = "default-on";
+       };
+};
+
 &pwm {
        pinctrl-names = "default";
        pinctrl-0 = <&pwm0_gpio40 &pwm1_gpio45>;
index 89be496f84f840e0af4d55119e41d0160dd80639..3fdf60eb11dc9d01a75fb3da1f6f2a6bb1e5ed56 100644 (file)
@@ -3,6 +3,7 @@
 #include "bcm2835.dtsi"
 #include "bcm2835-rpi.dtsi"
 #include "bcm2835-rpi-common.dtsi"
+#include "bcm283x-rpi-led-deprecated.dtsi"
 #include "bcm283x-rpi-usb-host.dtsi"
 
 / {
                device_type = "memory";
                reg = <0 0x10000000>;
        };
-
-       leds {
-               led-act {
-                       gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
-               };
-       };
 };
 
 &gpio {
        status = "okay";
 };
 
+&led_act {
+       gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
+};
+
 &pwm {
        pinctrl-names = "default";
        pinctrl-0 = <&pwm0_gpio40 &pwm1_gpio45>;
index 7f653f11788d1e4908c7ec6d3e3da72ba8d95e06..9956fd06a4b6393273a3cb21db596189398610f5 100644 (file)
@@ -3,6 +3,7 @@
 #include "bcm2835.dtsi"
 #include "bcm2835-rpi.dtsi"
 #include "bcm2835-rpi-common.dtsi"
+#include "bcm283x-rpi-led-deprecated.dtsi"
 #include "bcm283x-rpi-smsc9514.dtsi"
 #include "bcm283x-rpi-usb-host.dtsi"
 
                device_type = "memory";
                reg = <0 0x20000000>;
        };
-
-       leds {
-               led-act {
-                       gpios = <&gpio 47 GPIO_ACTIVE_HIGH>;
-               };
-
-               led-pwr {
-                       label = "PWR";
-                       gpios = <&gpio 35 GPIO_ACTIVE_HIGH>;
-                       default-state = "keep";
-                       linux,default-trigger = "default-on";
-               };
-       };
 };
 
 &gpio {
        status = "okay";
 };
 
+&led_act {
+       gpios = <&gpio 47 GPIO_ACTIVE_HIGH>;
+};
+
+&leds {
+       led-pwr {
+               label = "PWR";
+               gpios = <&gpio 35 GPIO_ACTIVE_HIGH>;
+               default-state = "keep";
+               linux,default-trigger = "default-on";
+       };
+};
+
 &pwm {
        pinctrl-names = "default";
        pinctrl-0 = <&pwm0_gpio40 &pwm1_gpio45>;
index 55e7cb0a242f1512499607d89fb62098e631c30a..4e1770afb145d5676df461ef9daa1866672c689c 100644 (file)
@@ -3,6 +3,7 @@
 #include "bcm2835.dtsi"
 #include "bcm2835-rpi.dtsi"
 #include "bcm2835-rpi-common.dtsi"
+#include "bcm283x-rpi-led-deprecated.dtsi"
 #include "bcm283x-rpi-smsc9512.dtsi"
 #include "bcm283x-rpi-usb-host.dtsi"
 
                device_type = "memory";
                reg = <0 0x10000000>;
        };
-
-       leds {
-               led-act {
-                       gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
-               };
-       };
 };
 
 &gpio {
        status = "okay";
 };
 
+&led_act {
+       gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
+};
+
 &pwm {
        pinctrl-names = "default";
        pinctrl-0 = <&pwm0_gpio40 &pwm1_gpio45>;
index 3020c42ea8d74b5724596bca50608d28b68e0ec5..eec1d0892d332b197d528700e325f9ec3b3ecd40 100644 (file)
@@ -3,6 +3,7 @@
 #include "bcm2835.dtsi"
 #include "bcm2835-rpi.dtsi"
 #include "bcm2835-rpi-common.dtsi"
+#include "bcm283x-rpi-led-deprecated.dtsi"
 #include "bcm283x-rpi-smsc9512.dtsi"
 #include "bcm283x-rpi-usb-host.dtsi"
 
                device_type = "memory";
                reg = <0 0x10000000>;
        };
-
-       leds {
-               led-act {
-                       gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
-               };
-       };
 };
 
 &gpio {
        status = "okay";
 };
 
+&led_act {
+       gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
+};
+
 &pwm {
        pinctrl-names = "default";
        pinctrl-0 = <&pwm0_gpio40 &pwm1_gpio45>;
index f71d7e9e58956a7ae943327abbadffe573478b64..750cd76948e376c30fc8cca483921bfa7b878533 100644 (file)
@@ -3,6 +3,7 @@
 #include "bcm2835.dtsi"
 #include "bcm2835-rpi.dtsi"
 #include "bcm2835-rpi-common.dtsi"
+#include "bcm283x-rpi-led-deprecated.dtsi"
 
 / {
        leds {
        };
 };
 
+&led_act {
+       gpios = <&gpio 47 GPIO_ACTIVE_LOW>;
+};
+
 &sdhost {
        non-removable;
        vmmc-supply = <&reg_3v3>;
index 9b3a2070a6293e6da5f20d7165015c943a15d51a..dbf825985ec0b8e73c9f2c9d1e31f9d2dd13a57b 100644 (file)
@@ -7,6 +7,7 @@
 #include "bcm2835.dtsi"
 #include "bcm2835-rpi.dtsi"
 #include "bcm2835-rpi-common.dtsi"
+#include "bcm283x-rpi-led-deprecated.dtsi"
 #include "bcm283x-rpi-usb-otg.dtsi"
 #include "bcm283x-rpi-wifi-bt.dtsi"
 
                /* 8250 auxiliary UART instead of pl011 */
                stdout-path = "serial1:115200n8";
        };
-
-       leds {
-               led-act {
-                       gpios = <&gpio 47 GPIO_ACTIVE_LOW>;
-               };
-       };
 };
 
 &bt {
        status = "okay";
 };
 
+&led_act {
+       gpios = <&gpio 47 GPIO_ACTIVE_LOW>;
+};
+
 &sdhci {
        pinctrl-0 = <&emmc_gpio34 &gpclk2_gpio43>;
 };
index f9359ac2bb92e99373eca23e8e3f623354104a6d..f80e65a825fd61a519c850b69dcef33d799dd4c4 100644 (file)
@@ -7,6 +7,7 @@
 #include "bcm2835.dtsi"
 #include "bcm2835-rpi.dtsi"
 #include "bcm2835-rpi-common.dtsi"
+#include "bcm283x-rpi-led-deprecated.dtsi"
 #include "bcm283x-rpi-usb-otg.dtsi"
 
 / {
                device_type = "memory";
                reg = <0 0x20000000>;
        };
-
-       leds {
-               led-act {
-                       gpios = <&gpio 47 GPIO_ACTIVE_HIGH>;
-               };
-       };
 };
 
 &gpio {
        status = "okay";
 };
 
+&led_act {
+       gpios = <&gpio 47 GPIO_ACTIVE_HIGH>;
+};
+
 &sdhost {
        pinctrl-names = "default";
        pinctrl-0 = <&sdhost_gpio48>;
index 87ddcad760834548584699d9f69e93be66f8b5c8..ee9ee9d1fe654a550c834fea27ae8085bf92506c 100644 (file)
@@ -1,16 +1,6 @@
 #include <dt-bindings/power/raspberrypi-power.h>
 
 / {
-       leds {
-               compatible = "gpio-leds";
-
-               led-act {
-                       label = "ACT";
-                       default-state = "keep";
-                       linux,default-trigger = "heartbeat";
-               };
-       };
-
        soc {
                firmware: firmware {
                        compatible = "raspberrypi,bcm2835-firmware", "simple-mfd";
index 3635502b1e0a93e47106e5ccb72848010ceda01f..6068ec3900817eccb53149ec09ce93abf7ee43c5 100644 (file)
@@ -2,6 +2,7 @@
 /dts-v1/;
 #include "bcm2836.dtsi"
 #include "bcm2836-rpi.dtsi"
+#include "bcm283x-rpi-led-deprecated.dtsi"
 #include "bcm283x-rpi-smsc9514.dtsi"
 #include "bcm283x-rpi-usb-host.dtsi"
 
                device_type = "memory";
                reg = <0 0x40000000>;
        };
-
-       leds {
-               led-act {
-                       gpios = <&gpio 47 GPIO_ACTIVE_HIGH>;
-               };
-
-               led-pwr {
-                       label = "PWR";
-                       gpios = <&gpio 35 GPIO_ACTIVE_HIGH>;
-                       default-state = "keep";
-                       linux,default-trigger = "default-on";
-               };
-       };
 };
 
 &gpio {
        status = "okay";
 };
 
+&led_act {
+       gpios = <&gpio 47 GPIO_ACTIVE_HIGH>;
+};
+
+&leds {
+       led-pwr {
+               label = "PWR";
+               gpios = <&gpio 35 GPIO_ACTIVE_HIGH>;
+               default-state = "keep";
+               linux,default-trigger = "default-on";
+       };
+};
+
 &pwm {
        pinctrl-names = "default";
        pinctrl-0 = <&pwm0_gpio40 &pwm1_gpio45>;
index f7222a28903e16fbb166973a0b859a0a38406d22..3548306dfbcb31cf57a09e966c6dc2b99030b532 100644 (file)
@@ -2,6 +2,7 @@
 /dts-v1/;
 #include "bcm2837.dtsi"
 #include "bcm2836-rpi.dtsi"
+#include "bcm283x-rpi-led-deprecated.dtsi"
 #include "bcm283x-rpi-usb-host.dtsi"
 #include "bcm283x-rpi-wifi-bt.dtsi"
 
                device_type = "memory";
                reg = <0 0x20000000>;
        };
-
-       leds {
-               led-act {
-                       gpios = <&gpio 29 GPIO_ACTIVE_HIGH>;
-               };
-
-               led-pwr {
-                       label = "PWR";
-                       gpios = <&expgpio 2 GPIO_ACTIVE_LOW>;
-                       default-state = "keep";
-                       linux,default-trigger = "default-on";
-               };
-       };
 };
 
 &firmware {
        status = "okay";
 };
 
+&led_act {
+       gpios = <&gpio 29 GPIO_ACTIVE_HIGH>;
+};
+
+&leds {
+       led-pwr {
+               label = "PWR";
+               gpios = <&expgpio 2 GPIO_ACTIVE_LOW>;
+               default-state = "keep";
+               linux,default-trigger = "default-on";
+       };
+};
+
 &pwm {
        pinctrl-names = "default";
        pinctrl-0 = <&pwm0_gpio40 &pwm1_gpio41>;
index ec721d323ac5a8734e4a776fc529819813257bb1..2f1800cbc522137c6c28ce7e34b9620b6dca6a78 100644 (file)
@@ -3,6 +3,7 @@
 #include "bcm2837.dtsi"
 #include "bcm2836-rpi.dtsi"
 #include "bcm283x-rpi-lan7515.dtsi"
+#include "bcm283x-rpi-led-deprecated.dtsi"
 #include "bcm283x-rpi-usb-host.dtsi"
 #include "bcm283x-rpi-wifi-bt.dtsi"
 
                device_type = "memory";
                reg = <0 0x40000000>;
        };
-
-       leds {
-               led-act {
-                       gpios = <&gpio 29 GPIO_ACTIVE_HIGH>;
-               };
-
-               led-pwr {
-                       label = "PWR";
-                       gpios = <&expgpio 2 GPIO_ACTIVE_LOW>;
-                       default-state = "keep";
-                       linux,default-trigger = "default-on";
-               };
-       };
 };
 
 &bt {
        status = "okay";
 };
 
+&led_act {
+       gpios = <&gpio 29 GPIO_ACTIVE_HIGH>;
+};
+
+&leds {
+       led-pwr {
+               label = "PWR";
+               gpios = <&expgpio 2 GPIO_ACTIVE_LOW>;
+               default-state = "keep";
+               linux,default-trigger = "default-on";
+       };
+};
+
 &pwm {
        pinctrl-names = "default";
        pinctrl-0 = <&pwm0_gpio40 &pwm1_gpio41>;
index fb6a417d73e7b5c77e063aa312c596665217b2bd..61270340075c140cbd6bef69e438615f06cf3665 100644 (file)
@@ -2,6 +2,7 @@
 /dts-v1/;
 #include "bcm2837.dtsi"
 #include "bcm2836-rpi.dtsi"
+#include "bcm283x-rpi-led-deprecated.dtsi"
 #include "bcm283x-rpi-smsc9514.dtsi"
 #include "bcm283x-rpi-usb-host.dtsi"
 #include "bcm283x-rpi-wifi-bt.dtsi"
                device_type = "memory";
                reg = <0 0x40000000>;
        };
-
-       leds {
-               led-act {
-                       gpios = <&expgpio 2 GPIO_ACTIVE_HIGH>;
-               };
-       };
 };
 
 &bt {
        status = "okay";
 };
 
+&led_act {
+       gpios = <&expgpio 2 GPIO_ACTIVE_HIGH>;
+};
+
 /* uart0 communicates with the BT module */
 &uart0 {
        pinctrl-names = "default";
index f57b4ca145dd36e4fa30409d64f995526f201a9f..1e4e4946b6b61f6baa5313b9e18471ef385b5de1 100644 (file)
@@ -9,14 +9,6 @@
                reg = <0 0x40000000>;
        };
 
-       leds {
-               /*
-                * Since there is no upstream GPIO driver yet,
-                * remove the incomplete node.
-                */
-               /delete-node/ led-act;
-       };
-
        reg_3v3: fixed-regulator {
                compatible = "regulator-fixed";
                regulator-name = "3V3";
index 4a768562985efd49e6d098a6f1e517d20ea90e69..b9cc4594398b1990071fd249206803671d7a0d54 100644 (file)
@@ -6,6 +6,7 @@
 /dts-v1/;
 #include "bcm2837.dtsi"
 #include "bcm2836-rpi.dtsi"
+#include "bcm283x-rpi-led-deprecated.dtsi"
 #include "bcm283x-rpi-usb-otg.dtsi"
 #include "bcm283x-rpi-wifi-bt.dtsi"
 
                /* 8250 auxiliary UART instead of pl011 */
                stdout-path = "serial1:115200n8";
        };
-
-       leds {
-               led-act {
-                       gpios = <&gpio 29 GPIO_ACTIVE_LOW>;
-               };
-       };
 };
 
 &bt {
        status = "okay";
 };
 
+&led_act {
+       gpios = <&gpio 29 GPIO_ACTIVE_LOW>;
+};
+
 &sdhci {
        pinctrl-0 = <&emmc_gpio34 &gpclk2_gpio43>;
 };
diff --git a/arch/arm/boot/dts/bcm283x-rpi-led-deprecated.dtsi b/arch/arm/boot/dts/bcm283x-rpi-led-deprecated.dtsi
new file mode 100644 (file)
index 0000000..f83e56d
--- /dev/null
@@ -0,0 +1,18 @@
+// SPDX-License-Identifier: GPL-2.0
+
+/ {
+       /*
+        * This file provides the now deprecated ACT LED to the
+        * Raspberry Pi boards. Please don't include this file
+        * for new boards!
+        */
+       leds: leds {
+               compatible = "gpio-leds";
+
+               led_act: led-act {
+                       label = "ACT";
+                       default-state = "keep";
+                       linux,default-trigger = "heartbeat";
+               };
+       };
+};