summaryrefslogtreecommitdiff
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorTim Harvey <tharvey@gateworks.com>2020-06-09 07:57:20 -0700
committerGuenter Roeck <linux@roeck-us.net>2020-07-19 16:25:21 -0700
commita4872f7a4bc16d6ed831833b4f1ec16df642c367 (patch)
tree1924ae57a0f2203a39aae78430c971acd9d2b54e /drivers/hwmon
parenta37881dead2503614b837c005efde05e614d3b69 (diff)
hwmon: (gsc) add 16bit pre-scaled voltage mode
add a 16-bit pre-scaled voltage mode to adc and clarify that existing pre-scaled mode is 24bit. Signed-off-by: Tim Harvey <tharvey@gateworks.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/1591714640-10332-3-git-send-email-tharvey@gateworks.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/gsc-hwmon.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/hwmon/gsc-hwmon.c b/drivers/hwmon/gsc-hwmon.c
index 2137bc65829d..3dfe2ca2f8c8 100644
--- a/drivers/hwmon/gsc-hwmon.c
+++ b/drivers/hwmon/gsc-hwmon.c
@@ -159,7 +159,7 @@ gsc_hwmon_read(struct device *dev, enum hwmon_sensor_types type, u32 attr,
return -EOPNOTSUPP;
}
- sz = (ch->mode == mode_voltage) ? 3 : 2;
+ sz = (ch->mode == mode_voltage_24bit) ? 3 : 2;
ret = regmap_bulk_read(hwmon->regmap, ch->reg, buf, sz);
if (ret)
return ret;
@@ -186,7 +186,8 @@ gsc_hwmon_read(struct device *dev, enum hwmon_sensor_types type, u32 attr,
/* adjust by uV offset */
tmp += ch->mvoffset;
break;
- case mode_voltage:
+ case mode_voltage_24bit:
+ case mode_voltage_16bit:
/* no adjustment needed */
break;
}
@@ -336,7 +337,8 @@ static int gsc_hwmon_probe(struct platform_device *pdev)
HWMON_T_LABEL;
i_temp++;
break;
- case mode_voltage:
+ case mode_voltage_24bit:
+ case mode_voltage_16bit:
case mode_voltage_raw:
if (i_in == GSC_HWMON_MAX_IN_CH) {
dev_err(gsc->dev, "too many input channels\n");