summaryrefslogtreecommitdiff
path: root/drivers/iio/adc/axp20x_adc.c
diff options
context:
space:
mode:
authorPhilippe Schenker <philippe.schenker@toradex.com>2022-05-19 16:29:13 +0200
committerPhilippe Schenker <philippe.schenker@toradex.com>2022-05-19 16:29:13 +0200
commite6fb5c32f78f99682821f91b3959e222c93e4cb9 (patch)
tree3f6c281a7d83a6e3c0a153f93718f7cd9a39b6f7 /drivers/iio/adc/axp20x_adc.c
parent585dc27c53b6c1a32a7e11b724e91d7297388a13 (diff)
parentb7007e1d615b8d4b71c28ebf790c5164fc4491d5 (diff)
Merge remote-tracking branch 'gh-fslc/5.4-2.3.x-imx' into toradex_5.4-2.3.x-imx
Diffstat (limited to 'drivers/iio/adc/axp20x_adc.c')
-rw-r--r--drivers/iio/adc/axp20x_adc.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/drivers/iio/adc/axp20x_adc.c b/drivers/iio/adc/axp20x_adc.c
index 88059480da17..e526c7d6e044 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;