Skip to content

Commit ffa2600

Browse files
Eddie Jamesgroeck
authored andcommitted
hwmon: (occ) Fix P10 VRM temp sensors
The P10 (temp sensor version 0x10) doesn't do the same VRM status reporting that was used on P9. It just reports the temperature, so drop the check for VRM fru type in the sysfs show function, and don't set the name to "alarm". Fixes: db4919e ("hwmon: (occ) Add new temperature sensor type") Signed-off-by: Eddie James <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
1 parent 6f7d704 commit ffa2600

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

drivers/hwmon/occ/common.c

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -340,18 +340,11 @@ static ssize_t occ_show_temp_10(struct device *dev,
340340
if (val == OCC_TEMP_SENSOR_FAULT)
341341
return -EREMOTEIO;
342342

343-
/*
344-
* VRM doesn't return temperature, only alarm bit. This
345-
* attribute maps to tempX_alarm instead of tempX_input for
346-
* VRM
347-
*/
348-
if (temp->fru_type != OCC_FRU_TYPE_VRM) {
349-
/* sensor not ready */
350-
if (val == 0)
351-
return -EAGAIN;
343+
/* sensor not ready */
344+
if (val == 0)
345+
return -EAGAIN;
352346

353-
val *= 1000;
354-
}
347+
val *= 1000;
355348
break;
356349
case 2:
357350
val = temp->fru_type;
@@ -886,7 +879,7 @@ static int occ_setup_sensor_attrs(struct occ *occ)
886879
0, i);
887880
attr++;
888881

889-
if (sensors->temp.version > 1 &&
882+
if (sensors->temp.version == 2 &&
890883
temp->fru_type == OCC_FRU_TYPE_VRM) {
891884
snprintf(attr->name, sizeof(attr->name),
892885
"temp%d_alarm", s);

0 commit comments

Comments
 (0)