]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
hwmon: (ibmpowernv) do not use the OPAL index for hwmon attribute names
authorCédric Le Goater <clg@fr.ibm.com>
Thu, 19 Mar 2015 17:44:45 +0000 (18:44 +0100)
committerGuenter Roeck <linux@roeck-us.net>
Fri, 20 Mar 2015 15:25:14 +0000 (08:25 -0700)
commitfcaf57b67dd03314ade476b847f246ae377160a8
treee4dcede2cdd9cc359cb9abec6f25b6d179286893
parentf9f54f16bfa1bc76d827d4a2c80f72acbee72b05
hwmon: (ibmpowernv) do not use the OPAL index for hwmon attribute names

The current OPAL firmware exposes the different sensors of an IBM Power
system using node names such as :

sensors/amb-temp#1-data
sensors/amb-temp#1-thrs
cooling-fan#1-data
cooling-fan#1-faulted
cooling-fan#1-thrs
cooling-fan#2-data
...

The ibmpowernv driver, when loaded, parses these names to extract the
sensor index and the sensor attribute name. Unfortunately, this scheme
makes it difficult to add sensors with a different layout (specially of
the same type, like temperature) as the sensor index calculated in OPAL
is directly used in the hwmon sysfs interface.

What this patch does is add a independent hwmon index for each sensor.
The increment of the hwmon index (temp, fan, power, etc.) is kept per
sensor type in the sensor_group table. The sensor_data table is used
to store the association of the hwmon and OPAL indexes, as we need to
have the same hwmon index for different attributes of a same sensor.

Signed-off-by: Cédric Le Goater <clg@fr.ibm.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/ibmpowernv.c