Skip to content

Commit a37881d

Browse files
manikandan-egroeck
authored andcommitted
hwmon: (adm1275) Enable adm1278 ADM1278_TEMP1_EN
The adm1278 temp attribute need it for openbmc platform . This feature not enabled by default, so PMON_CONFIG needs to enable it. Signed-off-by: Manikandan Elumalai <[email protected]> Link: https://lore.kernel.org/r/20200622153727.GA9347@cnn [groeck: Split long line] Signed-off-by: Guenter Roeck <[email protected]>
1 parent 0ca8bb2 commit a37881d

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

drivers/hwmon/pmbus/adm1275.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -683,11 +683,13 @@ static int adm1275_probe(struct i2c_client *client,
683683
tindex = 3;
684684

685685
info->func[0] |= PMBUS_HAVE_PIN | PMBUS_HAVE_STATUS_INPUT |
686-
PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT;
686+
PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT |
687+
PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP;
687688

688-
/* Enable VOUT if not enabled (it is disabled by default) */
689-
if (!(config & ADM1278_VOUT_EN)) {
690-
config |= ADM1278_VOUT_EN;
689+
/* Enable VOUT & TEMP1 if not enabled (disabled by default) */
690+
if ((config & (ADM1278_VOUT_EN | ADM1278_TEMP1_EN)) !=
691+
(ADM1278_VOUT_EN | ADM1278_TEMP1_EN)) {
692+
config |= ADM1278_VOUT_EN | ADM1278_TEMP1_EN;
691693
ret = i2c_smbus_write_byte_data(client,
692694
ADM1275_PMON_CONFIG,
693695
config);
@@ -698,9 +700,6 @@ static int adm1275_probe(struct i2c_client *client,
698700
}
699701
}
700702

701-
if (config & ADM1278_TEMP1_EN)
702-
info->func[0] |=
703-
PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP;
704703
if (config & ADM1278_VIN_EN)
705704
info->func[0] |= PMBUS_HAVE_VIN;
706705
break;

0 commit comments

Comments
 (0)