diff mbox series

[net-next,v8,07/13] net: phy: mediatek: add MT7530 & MT7531's PHY ID macros

Message ID 20240621122045.30732-8-SkyLake.Huang@mediatek.com (mailing list archive)
State New, archived
Headers show
Series net: phy: mediatek: Introduce mtk-phy-lib and add 2.5Gphy support | expand

Commit Message

SkyLake Huang (黃啟澤) June 21, 2024, 12:20 p.m. UTC
From: "SkyLake.Huang" <skylake.huang@mediatek.com>

This patch adds MT7530 & MT7531's PHY ID macros in mtk-ge.c so that
it follows the same rule of mtk-ge-soc.c.

Signed-off-by: SkyLake.Huang <skylake.huang@mediatek.com>
---
 drivers/net/phy/mediatek/mtk-ge.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

Comments

Andrew Lunn June 22, 2024, 5:32 p.m. UTC | #1
On Fri, Jun 21, 2024 at 08:20:39PM +0800, Sky Huang wrote:
> From: "SkyLake.Huang" <skylake.huang@mediatek.com>
> 
> This patch adds MT7530 & MT7531's PHY ID macros in mtk-ge.c so that
> it follows the same rule of mtk-ge-soc.c.
> @@ -170,9 +173,10 @@ static struct phy_driver mtk_gephy_driver[] = {
>  		.resume		= genphy_resume,
>  		.read_page	= mtk_phy_read_page,
>  		.write_page	= mtk_phy_write_page,
> +		.led_hw_is_supported = mt753x_phy_led_hw_is_supported,

Was this intentional. It does not fit the commit message, so i wounder
if it should be somewhere else?

Otherwise:

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew
SkyLake Huang (黃啟澤) June 24, 2024, 10:39 a.m. UTC | #2
On Sat, 2024-06-22 at 19:32 +0200, Andrew Lunn wrote:
>  	 
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
>  On Fri, Jun 21, 2024 at 08:20:39PM +0800, Sky Huang wrote:
> > From: "SkyLake.Huang" <skylake.huang@mediatek.com>
> > 
> > This patch adds MT7530 & MT7531's PHY ID macros in mtk-ge.c so that
> > it follows the same rule of mtk-ge-soc.c.
> > @@ -170,9 +173,10 @@ static struct phy_driver mtk_gephy_driver[] =
> {
> >  .resume= genphy_resume,
> >  .read_page= mtk_phy_read_page,
> >  .write_page= mtk_phy_write_page,
> > +.led_hw_is_supported = mt753x_phy_led_hw_is_supported,
> 
> Was this intentional. It does not fit the commit message, so i
> wounder
> if it should be somewhere else?
> 
> Otherwise:
> 
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
> 
>     Andrew

I think I mistakely added this into MT7530's callback functions
declarations. I'll remove this in next version.

BRs,
Sky
diff mbox series

Patch

diff --git a/drivers/net/phy/mediatek/mtk-ge.c b/drivers/net/phy/mediatek/mtk-ge.c
index c338bba..5fdd368 100644
--- a/drivers/net/phy/mediatek/mtk-ge.c
+++ b/drivers/net/phy/mediatek/mtk-ge.c
@@ -5,6 +5,9 @@ 
 
 #include "mtk.h"
 
+#define MTK_GPHY_ID_MT7530		0x03a29412
+#define MTK_GPHY_ID_MT7531		0x03a29441
+
 #define MTK_EXT_PAGE_ACCESS		0x1f
 #define MTK_PHY_PAGE_STANDARD		0x0000
 #define MTK_PHY_PAGE_EXTENDED		0x0001
@@ -158,7 +161,7 @@  static int mt753x_phy_led_hw_control_set(struct phy_device *phydev, u8 index,
 
 static struct phy_driver mtk_gephy_driver[] = {
 	{
-		PHY_ID_MATCH_EXACT(0x03a29412),
+		PHY_ID_MATCH_EXACT(MTK_GPHY_ID_MT7530),
 		.name		= "MediaTek MT7530 PHY",
 		.config_init	= mt7530_phy_config_init,
 		/* Interrupts are handled by the switch, not the PHY
@@ -170,9 +173,10 @@  static struct phy_driver mtk_gephy_driver[] = {
 		.resume		= genphy_resume,
 		.read_page	= mtk_phy_read_page,
 		.write_page	= mtk_phy_write_page,
+		.led_hw_is_supported = mt753x_phy_led_hw_is_supported,
 	},
 	{
-		PHY_ID_MATCH_EXACT(0x03a29441),
+		PHY_ID_MATCH_EXACT(MTK_GPHY_ID_MT7531),
 		.name		= "MediaTek MT7531 PHY",
 		.probe		= mt7531_phy_probe,
 		.config_init	= mt7531_phy_config_init,
@@ -196,8 +200,8 @@  static struct phy_driver mtk_gephy_driver[] = {
 module_phy_driver(mtk_gephy_driver);
 
 static struct mdio_device_id __maybe_unused mtk_gephy_tbl[] = {
-	{ PHY_ID_MATCH_EXACT(0x03a29441) },
-	{ PHY_ID_MATCH_EXACT(0x03a29412) },
+	{ PHY_ID_MATCH_EXACT(MTK_GPHY_ID_MT7530) },
+	{ PHY_ID_MATCH_EXACT(MTK_GPHY_ID_MT7531) },
 	{ }
 };