Skip to content

Commit 968b66f

Browse files
frankcrawfordgroeck
authored andcommitted
hwmon (it87): Fix voltage scaling for chips with 10.9mV ADCs
Fix voltage scaling for chips that have 10.9mV ADCs, where scaling was not performed. Fixes: ead8080 ("hwmon: (it87) Add support for IT8732F") Signed-off-by: Frank Crawford <frank@crawford.emu.id.au> Link: https://lore.kernel.org/r/20230318080543.1226700-2-frank@crawford.emu.id.au [groeck: Update subject and description to focus on bug fix] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
1 parent 813cc94 commit 968b66f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/hwmon/it87.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,8 @@ static const struct it87_devices it87_devices[] = {
515515
#define has_six_temp(data) ((data)->features & FEAT_SIX_TEMP)
516516
#define has_vin3_5v(data) ((data)->features & FEAT_VIN3_5V)
517517
#define has_conf_noexit(data) ((data)->features & FEAT_CONF_NOEXIT)
518+
#define has_scaling(data) ((data)->features & (FEAT_12MV_ADC | \
519+
FEAT_10_9MV_ADC))
518520

519521
struct it87_sio_data {
520522
int sioaddr;
@@ -3134,7 +3136,7 @@ static int it87_probe(struct platform_device *pdev)
31343136
"Detected broken BIOS defaults, disabling PWM interface\n");
31353137

31363138
/* Starting with IT8721F, we handle scaling of internal voltages */
3137-
if (has_12mv_adc(data)) {
3139+
if (has_scaling(data)) {
31383140
if (sio_data->internal & BIT(0))
31393141
data->in_scaled |= BIT(3); /* in3 is AVCC */
31403142
if (sio_data->internal & BIT(1))

0 commit comments

Comments
 (0)