lantiq: vr9: set the usb led trigger via devicetree

Assign the usbdev trigger via devicetree and drop the userspace
handling of the usb leds.

Drop the now unused userspace helper code as well.

Signed-off-by: Mathias Kresin <dev@kresin.me>
Acked-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
This commit is contained in:
Mathias Kresin 2021-02-17 20:52:12 +01:00
parent 348e098054
commit 5662f5b114
6 changed files with 36 additions and 26 deletions

View File

@ -409,6 +409,8 @@
};
usb0: usb@e101000 {
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";
compatible = "lantiq,xrx200-usb";
reg = <0xe101000 0x1000
@ -418,9 +420,16 @@
dr_mode = "host";
phys = <&usb_phy0>;
phy-names = "usb2-phy";
ehci_port1: port@1 {
reg = <1>;
#trigger-source-cells = <0>;
};
};
usb1: usb@e106000 {
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";
compatible = "lantiq,xrx200-usb";
reg = <0xe106000 0x1000>;
@ -429,6 +438,11 @@
dr_mode = "host";
phys = <&usb_phy1>;
phy-names = "usb2-phy";
ehci_port2: port@1 {
reg = <1>;
#trigger-source-cells = <0>;
};
};
eth0: eth@e108000 {

View File

@ -15,9 +15,6 @@
led-failsafe = &power;
led-running = &power;
led-upgrade = &power;
led-usb = &led_usb1;
led-usb2 = &led_usb2;
};
memory@0 {
@ -64,13 +61,18 @@
label = "green:fxo";
gpios = <&stp 19 GPIO_ACTIVE_HIGH>;
};
led_usb1: usb1 {
usb1 {
label = "green:usb1";
gpios = <&stp 18 GPIO_ACTIVE_HIGH>;
trigger-sources = <&ehci_port1>;
linux,default-trigger = "usbport";
};
led_usb2: usb2 {
usb2 {
label = "green:usb2";
gpios = <&stp 15 GPIO_ACTIVE_HIGH>;
trigger-sources = <&ehci_port2>;
linux,default-trigger = "usbport";
};
sd {
label = "green:sd";

View File

@ -18,8 +18,6 @@
led-dsl = &led_dsl;
led-internet = &led_internet;
led-wifi = &led_wifi;
led-usb = &led_usb0;
led-usb2 = &led_usb2;
};
memory@0 {
@ -67,14 +65,18 @@
gpios = <&gpio 5 GPIO_ACTIVE_HIGH>;
};
led_usb0: usb0 {
usb0 {
label = "green:usb";
gpios = <&gpio 19 GPIO_ACTIVE_HIGH>;
trigger-sources = <&ehci_port1>;
linux,default-trigger = "usbport";
};
led_usb2: usb2 {
usb2 {
label = "green:usb2";
gpios = <&gpio 20 GPIO_ACTIVE_HIGH>;
trigger-sources = <&ehci_port2>;
linux,default-trigger = "usbport";
};
led_wps: wps {

View File

@ -13,9 +13,6 @@
led-dsl = &led_dsl;
led-internet = &led_internet;
led-wifi = &led_wlan5g;
led-usb = &led_usb;
led-usb2 = &led_usb;
};
memory@0 {
@ -66,9 +63,11 @@
gpios = <&gpio 5 GPIO_ACTIVE_LOW>;
};
led_usb: usb {
usb {
label = "blue:usb";
gpios = <&gpio 25 GPIO_ACTIVE_LOW>;
trigger-sources = <&ehci_port1>, <&ehci_port2>;
linux,default-trigger = "usbport";
};
eth {

View File

@ -4,19 +4,18 @@
compatible = "zyxel,p-2812hnu-f1", "zyxel,p-2812hnu", "lantiq,xway", "lantiq,vr9";
model = "ZyXEL P-2812HNU-F1";
aliases {
led-usb = &led_usb1;
led-usb2 = &led_usb2;
};
leds {
led_usb1: usb1 {
usb1 {
label = "green:usb1";
gpios = <&gpio 38 GPIO_ACTIVE_LOW>;
trigger-sources = <&ehci_port1>;
linux,default-trigger = "usbport";
};
led_usb2: usb2 {
usb2 {
label = "green:usb2";
gpios = <&gpio 44 GPIO_ACTIVE_LOW>;
trigger-sources = <&ehci_port2>;
linux,default-trigger = "usbport";
};
};
};

View File

@ -11,12 +11,6 @@ board_config_update
led_wifi="$(get_dt_led wifi)"
[ -n "$led_wifi" ] && ucidef_set_led_wlan "wifi" "wifi" "$led_wifi" "phy0tpt"
led_usb="$(get_dt_led usb)"
[ -n "$led_usb" ] && ucidef_set_led_usbdev "usb" "usb" "$led_usb" "1-1"
led_usb2="$(get_dt_led usb2)"
[ -n "$led_usb2" ] && ucidef_set_led_usbdev "usb2" "usb2" "$led_usb2" "2-1"
led_dsl="$(get_dt_led dsl)"
[ -n "$led_dsl" ] && {
led_internet="$(get_dt_led internet)"