Skip to content

Commit ce2fd2f

Browse files
Dimitri FedrauNipaLocal
Dimitri Fedrau
authored and
NipaLocal
committed
net: phy: marvell-88q2xxx: enable temperature sensor in mv88q2xxx_config_init
Temperature sensor gets enabled for 88Q222X devices in mv88q222x_config_init. Move enabling to mv88q2xxx_config_init because all 88Q2XXX devices support the temperature sensor. Signed-off-by: Dimitri Fedrau <[email protected]> Tested-by: Niklas Söderlund <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: NipaLocal <nipa@local>
1 parent 8684821 commit ce2fd2f

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

drivers/net/phy/marvell-88q2xxx.c

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,15 @@ static int mv88q2xxx_config_init(struct phy_device *phydev)
513513
return ret;
514514
}
515515

516+
/* Enable temperature sense */
517+
if (priv->enable_temp) {
518+
ret = phy_modify_mmd(phydev, MDIO_MMD_PCS,
519+
MDIO_MMD_PCS_MV_TEMP_SENSOR2,
520+
MDIO_MMD_PCS_MV_TEMP_SENSOR2_DIS_MASK, 0);
521+
if (ret < 0)
522+
return ret;
523+
}
524+
516525
return 0;
517526
}
518527

@@ -903,18 +912,6 @@ static int mv88q222x_revb1_revb2_config_init(struct phy_device *phydev)
903912

904913
static int mv88q222x_config_init(struct phy_device *phydev)
905914
{
906-
struct mv88q2xxx_priv *priv = phydev->priv;
907-
int ret;
908-
909-
/* Enable temperature sense */
910-
if (priv->enable_temp) {
911-
ret = phy_modify_mmd(phydev, MDIO_MMD_PCS,
912-
MDIO_MMD_PCS_MV_TEMP_SENSOR2,
913-
MDIO_MMD_PCS_MV_TEMP_SENSOR2_DIS_MASK, 0);
914-
if (ret < 0)
915-
return ret;
916-
}
917-
918915
if (phydev->c45_ids.device_ids[MDIO_MMD_PMAPMD] == PHY_ID_88Q2220_REVB0)
919916
return mv88q222x_revb0_config_init(phydev);
920917
else

0 commit comments

Comments
 (0)