summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJeff LaBundy <jeff@labundy.com>2022-01-23 13:01:06 -0600
committerLee Jones <lee.jones@linaro.org>2022-02-14 13:07:33 +0000
commit9e444dbf278c604110762b25d8e0b4e9f1d27dbc (patch)
tree651b72d34370622073472fd588304d633722c1dd /drivers
parent1de785a58035031f81a43c42f355fa1db510dc36 (diff)
downloadlinux-9e444dbf278c604110762b25d8e0b4e9f1d27dbc.tar.bz2
iio: temperature: iqs620at-temp: Add support for V3 silicon
The vendor introduced an updated revision of IQS620A(T) silicon which is backwards-compatible with previous revisions, the only exception being the offset used to derive temperature. Enable this new revision by returning the appropriate offset as a function of the hardware number provided by the parent MFD. Signed-off-by: Jeff LaBundy <jeff@labundy.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/iio/temperature/iqs620at-temp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/iio/temperature/iqs620at-temp.c b/drivers/iio/temperature/iqs620at-temp.c
index fe126e1fb783..e2f878d57af7 100644
--- a/drivers/iio/temperature/iqs620at-temp.c
+++ b/drivers/iio/temperature/iqs620at-temp.c
@@ -17,6 +17,7 @@
#define IQS620_TEMP_SCALE 1000
#define IQS620_TEMP_OFFSET (-100)
+#define IQS620_TEMP_OFFSET_V3 (-40)
static int iqs620_temp_read_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
@@ -41,7 +42,8 @@ static int iqs620_temp_read_raw(struct iio_dev *indio_dev,
return IIO_VAL_INT;
case IIO_CHAN_INFO_OFFSET:
- *val = IQS620_TEMP_OFFSET;
+ *val = iqs62x->hw_num < IQS620_HW_NUM_V3 ? IQS620_TEMP_OFFSET
+ : IQS620_TEMP_OFFSET_V3;
return IIO_VAL_INT;
default: