1 From 900eef75cc5018e149c52fe305c9c3fe424c52a7 Mon Sep 17 00:00:00 2001
2 From: Christian Marangi <ansuelsmth@gmail.com>
3 Date: Fri, 8 Dec 2023 15:51:52 +0100
4 Subject: [PATCH 05/13] net: phy: at803x: move specific DT option for at8031 to
7 Move specific DT options for at8031 to specific probe to tidy things up
8 and make at803x_parse_dt more generic.
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 | 55 ++++++++++++++++++++++------------------
15 1 file changed, 31 insertions(+), 24 deletions(-)
17 --- a/drivers/net/phy/at803x.c
18 +++ b/drivers/net/phy/at803x.c
19 @@ -825,30 +825,6 @@ static int at803x_parse_dt(struct phy_de
23 - /* Only supported on AR8031/AR8033, the AR8030/AR8035 use strapping
26 - if (phydev->drv->phy_id == ATH8031_PHY_ID) {
27 - if (of_property_read_bool(node, "qca,keep-pll-enabled"))
28 - priv->flags |= AT803X_KEEP_PLL_ENABLED;
30 - ret = at8031_register_regulators(phydev);
34 - ret = devm_regulator_get_enable_optional(&phydev->mdio.dev,
37 - phydev_err(phydev, "failed to get VDDIO regulator\n");
41 - /* Only AR8031/8033 support 1000Base-X for SFP modules */
42 - ret = phy_sfp_probe(phydev, &at803x_sfp_ops);
50 @@ -1582,6 +1558,30 @@ static int at803x_cable_test_start(struc
54 +static int at8031_parse_dt(struct phy_device *phydev)
56 + struct device_node *node = phydev->mdio.dev.of_node;
57 + struct at803x_priv *priv = phydev->priv;
60 + if (of_property_read_bool(node, "qca,keep-pll-enabled"))
61 + priv->flags |= AT803X_KEEP_PLL_ENABLED;
63 + ret = at8031_register_regulators(phydev);
67 + ret = devm_regulator_get_enable_optional(&phydev->mdio.dev,
70 + phydev_err(phydev, "failed to get VDDIO regulator\n");
74 + /* Only AR8031/8033 support 1000Base-X for SFP modules */
75 + return phy_sfp_probe(phydev, &at803x_sfp_ops);
78 static int at8031_probe(struct phy_device *phydev)
81 @@ -1590,6 +1590,13 @@ static int at8031_probe(struct phy_devic
85 + /* Only supported on AR8031/AR8033, the AR8030/AR8035 use strapping
88 + ret = at8031_parse_dt(phydev);
92 /* Disable WoL in 1588 register which is enabled