Commit 900eef75 authored by Christian Marangi's avatar Christian Marangi Committed by David S. Miller

net: phy: at803x: move specific DT option for at8031 to specific probe

Move specific DT options for at8031 to specific probe to tidy things up
and make at803x_parse_dt more generic.
Signed-off-by: default avatarChristian Marangi <ansuelsmth@gmail.com>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d43cff3f
...@@ -825,30 +825,6 @@ static int at803x_parse_dt(struct phy_device *phydev) ...@@ -825,30 +825,6 @@ static int at803x_parse_dt(struct phy_device *phydev)
} }
} }
/* Only supported on AR8031/AR8033, the AR8030/AR8035 use strapping
* options.
*/
if (phydev->drv->phy_id == ATH8031_PHY_ID) {
if (of_property_read_bool(node, "qca,keep-pll-enabled"))
priv->flags |= AT803X_KEEP_PLL_ENABLED;
ret = at8031_register_regulators(phydev);
if (ret < 0)
return ret;
ret = devm_regulator_get_enable_optional(&phydev->mdio.dev,
"vddio");
if (ret) {
phydev_err(phydev, "failed to get VDDIO regulator\n");
return ret;
}
/* Only AR8031/8033 support 1000Base-X for SFP modules */
ret = phy_sfp_probe(phydev, &at803x_sfp_ops);
if (ret < 0)
return ret;
}
return 0; return 0;
} }
...@@ -1582,6 +1558,30 @@ static int at803x_cable_test_start(struct phy_device *phydev) ...@@ -1582,6 +1558,30 @@ static int at803x_cable_test_start(struct phy_device *phydev)
return 0; return 0;
} }
static int at8031_parse_dt(struct phy_device *phydev)
{
struct device_node *node = phydev->mdio.dev.of_node;
struct at803x_priv *priv = phydev->priv;
int ret;
if (of_property_read_bool(node, "qca,keep-pll-enabled"))
priv->flags |= AT803X_KEEP_PLL_ENABLED;
ret = at8031_register_regulators(phydev);
if (ret < 0)
return ret;
ret = devm_regulator_get_enable_optional(&phydev->mdio.dev,
"vddio");
if (ret) {
phydev_err(phydev, "failed to get VDDIO regulator\n");
return ret;
}
/* Only AR8031/8033 support 1000Base-X for SFP modules */
return phy_sfp_probe(phydev, &at803x_sfp_ops);
}
static int at8031_probe(struct phy_device *phydev) static int at8031_probe(struct phy_device *phydev)
{ {
int ret; int ret;
...@@ -1590,6 +1590,13 @@ static int at8031_probe(struct phy_device *phydev) ...@@ -1590,6 +1590,13 @@ static int at8031_probe(struct phy_device *phydev)
if (ret) if (ret)
return ret; return ret;
/* Only supported on AR8031/AR8033, the AR8030/AR8035 use strapping
* options.
*/
ret = at8031_parse_dt(phydev);
if (ret)
return ret;
/* Disable WoL in 1588 register which is enabled /* Disable WoL in 1588 register which is enabled
* by default * by default
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment