Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: phy: marvell-88q2xxx: Enable temperature sensor for mv88q211x

The temperature sensor enabled for mv88q222x devices also functions for
mv88q211x based devices. Unify the two devices probe functions to enable
the sensors for all devices supported by this driver.

The same oddity as for mv88q222x devices exists, the PHY link must be up
for a correct temperature reading to be reported.

# cat /sys/class/hwmon/hwmon9/temp1_input
-75000

# ifconfig end5 up

# cat /sys/class/hwmon/hwmon9/temp1_input
59000

Worth noting is that while the temperature register offsets and layout
are the same between mv88q211x and mv88q222x devices their names in the
datasheets are different. This change keeps the mv88q222x names for the
mv88q211x support.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Dimitri Fedrau <dima.fedrau@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/20250418145800.2420751-1-niklas.soderlund+renesas@ragnatech.se
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

authored by

Niklas Söderlund and committed by
Paolo Abeni
bef4f115 b0e8cb1e

+2 -12
+2 -12
drivers/net/phy/marvell-88q2xxx.c
··· 828 828 static int mv88q2xxx_probe(struct phy_device *phydev) 829 829 { 830 830 struct mv88q2xxx_priv *priv; 831 + int ret; 831 832 832 833 priv = devm_kzalloc(&phydev->mdio.dev, sizeof(*priv), GFP_KERNEL); 833 834 if (!priv) 834 835 return -ENOMEM; 835 836 836 837 phydev->priv = priv; 837 - 838 - return 0; 839 - } 840 - 841 - static int mv88q222x_probe(struct phy_device *phydev) 842 - { 843 - int ret; 844 - 845 - ret = mv88q2xxx_probe(phydev); 846 - if (ret) 847 - return ret; 848 838 849 839 ret = mv88q2xxx_leds_probe(phydev); 850 840 if (ret) ··· 1108 1118 .phy_id_mask = MARVELL_PHY_ID_MASK, 1109 1119 .name = "mv88q2220", 1110 1120 .flags = PHY_POLL_CABLE_TEST, 1111 - .probe = mv88q222x_probe, 1121 + .probe = mv88q2xxx_probe, 1112 1122 .get_features = mv88q2xxx_get_features, 1113 1123 .config_aneg = mv88q2xxx_config_aneg, 1114 1124 .aneg_done = genphy_c45_aneg_done,