Skip to content

Commit 4107408

Browse files
nbuchwitzpopcornmix
authored andcommitted
net: phy: broadcom: Preserve LED4 settings
On CM4/CM5, LED3 is used for ETH_LEDY, while LED4 may be unused or serve as INT_N. Previously, both LEDs 3 and 4 were mirrored from LED1, which overwrote the INT_N configuration on CM5. Fix this by only shadowing LED1 to LED3, preserving the setting for LED4/INT. Fixes: 9704fab ("net: phy: broadcom: Allow ethernet LED mode to be set via device tree") Signed-off-by: Nicolai Buchwitz <[email protected]>
1 parent 9df7146 commit 4107408

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

drivers/net/phy/broadcom.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -528,10 +528,14 @@ static int bcm54xx_config_init(struct phy_device *phydev)
528528
BCM54XX_SHD_LEDS1_LED3(BCM_LED_SRC_MULTICOLOR1);
529529
bcm_phy_write_shadow(phydev, BCM54XX_SHD_LEDS1, val);
530530
/* BCM54210PE controls two extra LEDs with the next register.
531-
* Make them shadow the first pair of LEDs - useful on CM4 which
532-
* uses LED3 for ETH_LEDY instead of LED1.
531+
* Make LED3 shadow LED1, but preserve LED4 as is - useful on
532+
* CM4/CM5 which use LED3 for ETH_LEDY instead of LED1. LED4
533+
* is either unused or configured as INT pin on CM5.
533534
*/
534-
bcm_phy_write_shadow(phydev, BCM54XX_SHD_LEDS1 + 1, val);
535+
reg = bcm_phy_read_shadow(phydev, BCM54XX_SHD_LEDS2);
536+
reg &= ~(0xf << 0);
537+
reg |= BCM54XX_SHD_LEDS1_LED1(BCM_LED_SRC_MULTICOLOR1);
538+
bcm_phy_write_shadow(phydev, BCM54XX_SHD_LEDS2, reg);
535539

536540
val = BCM_LED_MULTICOLOR_IN_PHASE |
537541
BCM54XX_SHD_LEDS1_LED1(led_modes[0]) |

0 commit comments

Comments
 (0)