summaryrefslogtreecommitdiffstats
path: root/drivers/iio/temperature
diff options
context:
space:
mode:
authorNuno Sa <nuno.sa@analog.com>2024-04-04 10:58:18 +0200
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2024-04-06 16:49:24 +0100
commit47ef0501a9cc25c88dcac2b57ed3bab4da53f3d5 (patch)
treebf85f0bdf88fa76849bf970c19cd91124470686d /drivers/iio/temperature
parentf979e52d3bc136b4ef1351479464c54a7c81c934 (diff)
downloadlinux-stable-47ef0501a9cc25c88dcac2b57ed3bab4da53f3d5.tar.gz
linux-stable-47ef0501a9cc25c88dcac2b57ed3bab4da53f3d5.tar.bz2
linux-stable-47ef0501a9cc25c88dcac2b57ed3bab4da53f3d5.zip
iio: temperature: ltc2983: support vdd regulator
Add support for the power supply regulator. Signed-off-by: Nuno Sa <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20240404-ltc2983-misc-improv-v5-2-c1f58057fcea@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/temperature')
-rw-r--r--drivers/iio/temperature/ltc2983.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/iio/temperature/ltc2983.c b/drivers/iio/temperature/ltc2983.c
index 3c4524d57b8e..24d19f3c7292 100644
--- a/drivers/iio/temperature/ltc2983.c
+++ b/drivers/iio/temperature/ltc2983.c
@@ -16,6 +16,7 @@
#include <linux/module.h>
#include <linux/property.h>
#include <linux/regmap.h>
+#include <linux/regulator/consumer.h>
#include <linux/spi/spi.h>
#include <asm/byteorder.h>
@@ -1597,6 +1598,10 @@ static int ltc2983_probe(struct spi_device *spi)
if (ret)
return ret;
+ ret = devm_regulator_get_enable(&spi->dev, "vdd");
+ if (ret)
+ return ret;
+
gpio = devm_gpiod_get_optional(&st->spi->dev, "reset", GPIOD_OUT_HIGH);
if (IS_ERR(gpio))
return PTR_ERR(gpio);