Skip to content

Commit

Permalink
hwmon: (occ) Fix P10 VRM temp sensors
Browse files Browse the repository at this point in the history
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 <eajames@linux.ibm.com>
Link: https://lore.kernel.org/r/20210929153604.14968-1-eajames@linux.ibm.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
  • Loading branch information
Eddie James authored and groeck committed Oct 2, 2021
1 parent 6f7d704 commit ffa2600
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions drivers/hwmon/occ/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -340,18 +340,11 @@ static ssize_t occ_show_temp_10(struct device *dev,
if (val == OCC_TEMP_SENSOR_FAULT)
return -EREMOTEIO;

/*
* VRM doesn't return temperature, only alarm bit. This
* attribute maps to tempX_alarm instead of tempX_input for
* VRM
*/
if (temp->fru_type != OCC_FRU_TYPE_VRM) {
/* sensor not ready */
if (val == 0)
return -EAGAIN;
/* sensor not ready */
if (val == 0)
return -EAGAIN;

val *= 1000;
}
val *= 1000;
break;
case 2:
val = temp->fru_type;
Expand Down Expand Up @@ -886,7 +879,7 @@ static int occ_setup_sensor_attrs(struct occ *occ)
0, i);
attr++;

if (sensors->temp.version > 1 &&
if (sensors->temp.version == 2 &&
temp->fru_type == OCC_FRU_TYPE_VRM) {
snprintf(attr->name, sizeof(attr->name),
"temp%d_alarm", s);
Expand Down

0 comments on commit ffa2600

Please sign in to comment.