1 From 25d2ba94005fac18fe68878cddff59a67e115554 Mon Sep 17 00:00:00 2001
2 From: Christian Marangi <ansuelsmth@gmail.com>
3 Date: Fri, 8 Dec 2023 15:51:53 +0100
4 Subject: [PATCH 06/13] net: phy: at803x: move specific at8031 probe mode check
7 Move specific at8031 probe mode check to dedicated probe to make
8 at803x_probe more generic and keep code tidy.
10 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
11 Reviewed-by: Andrew Lunn <andrew@lunn.ch>
12 Signed-off-by: David S. Miller <davem@davemloft.net>
14 drivers/net/phy/at803x.c | 39 +++++++++++++++++++--------------------
15 1 file changed, 19 insertions(+), 20 deletions(-)
17 --- a/drivers/net/phy/at803x.c
18 +++ b/drivers/net/phy/at803x.c
19 @@ -844,26 +844,6 @@ static int at803x_probe(struct phy_devic
23 - if (phydev->drv->phy_id == ATH8031_PHY_ID) {
24 - int ccr = phy_read(phydev, AT803X_REG_CHIP_CONFIG);
29 - mode_cfg = ccr & AT803X_MODE_CFG_MASK;
32 - case AT803X_MODE_CFG_BX1000_RGMII_50OHM:
33 - case AT803X_MODE_CFG_BX1000_RGMII_75OHM:
34 - priv->is_1000basex = true;
36 - case AT803X_MODE_CFG_FX100_RGMII_50OHM:
37 - case AT803X_MODE_CFG_FX100_RGMII_75OHM:
38 - priv->is_fiber = true;
46 @@ -1584,6 +1564,9 @@ static int at8031_parse_dt(struct phy_de
48 static int at8031_probe(struct phy_device *phydev)
50 + struct at803x_priv *priv = phydev->priv;
55 ret = at803x_probe(phydev);
56 @@ -1597,6 +1580,22 @@ static int at8031_probe(struct phy_devic
60 + ccr = phy_read(phydev, AT803X_REG_CHIP_CONFIG);
63 + mode_cfg = ccr & AT803X_MODE_CFG_MASK;
66 + case AT803X_MODE_CFG_BX1000_RGMII_50OHM:
67 + case AT803X_MODE_CFG_BX1000_RGMII_75OHM:
68 + priv->is_1000basex = true;
70 + case AT803X_MODE_CFG_FX100_RGMII_50OHM:
71 + case AT803X_MODE_CFG_FX100_RGMII_75OHM:
72 + priv->is_fiber = true;
76 /* Disable WoL in 1588 register which is enabled