Devicetree
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: "Nuno Sá" <nuno.sa@analog.com>
Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org,
	Michael Hennerich <Michael.Hennerich@analog.com>,
	David Lechner <dlechner@baylibre.com>,
	Andy Shevchenko <andy@kernel.org>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>, Arnd Bergmann <arnd@arndb.de>,
	linux@analog.com
Subject: Re: [PATCH 04/16] iio: frequency: ad9523: fix GPIO polarity handling
Date: Sat, 5 Dec 2026 22:50:14 +0000	[thread overview]
Message-ID: <20261205225014.4b5a210a@jic23-hlaptop> (raw)
In-Reply-To: <20261130-iio-ad9523-fw-v1-4-9aee15b7a7a2@analog.com>

On Mon, 30 Nov 2026 17:37:02 +0000
Nuno Sá <nuno.sa@analog.com> wrote:

> The PD, RESET and SYNC pins are all active low, but the driver handles
> the GPIOs as if they were active high: it drives powerdown and sync
> high to keep the device running, and drives reset low and then high to
> reset it. This only works if the GPIOs are described as active high,
> which is the opposite of what the hardware does.
> 
> Use logical values instead, so that the GPIOs can be described with
> their real polarity: keep powerdown and sync de-asserted, and assert
> reset before de-asserting it again.
> 
> There are no in-tree users of this driver, so nothing relies on the
> inverted logic. Out of tree users need to flag the GPIOs as active low.
> 
> Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Hi Nuno,

This is a slightly odd one.  You've called it 'fix' but then not
added a fixes tag.  I'd add a tiny bit to the patch description to say why.
+ if you really don't want it backported, remove the word fix from the patch
title.

Thanks

Jonathan

> ---
>  drivers/iio/frequency/ad9523.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/iio/frequency/ad9523.c b/drivers/iio/frequency/ad9523.c
> index e6913ef36fb0..92bbe4d196b5 100644
> --- a/drivers/iio/frequency/ad9523.c
> +++ b/drivers/iio/frequency/ad9523.c
> @@ -982,22 +982,22 @@ static int ad9523_probe(struct spi_device *spi)
>  		return ret;
>  
>  	st->pwrdown_gpio = devm_gpiod_get_optional(dev, "powerdown",
> -		GPIOD_OUT_HIGH);
> +						   GPIOD_OUT_LOW);
>  	if (IS_ERR(st->pwrdown_gpio))
>  		return PTR_ERR(st->pwrdown_gpio);
>  
>  	st->reset_gpio = devm_gpiod_get_optional(dev, "reset",
> -		GPIOD_OUT_LOW);
> +						 GPIOD_OUT_HIGH);
>  	if (IS_ERR(st->reset_gpio))
>  		return PTR_ERR(st->reset_gpio);
>  
>  	if (st->reset_gpio) {
>  		udelay(1);
> -		gpiod_direction_output(st->reset_gpio, 1);
> +		gpiod_set_value_cansleep(st->reset_gpio, 0);
>  	}
>  
>  	st->sync_gpio = devm_gpiod_get_optional(dev, "sync",
> -		GPIOD_OUT_HIGH);
> +						GPIOD_OUT_LOW);
>  	if (IS_ERR(st->sync_gpio))
>  		return PTR_ERR(st->sync_gpio);
>  
> 


  parent reply	other threads:[~2026-12-05 22:50 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30 17:36 [PATCH 00/16] iio: frequency: ad9523: add firmware support Nuno Sá
2026-11-30 17:36 ` [PATCH 01/16] iio: frequency: ad9523: fix out of bounds access of vco_out_map Nuno Sá
2026-11-30 17:37 ` [PATCH 02/16] iio: frequency: ad9523: don't select a powered down M2 divider Nuno Sá
2026-11-30 17:37 ` [PATCH 03/16] iio: frequency: ad9523: fix the M2 divider selection Nuno Sá
2026-12-03 12:16   ` Andy Shevchenko
2026-11-30 17:37 ` [PATCH 04/16] iio: frequency: ad9523: fix GPIO polarity handling Nuno Sá
2026-11-30 17:44   ` sashiko-bot
2026-12-05 22:50   ` Jonathan Cameron [this message]
2026-11-30 17:37 ` [PATCH 05/16] iio: frequency: ad9523: factor out the channel divider calculation Nuno Sá
2026-12-03 12:18   ` Andy Shevchenko
2026-11-30 17:37 ` [PATCH 06/16] MAINTAINERS: add an entry for the AD9523 driver Nuno Sá
2026-11-30 17:37 ` [PATCH 07/16] iio: frequency: ad9523: move the platform data into the driver Nuno Sá
2026-12-03 12:19   ` Andy Shevchenko
2026-11-30 17:37 ` [PATCH 08/16] iio: frequency: ad9523: rename the platform data to config Nuno Sá
2026-12-03 12:20   ` Andy Shevchenko
2026-11-30 17:37 ` [PATCH 09/16] iio: frequency: ad9523: always bypass PLL1 Nuno Sá
2026-12-03 12:21   ` Andy Shevchenko
2026-11-30 17:37 ` [PATCH 10/16] iio: frequency: ad9523: drop unused channel options Nuno Sá
2026-11-30 17:37 ` [PATCH 11/16] iio: frequency: ad9523: use read_label() for channel names Nuno Sá
2026-11-30 17:37 ` [PATCH 12/16] dt-bindings: iio: frequency: Add AD9523-1 Nuno Sá
2026-11-30 18:50   ` Conor Dooley
2026-12-02 11:29     ` Nuno Sá
2026-12-02 18:17       ` Conor Dooley
2026-12-03  9:37         ` Nuno Sá
2026-11-30 17:37 ` [PATCH 13/16] iio: frequency: ad9523: add firmware support and drop platform data Nuno Sá
2026-12-05 23:09   ` Jonathan Cameron
2026-11-30 17:37 ` [PATCH 14/16] iio: frequency: ad9523: sync the dividers at the end of probe Nuno Sá
2026-11-30 17:54   ` sashiko-bot
2026-12-05 23:10   ` Jonathan Cameron
2026-11-30 17:37 ` [PATCH 15/16] iio: frequency: ad9523: split the clock source selection Nuno Sá
2026-11-30 17:37 ` [PATCH 16/16] iio: frequency: ad9523: add clock provider support Nuno Sá

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261205225014.4b5a210a@jic23-hlaptop \
    --to=jic23@kernel.org \
    --cc=Michael.Hennerich@analog.com \
    --cc=andy@kernel.org \
    --cc=arnd@arndb.de \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@analog.com \
    --cc=nuno.sa@analog.com \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox