mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-11-24 20:21:43 +00:00
Add support for MDIO busses
Marvell Ethernet PHYs can contain a temperature sensor, which the kernel exports as an HWMON device. The PHY is on an MDIO bus. Add support for this bus types to libsensors. The sensor is then displayed by sensors(1): socaipsbus02100000ethernet02188000mdioswitch0mdio01-mdio-1 Adapter: MDIO adapter temp1: +54.0°C (crit = +100.0°C) Signed-off-by: Andrew Lunn <andrew@lunn.ch>
This commit is contained in:
1 parent
0d5ccf640d
commit
0880db23b9
5 files changed
+17
-2
No files matched your search
@@ -717,6 +717,12 @@ static int sensors_read_one_sysfs_chip(const char *dev_path,
|
||||
/* As of kernel 2.6.32, the hid device names don't look good */
|
||||
entry.chip.bus.nr = bus;
|
||||
entry.chip.addr = id;
|
||||
} else
|
||||
if (subsys && !strcmp(subsys, "mdio_bus")) {
|
||||
if (sscanf(dev_name, "%*[^:]:%d", &entry.chip.addr) != 1)
|
||||
entry.chip.addr = 0;
|
||||
entry.chip.bus.type = SENSORS_BUS_TYPE_MDIO;
|
||||
entry.chip.bus.nr = 0;
|
||||
} else {
|
||||
/* Ignore unknown device */
|
||||
err = 0;
|
||||
|
||||
Reference in new issue
Block a user