summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRodrigo Alencar <rodrigo.alencar@analog.com>2026-02-16 20:10:54 +0300
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2026-02-24 00:00:58 +0300
commitd99a03d6dda43226fd3138e5cd89ddba739a11cf (patch)
tree8aa8b4cc5fd2accb7cc68fb9a099712e0f49408a
parentd5e02d0d00b99bb37f935f250181bf310d3d6e85 (diff)
downloadlinux-d99a03d6dda43226fd3138e5cd89ddba739a11cf.tar.xz
iio: amplifiers: ad8366: consume enable gpio
Some parts may consume enable GPIO to enable serial mode (HMC1119's and HMC792A P/S pin) or powerup the device (e.g. ADA4961's PWUP pin). Signed-off-by: Rodrigo Alencar <rodrigo.alencar@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-rw-r--r--drivers/iio/amplifiers/ad8366.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/iio/amplifiers/ad8366.c b/drivers/iio/amplifiers/ad8366.c
index fb787a512bff..d4499af0518a 100644
--- a/drivers/iio/amplifiers/ad8366.c
+++ b/drivers/iio/amplifiers/ad8366.c
@@ -217,6 +217,7 @@ static const struct iio_chan_spec ad8366_channels[] = {
static int ad8366_probe(struct spi_device *spi)
{
struct device *dev = &spi->dev;
+ struct gpio_desc *enable_gpio;
struct reset_control *rstc;
struct iio_dev *indio_dev;
struct ad8366_state *st;
@@ -239,6 +240,11 @@ static int ad8366_probe(struct spi_device *spi)
st->spi = spi;
st->info = spi_get_device_match_data(spi);
+ enable_gpio = devm_gpiod_get_optional(dev, "enable", GPIOD_OUT_HIGH);
+ if (IS_ERR(enable_gpio))
+ return dev_err_probe(dev, PTR_ERR(enable_gpio),
+ "Failed to get enable GPIO\n");
+
rstc = devm_reset_control_get_optional_exclusive_deasserted(dev, NULL);
if (IS_ERR(rstc))
return dev_err_probe(dev, PTR_ERR(rstc),