summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAngelo Dureghello <adureghello@baylibre.com>2025-05-30 16:27:57 +0200
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2025-06-09 07:45:36 +0100
commit3125a5ca45f4502a230d72876257751d9124e5e6 (patch)
tree3ba0956c3b3d83b8ff8c366d24230e80fb4aff58
parent82f4ed3a01b25ee6fc2a8a0a57b3509163c8bc57 (diff)
iio: adc: ad7606: add enabling of optional Vrefin voltage
Add optional refin voltage enabling. The property "refin-supply" is already available and optional in the current fdt dt_schema. Note that the driver does not need to take any actions if the supply is not present because a pin strap is used to change the behavior of the device if an external reference is connected. Signed-off-by: Angelo Dureghello <adureghello@baylibre.com> Link: https://patch.msgid.link/20250530-wip-bl-ad7606-reference-voltages-v2-2-d5e1ad7e6f14@baylibre.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-rw-r--r--drivers/iio/adc/ad7606.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/iio/adc/ad7606.c b/drivers/iio/adc/ad7606.c
index 3bbe9c05b5ed..9e489c05dea6 100644
--- a/drivers/iio/adc/ad7606.c
+++ b/drivers/iio/adc/ad7606.c
@@ -1335,6 +1335,11 @@ int ad7606_probe(struct device *dev, int irq, void __iomem *base_address,
return dev_err_probe(dev, ret,
"Failed to enable Vdrive supply\n");
+ ret = devm_regulator_get_enable_optional(dev, "refin");
+ if (ret && ret != -ENODEV)
+ return dev_err_probe(dev, ret,
+ "Failed to enable REFIN supply\n");
+
st->chip_info = chip_info;
if (st->chip_info->oversampling_num) {