mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-04 11:15:39 -04:00
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: 5a774b64cd ("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>
This commit is contained in:
committed by
Jakub Kicinski
parent
c7ab8024ca
commit
cf7f0e3bd9
@@ -267,6 +267,8 @@
|
||||
|
||||
#define LAN8814_LED_CTRL_1 0x0
|
||||
#define LAN8814_LED_CTRL_1_KSZ9031_LED_MODE_ BIT(6)
|
||||
#define LAN8814_LED_CTRL_2 0x1
|
||||
#define LAN8814_LED_CTRL_2_LED1_COM_DIS BIT(8)
|
||||
|
||||
/* PHY Control 1 */
|
||||
#define MII_KSZPHY_CTRL_1 0x1e
|
||||
@@ -5894,6 +5896,23 @@ static int lan8842_config_init(struct phy_device *phydev)
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
/* Even if the GPIOs are set to control the LEDs the behaviour of the
|
||||
* LEDs is wrong, they are not blinking when there is traffic.
|
||||
* To fix this it is required to set extended LED mode
|
||||
*/
|
||||
ret = lanphy_modify_page_reg(phydev, LAN8814_PAGE_PORT_REGS,
|
||||
LAN8814_LED_CTRL_1,
|
||||
LAN8814_LED_CTRL_1_KSZ9031_LED_MODE_, 0);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
ret = lanphy_modify_page_reg(phydev, LAN8814_PAGE_PORT_REGS,
|
||||
LAN8814_LED_CTRL_2,
|
||||
LAN8814_LED_CTRL_2_LED1_COM_DIS,
|
||||
LAN8814_LED_CTRL_2_LED1_COM_DIS);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
/* To allow the PHY to control the LEDs the GPIOs of the PHY should have
|
||||
* a function mode and not the GPIO. Apparently by default the value is
|
||||
* GPIO and not function even though the datasheet it says that it is
|
||||
|
||||
Reference in New Issue
Block a user