mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 10:58:48 +09:00
iio: adc: rockchip: Don't return fail at probe when the regulator is dummy
If the referenced regulator is a dummy, the voltage is invalid, but someone doesn't need the voltage, just need the adc value, so don't return fail at probe when the regulator is dummy. If he wants the voltage, configures the actual referenced regulator at dts. Change-Id: I8eaecc1a8e7e57c3a87aa69b9b852735bf4a025a Signed-off-by: David Wu <david.wu@rock-chips.com>
This commit is contained in:
@@ -116,6 +116,10 @@ static int rockchip_saradc_read_raw(struct iio_dev *indio_dev,
|
||||
mutex_unlock(&indio_dev->mlock);
|
||||
return IIO_VAL_INT;
|
||||
case IIO_CHAN_INFO_SCALE:
|
||||
/* It is a dummy regulator */
|
||||
if (info->uv_vref < 0)
|
||||
return info->uv_vref;
|
||||
|
||||
*val = info->uv_vref / 1000;
|
||||
*val2 = chan->scan_type.realbits;
|
||||
return IIO_VAL_FRACTIONAL_LOG2;
|
||||
|
||||
Reference in New Issue
Block a user