diff options
author | Jian Shen <shenjian15@huawei.com> | 2019-04-22 21:52:23 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-04-23 10:40:32 -0700 |
commit | a93f7fe134543649cf2e2d8fc2c50a8f4d742915 (patch) | |
tree | b453d59c1875a1bf2641472c13d612b866d7aed3 /drivers/net/phy/marvell.c | |
parent | 7e6e185c74dd8a8dc539300c079adc6bc27045d6 (diff) | |
download | linux-a93f7fe134543649cf2e2d8fc2c50a8f4d742915.tar.gz linux-a93f7fe134543649cf2e2d8fc2c50a8f4d742915.tar.bz2 linux-a93f7fe134543649cf2e2d8fc2c50a8f4d742915.zip |
net: phy: marvell: add new default led configure for m88e151x
The default m88e151x LED configuration is 0x1177, used LED[0]
for 1000M link, LED[1] for 100M link, and LED[2] for active.
But for some boards, which use LED[0] for link, and LED[1] for
active, prefer to be 0x1040. To be compatible with this case,
this patch defines a new dev_flag, and set it before connect
phy in HNS3 driver. When phy initializing, using the new
LED configuration if this dev_flag is set.
Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy/marvell.c')
-rw-r--r-- | drivers/net/phy/marvell.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c index 8754cb883d02..a7e8c8113d97 100644 --- a/drivers/net/phy/marvell.c +++ b/drivers/net/phy/marvell.c @@ -137,6 +137,7 @@ #define MII_PHY_LED_CTRL 16 #define MII_88E1121_PHY_LED_DEF 0x0030 #define MII_88E1510_PHY_LED_DEF 0x1177 +#define MII_88E1510_PHY_LED0_LINK_LED1_ACTIVE 0x1040 #define MII_M1011_PHY_STATUS 0x11 #define MII_M1011_PHY_STATUS_1000 0x8000 @@ -633,7 +634,10 @@ static void marvell_config_led(struct phy_device *phydev) * LED[2] .. Blink, Activity */ case MARVELL_PHY_FAMILY_ID(MARVELL_PHY_ID_88E1510): - def_config = MII_88E1510_PHY_LED_DEF; + if (phydev->dev_flags & MARVELL_PHY_LED0_LINK_LED1_ACTIVE) + def_config = MII_88E1510_PHY_LED0_LINK_LED1_ACTIVE; + else + def_config = MII_88E1510_PHY_LED_DEF; break; default: return; |