wspoon: hwmon: Use labels for finding VRM I/V/P
A recent kernel update added a second input current/voltage/power
reading to the hwmon sysfs attributes for the ir35221 VRMs, and it threw
off the labels in the config files since they were hardcoded for the
specific previous numbers. For example, curr2_input previously
represented an output current but now represents an input current.
Fix this by using the LABEL mode in hwmon to find which sysfs file to
use for a particular sensor by the contents of its corresponding label
file. For example, the p0_vdd_current sensor should look at the sysfs
file that has a corresponding 'iout1' value in the currX_label file.
Tested: Test that the voltages are back within thresholds again and not
showing values around 12V.
Change-Id: Ia01f5213a2e2e84a8e116b146647ffadfc02c0ab
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
diff --git a/meta-witherspoon/recipes-phosphor/sensors/phosphor-hwmon/witherspoon/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@180/ir35221@70.conf b/meta-witherspoon/recipes-phosphor/sensors/phosphor-hwmon/witherspoon/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@180/ir35221@70.conf
index 1fa7b5a..e7d8aaf 100644
--- a/meta-witherspoon/recipes-phosphor/sensors/phosphor-hwmon/witherspoon/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@180/ir35221@70.conf
+++ b/meta-witherspoon/recipes-phosphor/sensors/phosphor-hwmon/witherspoon/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@180/ir35221@70.conf
@@ -1,26 +1,44 @@
+#5-0070
+#VDD then VCS
+
+MODE_in1 = "label"
+MODE_in2 = "label"
+MODE_in3 = "label"
+MODE_in4 = "label"
+
+MODE_curr1 = "label"
+MODE_curr2 = "label"
+MODE_curr3 = "label"
+MODE_curr4 = "label"
+
+MODE_power1 = "label"
+MODE_power2 = "label"
+MODE_power3 = "label"
+MODE_power4 = "label"
+
LABEL_temp1 = "p1_vdd_temp"
WARNHI_temp1 = "80000"
WARNLO_temp1 = "0"
CRITHI_temp1 = "85000"
CRITLO_temp1 = "0"
-LABEL_curr2 = "p1_vdd_current"
-WARNLO_curr2 = "0"
-CRITLO_curr2 = "0"
-WARNHI_curr2 = "320000"
-CRITHI_curr2 = "360000"
+LABEL_curriout1 = "p1_vdd_current"
+WARNLO_curriout1 = "0"
+CRITLO_curriout1 = "0"
+WARNHI_curriout1 = "320000"
+CRITHI_curriout1 = "360000"
-LABEL_in2 = "p1_vdd_voltage"
-WARNLO_in2 = "0"
-CRITLO_in2 = "0"
-WARNHI_in2 = "1150"
-CRITHI_in2 = "1300"
+LABEL_invout1 = "p1_vdd_voltage"
+WARNLO_invout1 = "0"
+CRITLO_invout1 = "0"
+WARNHI_invout1 = "1150"
+CRITHI_invout1 = "1300"
-LABEL_power2 = "p1_vdd_power"
-WARNLO_power2 = "0"
-CRITLO_power2 = "0"
-WARNHI_power2 = "270000000"
-CRITHI_power2 = "290000000"
+LABEL_powerpout1 = "p1_vdd_power"
+WARNLO_powerpout1 = "0"
+CRITLO_powerpout1 = "0"
+WARNHI_powerpout1 = "270000000"
+CRITHI_powerpout1 = "290000000"
LABEL_temp2 = "p1_vcs_temp"
WARNHI_temp2 = "80000"
@@ -28,20 +46,20 @@
CRITHI_temp2 = "85000"
CRITLO_temp2 = "0"
-LABEL_curr3 = "p1_vcs_current"
-WARNLO_curr3 = "0"
-CRITLO_curr3 = "0"
-WARNHI_curr3 = "20000"
-CRITHI_curr3 = "25000"
+LABEL_curriout2 = "p1_vcs_current"
+WARNLO_curriout2 = "0"
+CRITLO_curriout2 = "0"
+WARNHI_curriout2 = "20000"
+CRITHI_curriout2 = "25000"
-LABEL_in3 = "p1_vcs_voltage"
-WARNLO_in3 = "0"
-CRITLO_in3 = "0"
-WARNHI_in3 = "1150"
-CRITHI_in3 = "1300"
+LABEL_invout2 = "p1_vcs_voltage"
+WARNLO_invout2 = "0"
+CRITLO_invout2 = "0"
+WARNHI_invout2 = "1150"
+CRITHI_invout2 = "1300"
-LABEL_power3 = "p1_vcs_power"
-WARNLO_power3 = "0"
-CRITLO_power3 = "0"
-WARNHI_power3 = "20000000"
-CRITHI_power3 = "25000000"
\ No newline at end of file
+LABEL_powerpout2 = "p1_vcs_power"
+WARNLO_powerpout2 = "0"
+CRITLO_powerpout2 = "0"
+WARNHI_powerpout2 = "20000000"
+CRITHI_powerpout2 = "25000000"