Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: phy: micrel: Fix default LED behaviour

By default the LED will be ON when there is a link but they are not
blinking when there is any traffic activity. Therefore change this
to blink when there is any traffic.

Fixes: 5a774b64cd6a ("net: phy: micrel: Add support for lan8842")
Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Link: https://patch.msgid.link/20250922130314.758229-1-horatiu.vultur@microchip.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Horatiu Vultur and committed by
Jakub Kicinski
cf7f0e3b c7ab8024

+19
+19
drivers/net/phy/micrel.c
··· 267 267 268 268 #define LAN8814_LED_CTRL_1 0x0 269 269 #define LAN8814_LED_CTRL_1_KSZ9031_LED_MODE_ BIT(6) 270 + #define LAN8814_LED_CTRL_2 0x1 271 + #define LAN8814_LED_CTRL_2_LED1_COM_DIS BIT(8) 270 272 271 273 /* PHY Control 1 */ 272 274 #define MII_KSZPHY_CTRL_1 0x1e ··· 5893 5891 LAN8814_QSGMII_SOFT_RESET, 5894 5892 LAN8814_QSGMII_SOFT_RESET_BIT, 5895 5893 LAN8814_QSGMII_SOFT_RESET_BIT); 5894 + if (ret < 0) 5895 + return ret; 5896 + 5897 + /* Even if the GPIOs are set to control the LEDs the behaviour of the 5898 + * LEDs is wrong, they are not blinking when there is traffic. 5899 + * To fix this it is required to set extended LED mode 5900 + */ 5901 + ret = lanphy_modify_page_reg(phydev, LAN8814_PAGE_PORT_REGS, 5902 + LAN8814_LED_CTRL_1, 5903 + LAN8814_LED_CTRL_1_KSZ9031_LED_MODE_, 0); 5904 + if (ret < 0) 5905 + return ret; 5906 + 5907 + ret = lanphy_modify_page_reg(phydev, LAN8814_PAGE_PORT_REGS, 5908 + LAN8814_LED_CTRL_2, 5909 + LAN8814_LED_CTRL_2_LED1_COM_DIS, 5910 + LAN8814_LED_CTRL_2_LED1_COM_DIS); 5896 5911 if (ret < 0) 5897 5912 return ret; 5898 5913