[PATCH 3/7] iio: amplifiers: ad8366: consume enable gpio for applicable parts

Rodrigo Alencar via B4 Relay posted 7 patches 3 weeks ago
There is a newer version of this series
[PATCH 3/7] iio: amplifiers: ad8366: consume enable gpio for applicable parts
Posted by Rodrigo Alencar via B4 Relay 3 weeks ago
From: Rodrigo Alencar <rodrigo.alencar@analog.com>

Some parts may consume enable GPIO to set serial mode (PS pin) or
powerup the device (e.g. ADA4961's PWUP pin).

Co-developed-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Rodrigo Alencar <rodrigo.alencar@analog.com>
---
 drivers/iio/amplifiers/ad8366.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/iio/amplifiers/ad8366.c b/drivers/iio/amplifiers/ad8366.c
index d06ac786501c..63bb9f0179eb 100644
--- a/drivers/iio/amplifiers/ad8366.c
+++ b/drivers/iio/amplifiers/ad8366.c
@@ -43,6 +43,7 @@ struct ad8366_state {
 	struct regulator	*reg;
 	struct mutex            lock; /* protect sensor state */
 	struct gpio_desc	*reset_gpio;
+	struct gpio_desc	*enable_gpio;
 	unsigned char		ch[2];
 	enum ad8366_type	type;
 	const struct ad8366_info *info;
@@ -281,6 +282,13 @@ static int ad8366_probe(struct spi_device *spi)
 			ret = PTR_ERR(st->reset_gpio);
 			goto error_disable_reg;
 		}
+
+		st->enable_gpio = devm_gpiod_get_optional(&spi->dev, "enable", GPIOD_OUT_HIGH);
+		if (IS_ERR(st->enable_gpio)) {
+			ret = PTR_ERR(st->enable_gpio);
+			goto error_disable_reg;
+		}
+
 		indio_dev->channels = ada4961_channels;
 		indio_dev->num_channels = ARRAY_SIZE(ada4961_channels);
 		break;

-- 
2.43.0
Re: [PATCH 3/7] iio: amplifiers: ad8366: consume enable gpio for applicable parts
Posted by Jonathan Cameron 2 weeks, 3 days ago
On Mon, 19 Jan 2026 14:36:57 +0000
Rodrigo Alencar via B4 Relay <devnull+rodrigo.alencar.analog.com@kernel.org> wrote:

> From: Rodrigo Alencar <rodrigo.alencar@analog.com>
> 
> Some parts may consume enable GPIO to set serial mode (PS pin) or
> powerup the device (e.g. ADA4961's PWUP pin).
> 
> Co-developed-by: Michael Hennerich <michael.hennerich@analog.com>
> Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
> Signed-off-by: Rodrigo Alencar <rodrigo.alencar@analog.com>

The patch series is in a less than ideal order.
Can you pull the cleanup in patches 5 and 6 ahead of this new stuff.

That will reduce churn (and stop me writing a reply on why there is
an error path before I check the rest of your thread - which I just
did!)

Jonathan