Skip to content

Commit f8fd022

Browse files
committed
net: phy: realtek: RTL8211F: Update the LED config apply logic
1) Apply the LED config after genphy_soft_reset(phydev); 2) Use the U-Boot defaults if unable to apply LEDs settings from device tree. Signed-off-by: Valentin Raevsky <valentin@compulab.co.il>
1 parent b698d94 commit f8fd022

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

drivers/net/phy/realtek.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -502,14 +502,16 @@ static int rtl8211f_config_init(struct phy_device *phydev)
502502
return ret;
503503
}
504504

505-
ret = rtl8211f_config_leds(phydev);
506-
if (ret < 0) {
505+
ret = genphy_soft_reset(phydev);
506+
507+
if ( rtl8211f_config_leds(phydev) < 0 ) {
507508
dev_warn(dev, "Unable to apply LEDs settings from Device Tree, use defaults\n");
509+
phy_write_paged(phydev, 0xd04, RTL8211F_LCR, 0x2d7b);
508510
}
509511
dev_dbg(dev, "Read LCR (LED Control Register): 0x%04x\n",
510512
(unsigned int)phy_read_paged(phydev, 0xd04, RTL8211F_LCR));
511513

512-
return genphy_soft_reset(phydev);
514+
return ret;
513515
}
514516

515517
static int rtl821x_suspend(struct phy_device *phydev)

0 commit comments

Comments
 (0)