diff mbox series

[v1,1/3] hwmon (it87): Added support for 11mV ADC

Message ID 20230312043137.1744885-2-frank@crawford.emu.id.au (mailing list archive)
State Changes Requested
Headers show
Series hwmon (it87): Support all know ADC values | expand

Commit Message

Frank Crawford March 12, 2023, 4:31 a.m. UTC
Add support of all know ADC values currently identified for it87 chips.
Includes adding support for 11mV ADC reported on IT8613E and IT8625E.

Signed-off-by: Frank Crawford <frank@crawford.emu.id.au>
---
 drivers/hwmon/it87.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c
index 66f7ceaa7c3f..fe1291d5be4b 100644
--- a/drivers/hwmon/it87.c
+++ b/drivers/hwmon/it87.c
@@ -312,6 +312,7 @@  struct it87_devices {
  * chips to avoid the problem.
  */
 #define FEAT_CONF_NOEXIT	BIT(19)	/* Chip should not exit conf mode */
+#define FEAT_11MV_ADC		BIT(20)
 
 static const struct it87_devices it87_devices[] = {
 	[it87] = {
@@ -515,6 +516,7 @@  static const struct it87_devices it87_devices[] = {
 #define has_six_temp(data)	((data)->features & FEAT_SIX_TEMP)
 #define has_vin3_5v(data)	((data)->features & FEAT_VIN3_5V)
 #define has_conf_noexit(data)	((data)->features & FEAT_CONF_NOEXIT)
+#define has_11mv_adc(data)	((data)->features & FEAT_11MV_ADC)
 
 struct it87_sio_data {
 	int sioaddr;
@@ -608,6 +610,8 @@  static int adc_lsb(const struct it87_data *data, int nr)
 		lsb = 120;
 	else if (has_10_9mv_adc(data))
 		lsb = 109;
+	else if (has_11mv_adc(data))
+		lsb = 110;
 	else
 		lsb = 160;
 	if (data->in_scaled & BIT(nr))
@@ -2002,7 +2006,8 @@  static ssize_t show_label(struct device *dev, struct device_attribute *attr,
 
 	if (has_vin3_5v(data) && nr == 0)
 		label = labels[0];
-	else if (has_12mv_adc(data) || has_10_9mv_adc(data))
+	else if (has_12mv_adc(data) || has_10_9mv_adc(data) ||
+			has_11mv_adc(data))
 		label = labels_it8721[nr];
 	else
 		label = labels[nr];