All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	Andy Shevchenko <andy@kernel.org>,
	Harvey Hunt <harveyhuntnexus@gmail.com>,
	Paul Cercueil <paul@crapouillou.net>,
	Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-mtd@lists.infradead.org, linux-mips@vger.kernel.org,
	Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Subject: Re: [RFT PATCH] mtd: rawnand: ingenic: move the GPIO quirk to gpiolib-of.c
Date: Tue, 26 Sep 2023 11:16:43 +0200	[thread overview]
Message-ID: <20230926111643.58ee4587@xps-13> (raw)
In-Reply-To: <20230926090623.35595-1-brgl@bgdev.pl>

Hi Bartosz,

brgl@bgdev.pl wrote on Tue, 26 Sep 2023 11:06:23 +0200:

> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> 
> We have a special place for OF polarity quirks in gpiolib-of.c. Let's
> move this over there so that it doesn't pollute the driver.
> 
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> ---
> This is an alternative to the previous patch that instead of replacing
> one active-low setter with another, just moves the quirk over to
> gpiolib-of.c
> 
>  drivers/gpio/gpiolib-of.c                       |  9 +++++++++
>  drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c | 12 ------------
>  2 files changed, 9 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
> index 5515f32cf19b..58c0bbe9d569 100644
> --- a/drivers/gpio/gpiolib-of.c
> +++ b/drivers/gpio/gpiolib-of.c
> @@ -192,6 +192,15 @@ static void of_gpio_try_fixup_polarity(const struct device_node *np,
>  		 */
>  		{ "himax,hx8357",	"gpios-reset",	false },
>  		{ "himax,hx8369",	"gpios-reset",	false },
> +		/*
> +		 * The rb-gpios semantics was undocumented and qi,lb60 (along with
> +		 * the ingenic driver) got it wrong. The active state encodes the
> +		 * NAND ready state, which is high level. Since there's no signal
> +		 * inverter on this board, it should be active-high. Let's fix that
> +		 * here for older DTs so we can re-use the generic nand_gpio_waitrdy()
> +		 * helper, and be consistent with what other drivers do.
> +		 */
> +		{ "qi,lb60",		"rb-gpios",	true },

I didn't know about such a list, interesting. Better be aware when
debugging :)

IIRC Linus was fine, so if Paul also agrees I guess this is better
taking through the gpio tree? I don't have any ingenic related changes
queued right now so feel free to take it.

Acked-by: Miquel Raynal <miquel.raynal@bootlin.com>

Thanks,
Miquèl

WARNING: multiple messages have this Message-ID (diff)
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	Andy Shevchenko <andy@kernel.org>,
	Harvey Hunt <harveyhuntnexus@gmail.com>,
	Paul Cercueil <paul@crapouillou.net>,
	Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-mtd@lists.infradead.org, linux-mips@vger.kernel.org,
	Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Subject: Re: [RFT PATCH] mtd: rawnand: ingenic: move the GPIO quirk to gpiolib-of.c
Date: Tue, 26 Sep 2023 11:16:43 +0200	[thread overview]
Message-ID: <20230926111643.58ee4587@xps-13> (raw)
In-Reply-To: <20230926090623.35595-1-brgl@bgdev.pl>

Hi Bartosz,

brgl@bgdev.pl wrote on Tue, 26 Sep 2023 11:06:23 +0200:

> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> 
> We have a special place for OF polarity quirks in gpiolib-of.c. Let's
> move this over there so that it doesn't pollute the driver.
> 
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> ---
> This is an alternative to the previous patch that instead of replacing
> one active-low setter with another, just moves the quirk over to
> gpiolib-of.c
> 
>  drivers/gpio/gpiolib-of.c                       |  9 +++++++++
>  drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c | 12 ------------
>  2 files changed, 9 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
> index 5515f32cf19b..58c0bbe9d569 100644
> --- a/drivers/gpio/gpiolib-of.c
> +++ b/drivers/gpio/gpiolib-of.c
> @@ -192,6 +192,15 @@ static void of_gpio_try_fixup_polarity(const struct device_node *np,
>  		 */
>  		{ "himax,hx8357",	"gpios-reset",	false },
>  		{ "himax,hx8369",	"gpios-reset",	false },
> +		/*
> +		 * The rb-gpios semantics was undocumented and qi,lb60 (along with
> +		 * the ingenic driver) got it wrong. The active state encodes the
> +		 * NAND ready state, which is high level. Since there's no signal
> +		 * inverter on this board, it should be active-high. Let's fix that
> +		 * here for older DTs so we can re-use the generic nand_gpio_waitrdy()
> +		 * helper, and be consistent with what other drivers do.
> +		 */
> +		{ "qi,lb60",		"rb-gpios",	true },

I didn't know about such a list, interesting. Better be aware when
debugging :)

IIRC Linus was fine, so if Paul also agrees I guess this is better
taking through the gpio tree? I don't have any ingenic related changes
queued right now so feel free to take it.

Acked-by: Miquel Raynal <miquel.raynal@bootlin.com>

Thanks,
Miquèl

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  parent reply	other threads:[~2023-09-26  9:16 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-26  9:06 [RFT PATCH] mtd: rawnand: ingenic: move the GPIO quirk to gpiolib-of.c Bartosz Golaszewski
2023-09-26  9:06 ` Bartosz Golaszewski
2023-09-26  9:11 ` Linus Walleij
2023-09-26  9:11   ` Linus Walleij
2023-09-26  9:16 ` Miquel Raynal [this message]
2023-09-26  9:16   ` Miquel Raynal
2023-09-26  9:26   ` Paul Cercueil
2023-09-26  9:26     ` Paul Cercueil
2023-09-26 11:58 ` Andy Shevchenko
2023-09-26 11:58   ` Andy Shevchenko
2023-09-27 11:15 ` Bartosz Golaszewski
2023-09-27 11:15   ` Bartosz Golaszewski

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=20230926111643.58ee4587@xps-13 \
    --to=miquel.raynal@bootlin.com \
    --cc=andy@kernel.org \
    --cc=bartosz.golaszewski@linaro.org \
    --cc=brgl@bgdev.pl \
    --cc=harveyhuntnexus@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=paul@crapouillou.net \
    --cc=richard@nod.at \
    --cc=vigneshr@ti.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.