[PATCH v2 07/11] iio: adc: ad7793: enable the AVDD and DVDD supplies
From: Nuno Sá
Date: Wed Dec 02 2026 - 12:07:31 EST
The driver never enables the AVDD and DVDD supplies, so the device only
works if something else keeps them on. Get and enable both of them at
probe.
Acked-by: Arnd Bergmann <arnd@xxxxxxxx>
Signed-off-by: Nuno Sá <nuno.sa@xxxxxxxxxx>
---
drivers/iio/adc/ad7793.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/iio/adc/ad7793.c b/drivers/iio/adc/ad7793.c
index 6a8f7212b6fd..03a1f8d6e222 100644
--- a/drivers/iio/adc/ad7793.c
+++ b/drivers/iio/adc/ad7793.c
@@ -788,6 +788,7 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = {
static int ad7793_probe(struct spi_device *spi)
{
+ static const char * const supplies[] = { "avdd", "dvdd" };
struct device *dev = &spi->dev;
const struct ad7793_platform_data *pdata = dev_get_platdata(dev);
struct ad7793_state *st;
@@ -810,6 +811,10 @@ static int ad7793_probe(struct spi_device *spi)
if (ret)
return ret;
+ ret = devm_regulator_bulk_get_enable(dev, ARRAY_SIZE(supplies), supplies);
+ if (ret)
+ return dev_err_probe(dev, ret, "Failed to enable supplies\n");
+
if (pdata->refsel != AD7793_REFSEL_INTERNAL) {
ret = devm_regulator_get_enable_read_voltage(dev, "refin");
if (ret < 0)
--
2.56.0