diff mbox series

lantiq: ARV752DPW22: set the usb led trigger via devicetree

Message ID 20210216183448.2333983-1-dev@kresin.me
State Accepted
Delegated to: Mathias Kresin
Headers show
Series lantiq: ARV752DPW22: set the usb led trigger via devicetree | expand

Commit Message

Mathias Kresin Feb. 16, 2021, 6:34 p.m. UTC
Assign the usbdev trigger via devicetree and drop the userspace
handling of the usb leds

Add the PCI attached usb controller as trigger sources for the usb led
as well.

Signed-off-by: Mathias Kresin <dev@kresin.me>
---
 .../arch/mips/boot/dts/lantiq/danube.dtsi     |  7 +++++
 .../lantiq/danube_arcadyan_arv752dpw22.dts    | 28 ++++++++++++++++++-
 2 files changed, 34 insertions(+), 1 deletion(-)

Comments

Adrian Schmutzler Feb. 19, 2021, 1:17 p.m. UTC | #1
> -----Original Message-----
> From: openwrt-devel [mailto:openwrt-devel-bounces@lists.openwrt.org]
> On Behalf Of Mathias Kresin
> Sent: Dienstag, 16. Februar 2021 19:35
> To: openwrt-devel@lists.openwrt.org
> Subject: [PATCH] lantiq: ARV752DPW22: set the usb led trigger via devicetree
> 
> Assign the usbdev trigger via devicetree and drop the userspace handling of
> the usb leds
> 
> Add the PCI attached usb controller as trigger sources for the usb led as well.

Any chance to convert the other danube devices as well, so we get rid of all userspace usb LEDs here as well?

Best

Adrian

> 
> Signed-off-by: Mathias Kresin <dev@kresin.me>
> ---
>  .../arch/mips/boot/dts/lantiq/danube.dtsi     |  7 +++++
>  .../lantiq/danube_arcadyan_arv752dpw22.dts    | 28
> ++++++++++++++++++-
>  2 files changed, 34 insertions(+), 1 deletion(-)
> 
> diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube.dtsi
> b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube.dtsi
> index ced3e3bcb4..bb3e9fb188 100644
> --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube.dtsi
> +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube.dtsi
> @@ -254,6 +254,8 @@
>  		};
> 
>  		usb: usb@e101000 {
> +			#address-cells = <1>;
> +			#size-cells = <0>;
>  			compatible = "lantiq,danube-usb";
>  			reg = <0xe101000 0x1000
>  				0xe120000 0x3f000>;
> @@ -263,6 +265,11 @@
>  			phys = <&usb_phy>;
>  			phy-names = "usb2-phy";
>  			status = "disabled";
> +
> +			ehci_port1: port@1 {
> +				reg = <1>;
> +				#trigger-source-cells = <0>;
> +			};
>  		};
> 
>  		deu@e103100 {
> diff --git
> a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv
> 752dpw22.dts
> b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv
> 752dpw22.dts
> index 72483e4749..00ac016a42 100644
> ---
> a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv
> 752dpw22.dts
> +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadya
> +++ n_arv752dpw22.dts
> @@ -17,7 +17,6 @@
>  		led-upgrade = &power_red;
> 
>  		led-dsl = &internet_red;
> -		led-usb = &umts;
>  		led-wifi = &wifi;
>  	};
> 
> @@ -78,6 +77,9 @@
>  		umts: umts {
>  			label = "red:umts";
>  			gpios = <&gpiomm 3 GPIO_ACTIVE_LOW>;
> +			trigger-sources = <&ehci_port1>,
> +					  <&ehci_port2>, <&uhci_port2>;
> +			linux,default-trigger = "usbport";
>  		};
>  		wifi: wifi {
>  			label = "red:wifi";
> @@ -242,6 +244,30 @@
>  		ralink,mtd-eeprom-swap;
>  		mtd-mac-address = <&boardconfig 0x16>;
>  	};
> +
> +	usb@0f,0 {
> +		#address-cells = <1>;
> +		#size-cells = <0>;
> +		compatible = "pci1106,3038";
> +		reg = <0x7800 0 0 0 0>; /* 0000:00:0f.0: UHCI Host Controller
> */
> +
> +		uhci_port2: port@2 {
> +			reg = <2>;
> +			#trigger-source-cells = <0>;
> +		};
> +	};
> +
> +	usb@0f,2 {
> +		#address-cells = <1>;
> +		#size-cells = <0>;
> +		compatible = "pci1106,3038";
> +		reg = <0x7a00 0 0 0 0>; /* 0000:00:0f.2: EHCI Host Controller*/
> +
> +		ehci_port2: port@2 {
> +			reg = <2>;
> +			#trigger-source-cells = <0>;
> +		};
> +	};
>  };
> 
>  &usb_phy {
> --
> 2.25.1
> 
> 
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Mathias Kresin Feb. 19, 2021, 9:11 p.m. UTC | #2
2/19/21 2:17 PM, Adrian Schmutzler:
>> -----Original Message-----
>> From: openwrt-devel [mailto:openwrt-devel-bounces@lists.openwrt.org]
>> On Behalf Of Mathias Kresin
>> Sent: Dienstag, 16. Februar 2021 19:35
>> To: openwrt-devel@lists.openwrt.org
>> Subject: [PATCH] lantiq: ARV752DPW22: set the usb led trigger via devicetree
>>
>> Assign the usbdev trigger via devicetree and drop the userspace handling of
>> the usb leds
>>
>> Add the PCI attached usb controller as trigger sources for the usb led as well.
> 
> Any chance to convert the other danube devices as well, so we get rid of all userspace usb LEDs here as well?

I decided against touching the other danube boards. I only have one 
danube board exposing the usb port and no idea whether the hardware 
configuration used by my board is common for all danube boards.

Mathias
diff mbox series

Patch

diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube.dtsi b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube.dtsi
index ced3e3bcb4..bb3e9fb188 100644
--- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube.dtsi
+++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube.dtsi
@@ -254,6 +254,8 @@ 
 		};
 
 		usb: usb@e101000 {
+			#address-cells = <1>;
+			#size-cells = <0>;
 			compatible = "lantiq,danube-usb";
 			reg = <0xe101000 0x1000
 				0xe120000 0x3f000>;
@@ -263,6 +265,11 @@ 
 			phys = <&usb_phy>;
 			phy-names = "usb2-phy";
 			status = "disabled";
+
+			ehci_port1: port@1 {
+				reg = <1>;
+				#trigger-source-cells = <0>;
+			};
 		};
 
 		deu@e103100 {
diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv752dpw22.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv752dpw22.dts
index 72483e4749..00ac016a42 100644
--- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv752dpw22.dts
+++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv752dpw22.dts
@@ -17,7 +17,6 @@ 
 		led-upgrade = &power_red;
 
 		led-dsl = &internet_red;
-		led-usb = &umts;
 		led-wifi = &wifi;
 	};
 
@@ -78,6 +77,9 @@ 
 		umts: umts {
 			label = "red:umts";
 			gpios = <&gpiomm 3 GPIO_ACTIVE_LOW>;
+			trigger-sources = <&ehci_port1>,
+					  <&ehci_port2>, <&uhci_port2>;
+			linux,default-trigger = "usbport";
 		};
 		wifi: wifi {
 			label = "red:wifi";
@@ -242,6 +244,30 @@ 
 		ralink,mtd-eeprom-swap;
 		mtd-mac-address = <&boardconfig 0x16>;
 	};
+
+	usb@0f,0 {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		compatible = "pci1106,3038";
+		reg = <0x7800 0 0 0 0>; /* 0000:00:0f.0: UHCI Host Controller */
+
+		uhci_port2: port@2 {
+			reg = <2>;
+			#trigger-source-cells = <0>;
+		};
+	};
+
+	usb@0f,2 {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		compatible = "pci1106,3038";
+		reg = <0x7a00 0 0 0 0>; /* 0000:00:0f.2: EHCI Host Controller*/
+
+		ehci_port2: port@2 {
+			reg = <2>;
+			#trigger-source-cells = <0>;
+		};
+	};
 };
 
 &usb_phy {