Skip to content

Commit f4e5f77

Browse files
liuyonglong86davem330
authored andcommitted
net: hns: fix LED configuration for marvell phy
Since commit(net: phy: marvell: change default m88e1510 LED configuration), the active LED of Hip07 devices is always off, because Hip07 just use 2 LEDs. This patch adds a phy_register_fixup_for_uid() for m88e1510 to correct the LED configuration. Fixes: 0777724 ("net: phy: marvell: change default m88e1510 LED configuration") Signed-off-by: Yonglong Liu <[email protected]> Reviewed-by: linyunsheng <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent bba1831 commit f4e5f77

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

drivers/net/ethernet/hisilicon/hns/hns_enet.c

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <linux/io.h>
1212
#include <linux/ip.h>
1313
#include <linux/ipv6.h>
14+
#include <linux/marvell_phy.h>
1415
#include <linux/module.h>
1516
#include <linux/phy.h>
1617
#include <linux/platform_device.h>
@@ -1149,6 +1150,13 @@ static void hns_nic_adjust_link(struct net_device *ndev)
11491150
}
11501151
}
11511152

1153+
static int hns_phy_marvell_fixup(struct phy_device *phydev)
1154+
{
1155+
phydev->dev_flags |= MARVELL_PHY_LED0_LINK_LED1_ACTIVE;
1156+
1157+
return 0;
1158+
}
1159+
11521160
/**
11531161
*hns_nic_init_phy - init phy
11541162
*@ndev: net device
@@ -1174,6 +1182,16 @@ int hns_nic_init_phy(struct net_device *ndev, struct hnae_handle *h)
11741182
if (h->phy_if != PHY_INTERFACE_MODE_XGMII) {
11751183
phy_dev->dev_flags = 0;
11761184

1185+
/* register the PHY fixup (for Marvell 88E1510) */
1186+
ret = phy_register_fixup_for_uid(MARVELL_PHY_ID_88E1510,
1187+
MARVELL_PHY_ID_MASK,
1188+
hns_phy_marvell_fixup);
1189+
/* we can live without it, so just issue a warning */
1190+
if (ret)
1191+
netdev_warn(ndev,
1192+
"Cannot register PHY fixup, ret=%d\n",
1193+
ret);
1194+
11771195
ret = phy_connect_direct(ndev, phy_dev, hns_nic_adjust_link,
11781196
h->phy_if);
11791197
} else {
@@ -2430,8 +2448,11 @@ static int hns_nic_dev_remove(struct platform_device *pdev)
24302448
hns_nic_uninit_ring_data(priv);
24312449
priv->ring_data = NULL;
24322450

2433-
if (ndev->phydev)
2451+
if (ndev->phydev) {
2452+
phy_unregister_fixup_for_uid(MARVELL_PHY_ID_88E1510,
2453+
MARVELL_PHY_ID_MASK);
24342454
phy_disconnect(ndev->phydev);
2455+
}
24352456

24362457
if (!IS_ERR_OR_NULL(priv->ae_handle))
24372458
hnae_put_handle(priv->ae_handle);

0 commit comments

Comments
 (0)