From: Cédric Le Goater Date: Thu, 19 Mar 2015 17:44:45 +0000 (+0100) Subject: hwmon: (ibmpowernv) do not use the OPAL index for hwmon attribute names X-Git-Tag: omap-for-v4.2/o2_dc~170^2~15 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fcaf57b67dd03314ade476b847f246ae377160a8;p=pandora-kernel.git 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 Signed-off-by: Guenter Roeck --- Reading git-diff-tree failed