diff options
author | Jiri Kosina <jkosina@suse.cz> | 2022-01-10 09:56:57 +0100 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2022-01-10 09:56:57 +0100 |
commit | 3551a3ff8229e15d2a4b47b8234923bc72da65ef (patch) | |
tree | a62465753397b0268529a5d0b9ab43a8840069ad /drivers/iio/adc/axp20x_adc.c | |
parent | 906095af85e8b2e53ee9f8c50b3dff365aa09df8 (diff) | |
parent | 33a5c2793451770cb6dcf0cc35c76cfd4b045513 (diff) | |
download | linux-3551a3ff8229e15d2a4b47b8234923bc72da65ef.tar.gz linux-3551a3ff8229e15d2a4b47b8234923bc72da65ef.tar.bz2 linux-3551a3ff8229e15d2a4b47b8234923bc72da65ef.zip |
Merge branch 'for-5.17/letsketch' into for-linus
- new driver to support for LetSketch device (Hans de Goede)
Diffstat (limited to 'drivers/iio/adc/axp20x_adc.c')
-rw-r--r-- | drivers/iio/adc/axp20x_adc.c | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/drivers/iio/adc/axp20x_adc.c b/drivers/iio/adc/axp20x_adc.c index 3e0c0233b431..df99f1365c39 100644 --- a/drivers/iio/adc/axp20x_adc.c +++ b/drivers/iio/adc/axp20x_adc.c @@ -251,19 +251,8 @@ static int axp22x_adc_raw(struct iio_dev *indio_dev, struct iio_chan_spec const *chan, int *val) { struct axp20x_adc_iio *info = iio_priv(indio_dev); - int size; - /* - * N.B.: Unlike the Chinese datasheets tell, the charging current is - * stored on 12 bits, not 13 bits. Only discharging current is on 13 - * bits. - */ - if (chan->type == IIO_CURRENT && chan->channel == AXP22X_BATT_DISCHRG_I) - size = 13; - else - size = 12; - - *val = axp20x_read_variable_width(info->regmap, chan->address, size); + *val = axp20x_read_variable_width(info->regmap, chan->address, 12); if (*val < 0) return *val; @@ -386,9 +375,8 @@ static int axp22x_adc_scale(struct iio_chan_spec const *chan, int *val, return IIO_VAL_INT_PLUS_MICRO; case IIO_CURRENT: - *val = 0; - *val2 = 500000; - return IIO_VAL_INT_PLUS_MICRO; + *val = 1; + return IIO_VAL_INT; case IIO_TEMP: *val = 100; |