Commit 727695e
net: phy: as21xxx: apply a default LED configuration
The driver never programs the VEND1_LED_REG() event field on its own, it
only reacts to the LED class devices instantiated by of_phy_leds(). Two
things follow from that and both end up with dark RJ45 LEDs.
Without a "leds" node in the PHY device tree node the event registers keep
their post firmware-load reset value, which is not a link or activity
pattern. With a "leds" node the situation is worse: of_phy_leds() runs from
phy_probe(), long before phy_attach_direct() populates phydev->attached_dev,
so phy_led_hw_control_get_device() returns NULL, the netdev trigger falls
back to software mode with no interface bound and the initial brightness
update writes EVENT_OFF to the PHY.
Program a default from config_init(), which runs on phy_init_hw() and
therefore after of_phy_leds(). Keep LED0 as link-plus-activity and change
LED1 to indicate any link speed, matching the expected board behavior where
yellow is solid when link is up.
Userspace and the netdev trigger can still override this at any time
through the LED class devices.
While at it register config_init on the AS212xx and AS215xx entries too, so
the default applies to every supported variant instead of only AS2101x.
Signed-off-by: Pietro Ameruoso <p.ameruoso@live.it>1 parent a1cfc7e commit 727695e
1 file changed
Lines changed: 51 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
640 | 640 | | |
641 | 641 | | |
642 | 642 | | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
643 | 682 | | |
644 | 683 | | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
645 | 690 | | |
646 | 691 | | |
647 | 692 | | |
| |||
1159 | 1204 | | |
1160 | 1205 | | |
1161 | 1206 | | |
| 1207 | + | |
1162 | 1208 | | |
1163 | 1209 | | |
1164 | 1210 | | |
| |||
1173 | 1219 | | |
1174 | 1220 | | |
1175 | 1221 | | |
| 1222 | + | |
1176 | 1223 | | |
1177 | 1224 | | |
1178 | 1225 | | |
| |||
1187 | 1234 | | |
1188 | 1235 | | |
1189 | 1236 | | |
| 1237 | + | |
1190 | 1238 | | |
1191 | 1239 | | |
1192 | 1240 | | |
| |||
1201 | 1249 | | |
1202 | 1250 | | |
1203 | 1251 | | |
| 1252 | + | |
1204 | 1253 | | |
1205 | 1254 | | |
1206 | 1255 | | |
| |||
1215 | 1264 | | |
1216 | 1265 | | |
1217 | 1266 | | |
| 1267 | + | |
1218 | 1268 | | |
1219 | 1269 | | |
1220 | 1270 | | |
| |||
1229 | 1279 | | |
1230 | 1280 | | |
1231 | 1281 | | |
| 1282 | + | |
1232 | 1283 | | |
1233 | 1284 | | |
1234 | 1285 | | |
| |||
0 commit comments