Skip to content

Commit aa03dfe

Browse files
rikka0w0Noltari
authored andcommitted
bmips: fix leds on f@st3864op
gpio-leds were not working on F@ST3864OP before openwrt#17527 was merged. This pull request adds definitions for all LEDs, including the previously non-working WAN LEDs. Signed-off-by: Hang Zhou <929513338@qq.com> Link: openwrt#20533 Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com> (cherry picked from commit 6de9691)
1 parent a38b0c9 commit aa03dfe

File tree

3 files changed

+61
-36
lines changed

3 files changed

+61
-36
lines changed

target/linux/bmips/bcm63268/base-files/etc/board.d/01_leds

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ sercomm,shg2500)
2323
ucidef_set_led_usbport "usb1" "USB1" "blue:modem" "usb1-port1" "usb2-port1"
2424
ucidef_set_led_usbport "usb2" "USB2" "green:modem" "usb1-port2" "usb2-port2"
2525
;;
26+
sagem,fast-3864-op)
27+
ucidef_set_led_netdev "wan_link" "WAN_LINK" "amber:wan" "wan" "link"
28+
ucidef_set_led_netdev "wan_act" "WAN_ACT" "green:wan" "wan" "rx tx"
29+
;;
2630
esac
2731

2832
board_config_flush

target/linux/bmips/dts/bcm63168-sagem-fast-3864-op.dts

Lines changed: 56 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
led-failsafe = &led_power_red;
1212
led-running = &led_power_green;
1313
led-upgrade = &led_power_green;
14+
15+
led-dsl = &led_dsl_green;
16+
led-internet = &led_internet_green;
17+
led-usb = &led_usb_green;
1418
};
1519

1620
keys {
@@ -38,6 +42,56 @@
3842
debounce-interval = <60>;
3943
};
4044
};
45+
46+
leds {
47+
compatible = "gpio-leds";
48+
49+
led_internet_green: led@8 {
50+
label = "green:internet";
51+
gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
52+
};
53+
54+
led_usb_green: led@9 {
55+
label = "green:dsl_bonding";
56+
gpios = <&gpio 9 GPIO_ACTIVE_LOW>;
57+
};
58+
59+
led_power_red: led@15 {
60+
function = LED_FUNCTION_POWER;
61+
color = <LED_COLOR_ID_RED>;
62+
gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
63+
};
64+
65+
led_power_green: led@20 {
66+
function = LED_FUNCTION_POWER;
67+
color = <LED_COLOR_ID_GREEN>;
68+
gpios = <&gpio 20 GPIO_ACTIVE_LOW>;
69+
};
70+
71+
led@36 {
72+
function = LED_FUNCTION_WLAN;
73+
color = <LED_COLOR_ID_GREEN>;
74+
gpios = <&gpio 36 GPIO_ACTIVE_LOW>;
75+
};
76+
77+
led@37 {
78+
label = "green:wlan_pull_up";
79+
default-state = "on";
80+
gpios = <&gpio 37 GPIO_ACTIVE_HIGH>;
81+
};
82+
83+
led@38 {
84+
function = LED_FUNCTION_WAN;
85+
color = <LED_COLOR_ID_AMBER>;
86+
gpios = <&gpio 38 GPIO_ACTIVE_LOW>;
87+
};
88+
89+
led@39 {
90+
function = LED_FUNCTION_WAN;
91+
color = <LED_COLOR_ID_GREEN>;
92+
gpios = <&gpio 39 GPIO_ACTIVE_LOW>;
93+
};
94+
};
4195
};
4296

4397
&ehci {
@@ -59,7 +113,7 @@
59113
brcm,serial-mux;
60114

61115
pinctrl-names = "default";
62-
pinctrl-0 = <&pinctrl_leds &pinctrl_serial_led>;
116+
pinctrl-0 = <&pinctrl_serial_led>;
63117

64118
led@0 {
65119
reg = <0>;
@@ -81,7 +135,7 @@
81135
label = "red:internet";
82136
};
83137

84-
led@3 {
138+
led_dsl_green: led@3 {
85139
reg = <3>;
86140
active-low;
87141
label = "green:dsl";
@@ -98,32 +152,6 @@
98152
active-low;
99153
label = "red:fxs";
100154
};
101-
102-
led@8 {
103-
reg = <8>;
104-
active-low;
105-
label = "green:internet";
106-
};
107-
108-
led@9 {
109-
reg = <9>;
110-
active-low;
111-
label = "green:dsl_bonding";
112-
};
113-
114-
led_power_red: led@15 {
115-
reg = <15>;
116-
active-low;
117-
function = LED_FUNCTION_POWER;
118-
color = <LED_COLOR_ID_RED>;
119-
};
120-
121-
led_power_green: led@20 {
122-
reg = <20>;
123-
active-low;
124-
function = LED_FUNCTION_POWER;
125-
color = <LED_COLOR_ID_GREEN>;
126-
};
127155
};
128156

129157
&mdio_ext {
@@ -241,14 +269,6 @@
241269
status = "okay";
242270
};
243271

244-
&pinctrl {
245-
pinctrl_leds: leds {
246-
function = "led";
247-
pins = "gpio8", "gpio9", "gpio15",
248-
"gpio20";
249-
};
250-
};
251-
252272
&switch0 {
253273
dsa,member = <0 0>;
254274

target/linux/bmips/image/bcm63268.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ define Device/sagem_fast-3864-op
7171
SUBPAGESIZE := 512
7272
VID_HDR_OFFSET := 2048
7373
DEVICE_PACKAGES += $(USB2_PACKAGES) \
74+
kmod-leds-gpio \
7475
kmod-leds-bcm6328
7576
CFE_WFI_FLASH_TYPE := 3
7677
CFE_WFI_VERSION := 0x5732

0 commit comments

Comments
 (0)