Commit eeac7d43 authored by Michael Walle's avatar Michael Walle Committed by David S. Miller

net: phy: icplus: don't set APS_EN bit on IP101G

This bit is reserved as 'always-write-1'. While this is not a particular
error, because we are only setting it, guard it by checking the model to
prevent errors in the future.
Signed-off-by: default avatarMichael Walle <michael@walle.cc>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 675115bf
...@@ -208,10 +208,10 @@ static int ip101a_g_probe(struct phy_device *phydev) ...@@ -208,10 +208,10 @@ static int ip101a_g_probe(struct phy_device *phydev)
return 0; return 0;
} }
static int ip101a_g_config_init(struct phy_device *phydev) static int ip101a_g_config_intr_pin(struct phy_device *phydev)
{ {
struct ip101a_g_phy_priv *priv = phydev->priv; struct ip101a_g_phy_priv *priv = phydev->priv;
int err, c; int err;
/* configure the RXER/INTR_32 pin of the 32-pin IP101GR if needed: */ /* configure the RXER/INTR_32 pin of the 32-pin IP101GR if needed: */
switch (priv->sel_intr32) { switch (priv->sel_intr32) {
...@@ -241,11 +241,24 @@ static int ip101a_g_config_init(struct phy_device *phydev) ...@@ -241,11 +241,24 @@ static int ip101a_g_config_init(struct phy_device *phydev)
break; break;
} }
return 0;
}
static int ip101a_config_init(struct phy_device *phydev)
{
int ret;
/* Enable Auto Power Saving mode */ /* Enable Auto Power Saving mode */
c = phy_read(phydev, IP10XX_SPEC_CTRL_STATUS); ret = phy_set_bits(phydev, IP10XX_SPEC_CTRL_STATUS, IP101A_G_APS_ON);
c |= IP101A_G_APS_ON; if (ret)
return ret;
return phy_write(phydev, IP10XX_SPEC_CTRL_STATUS, c); return ip101a_g_config_intr_pin(phydev);
}
static int ip101g_config_init(struct phy_device *phydev)
{
return ip101a_g_config_intr_pin(phydev);
} }
static int ip101a_g_ack_interrupt(struct phy_device *phydev) static int ip101a_g_ack_interrupt(struct phy_device *phydev)
...@@ -379,7 +392,7 @@ static struct phy_driver icplus_driver[] = { ...@@ -379,7 +392,7 @@ static struct phy_driver icplus_driver[] = {
.probe = ip101a_g_probe, .probe = ip101a_g_probe,
.config_intr = ip101a_g_config_intr, .config_intr = ip101a_g_config_intr,
.handle_interrupt = ip101a_g_handle_interrupt, .handle_interrupt = ip101a_g_handle_interrupt,
.config_init = ip101a_g_config_init, .config_init = ip101a_config_init,
.soft_reset = genphy_soft_reset, .soft_reset = genphy_soft_reset,
.suspend = genphy_suspend, .suspend = genphy_suspend,
.resume = genphy_resume, .resume = genphy_resume,
...@@ -389,7 +402,7 @@ static struct phy_driver icplus_driver[] = { ...@@ -389,7 +402,7 @@ static struct phy_driver icplus_driver[] = {
.probe = ip101a_g_probe, .probe = ip101a_g_probe,
.config_intr = ip101a_g_config_intr, .config_intr = ip101a_g_config_intr,
.handle_interrupt = ip101a_g_handle_interrupt, .handle_interrupt = ip101a_g_handle_interrupt,
.config_init = ip101a_g_config_init, .config_init = ip101g_config_init,
.soft_reset = genphy_soft_reset, .soft_reset = genphy_soft_reset,
.suspend = genphy_suspend, .suspend = genphy_suspend,
.resume = genphy_resume, .resume = genphy_resume,
......
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