From: Angelo Dureghello Date: Fri, 30 May 2025 14:27:57 +0000 (+0200) Subject: iio: adc: ad7606: add enabling of optional Vrefin voltage X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=3125a5ca45f4502a230d72876257751d9124e5e6;p=users%2Fhch%2Fmisc.git 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 Link: https://patch.msgid.link/20250530-wip-bl-ad7606-reference-voltages-v2-2-d5e1ad7e6f14@baylibre.com Signed-off-by: Jonathan Cameron --- 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) {