[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMRc=MfJuT8q1jRMeSJQaE9aQGQFpph4O9TrE6xircqi3v5FgQ@mail.gmail.com>
Date: Tue, 20 May 2025 19:06:49 +0200
From: Bartosz Golaszewski <brgl@...ev.pl>
To: Marcelo Schmitt <marcelo.schmitt@...log.com>
Cc: linux-iio@...r.kernel.org, devicetree@...r.kernel.org,
linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org, jic23@...nel.org,
lars@...afoo.de, Michael.Hennerich@...log.com, dlechner@...libre.com,
nuno.sa@...log.com, andy@...nel.org, robh@...nel.org, krzk+dt@...nel.org,
conor+dt@...nel.org, linus.walleij@...aro.org, marcelo.schmitt1@...il.com
Subject: Re: [PATCH v3 08/10] iio: adc: ad4170: Add GPIO controller support
On Tue, May 13, 2025 at 2:36 PM Marcelo Schmitt
<marcelo.schmitt@...log.com> wrote:
>
> The AD4170 has four multifunctional pins that can be used as GPIOs. The
> GPIO functionality can be accessed when the AD4170 chip is not busy
> performing continuous data capture or handling any other register
> read/write request. Also, the AD4170 does not provide any interrupt based
> on GPIO pin states so AD4170 GPIOs can't be used as interrupt sources.
>
> Implement gpio_chip callbacks to make AD4170 GPIO pins controllable through
> the gpiochip interface.
>
> Signed-off-by: Marcelo Schmitt <marcelo.schmitt@...log.com>
> ---
> Change log v2 -> v3
> - Defined masks for updating GPIO mode register.
> - Replaced regmap_clear/set_bits() by regmap_update_bits() to set GPIO direction.
> - Removed GPIO direction check before setting GPIO output values.
> - Made use of regmap_assign_bits() to set GPIO output reg bits.
> - Made value to be set as GPIO output state be either 0 or 1.
> - No longer locking on state mutex on GPIO set since GPIO output should not
> conflict with other direct mode functionality (e.g. single-shot read).
>
> drivers/iio/adc/Kconfig | 1 +
> drivers/iio/adc/ad4170.c | 224 ++++++++++++++++++++++++++++++++++++++-
> 2 files changed, 224 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig
> index 6e4b14243599..a328f03eea34 100644
> --- a/drivers/iio/adc/Kconfig
> +++ b/drivers/iio/adc/Kconfig
> @@ -78,6 +78,7 @@ config AD4170
> select IIO_BUFFER
> select IIO_TRIGGERED_BUFFER
> depends on COMMON_CLK
> + select GPIOLIB
In general GPIOLIB should be depended on, not selected.
The rest looks good to me so with that:
Acked-by: Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
Powered by blists - more mailing lists