From: Jian Shen <shenjian15@huawei.com>
To: <andrew@lunn.ch>, <f.fainelli@gmail.com>, <hkallweit1@gmail.com>,
<davem@davemloft.net>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linuxarm@huawei.com>
Subject: [PATCH net-next 2/2] net: hns3: add fixup handle for hns3 driver
Date: Thu, 14 Feb 2019 12:31:07 +0800 [thread overview]
Message-ID: <1550118667-119947-3-git-send-email-shenjian15@huawei.com> (raw)
In-Reply-To: <1550118667-119947-1-git-send-email-shenjian15@huawei.com>
The default led configuration of marvell 88E1510 is not fit
for hns3 driver, this patch fixes it.
Signed-off-by: Jian Shen <shenjian15@huawei.com>
---
.../net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c
index 84f2878..4c8346e 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c
@@ -2,6 +2,7 @@
// Copyright (c) 2016-2017 Hisilicon Limited.
#include <linux/etherdevice.h>
+#include <linux/marvell_phy.h>
#include <linux/kernel.h>
#include "hclge_cmd.h"
@@ -125,6 +126,13 @@ static int hclge_mdio_read(struct mii_bus *bus, int phyid, int regnum)
return le16_to_cpu(mdio_cmd->data_rd);
}
+static int hclge_phy_marvell_fixup(struct phy_device *phydev)
+{
+ phydev->dev_flags |= MARVELL_PHY_M1510_HNS3_LEDS;
+
+ return 0;
+}
+
int hclge_mac_mdio_config(struct hclge_dev *hdev)
{
struct hclge_mac *mac = &hdev->hw.mac;
@@ -168,6 +176,15 @@ int hclge_mac_mdio_config(struct hclge_dev *hdev)
mac->phydev = phydev;
mac->mdio_bus = mdio_bus;
+ /* register the PHY board fixup (for Marvell 88E1510) */
+ ret = phy_register_fixup_for_uid(MARVELL_PHY_ID_88E1510,
+ MARVELL_PHY_ID_MASK,
+ hclge_phy_marvell_fixup);
+ /* we can live without it, so just issue a warning */
+ if (ret)
+ dev_warn(&hdev->pdev->dev,
+ "Cannot register PHY board fixup\n");
+
return 0;
}
@@ -240,6 +257,8 @@ void hclge_mac_disconnect_phy(struct hnae3_handle *handle)
if (!phydev)
return;
+ phy_unregister_fixup_for_uid(MARVELL_PHY_ID_88E1510,
+ MARVELL_PHY_ID_MASK);
phy_disconnect(phydev);
}
--
1.9.1
next prev parent reply other threads:[~2019-02-14 3:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-14 4:31 [PATCH net-next 0/2] net: phy: add new led configuration for marvell m88e1510 Jian Shen
2019-02-14 4:31 ` [PATCH net-next 1/2] net: phy: marvell: add new m88e1510 LED configuration Jian Shen
2019-02-14 4:06 ` Florian Fainelli
2019-02-14 7:24 ` shenjian (K)
2019-02-14 4:31 ` Jian Shen [this message]
2019-02-14 4:08 ` [PATCH net-next 2/2] net: hns3: add fixup handle for hns3 driver Florian Fainelli
2019-02-14 7:25 ` shenjian (K)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1550118667-119947-3-git-send-email-shenjian15@huawei.com \
--to=shenjian15@huawei.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=hkallweit1@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®