[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAPDyKFqRF=X755_H9418i1WZ4W-PxMwkzFnkcRco9mmycYHiPw@mail.gmail.com>
Date: Mon, 2 Jan 2023 16:07:06 +0100
From: Ulf Hansson <ulf.hansson@...aro.org>
To: Balamanikandan Gunasundar
<balamanikandan.gunasundar@...rochip.com>,
Linus Walleij <linus.walleij@...aro.org>
Cc: ludovic.desroches@...rochip.com, nicolas.ferre@...rochip.com,
alexandre.belloni@...tlin.com, linux-kernel@...r.kernel.org,
linux-mmc@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
hari.prasathge@...rochip.com, dmitry.torokhov@...il.com
Subject: Re: [PATCH v3 1/2] mmc: atmel-mci: Convert to gpio descriptors
On Thu, 29 Dec 2022 at 01:23, Linus Walleij <linus.walleij@...aro.org> wrote:
>
> Hi Balamanikandan,
>
> thanks for your patch!
>
> On Mon, Dec 26, 2022 at 8:39 AM Balamanikandan Gunasundar
> <balamanikandan.gunasundar@...rochip.com> wrote:
>
> > Replace the legacy GPIO APIs with gpio descriptor consumer interface.
> >
> > To maintain backward compatibility, we rely on the "cd-inverted"
> > property to manage the invertion flag instead of GPIO property.
> >
> > Signed-off-by: Balamanikandan Gunasundar <balamanikandan.gunasundar@...rochip.com>
>
> Overall this looks really nice! I thought about converting this driver
> but was a bit afraid of doing mistakes since it was a bit elaborate.
> Nice that you use fwnode accessors!
>
> Acked-by: Linus Walleij <linus.walleij@...aro.org>
Linus, thanks for helping out by reviewing this!
>
> Improvement to consider (can also be a separate patch):
I tried to apply the $subject patch as is, but it failed. It needs to
be rebased on top of my latest next branch. Please re-spin and if
possible, consider incorporating Linus's suggestions too as part of
the series.
Kind regards
Uffe
>
> > + if (slot->detect_pin) {
> > + present = !(gpiod_get_raw_value(slot->detect_pin) ^
> > slot->detect_is_active_high);
>
> Normally we contain all this active low/high mess in mmc_of_parse(),
> but I guess this doesn't work here because the of node is different
> from the device :P
>
> Since the code says *explicitly* "active high" not "inverted" as the
> core code parses it, could you try just push this to gpiolib like
> we usually do, by deleting the detect_is_active_high stuff and
> just apply a patch like this?
>
> diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
> index 4fff7258ee41..5979c9a75cf9 100644
> --- a/drivers/gpio/gpiolib-of.c
> +++ b/drivers/gpio/gpiolib-of.c
> @@ -199,7 +199,9 @@ static void of_gpio_set_polarity_by_property(const
> struct device_node *np,
> { "fsl,imx8mm-pcie", "reset-gpio", "reset-gpio-active-high" },
> { "fsl,imx8mp-pcie", "reset-gpio", "reset-gpio-active-high" },
> #endif
> -
> +#if IS_ENABLED(CONFIG_MMC_ATMELMCI)
> + { "atmel,hsmci", "cd-gpios", "cd-inverted" },
> +#endif
> /*
> * The regulator GPIO handles are specified such that the
> * presence or absence of "enable-active-high" solely controls
>
> (It's fine to include in your MMC patch if some GPIO maintainer like
> me ACK it.)
>
> Yours,
> Linus Walleij
Powered by blists - more mailing lists