Re: [PATCH v3 1/2] mmc: atmel-mci: Convert to gpio descriptors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 29 Dec 2022 at 01:23, Linus Walleij <linus.walleij@xxxxxxxxxx> wrote:
>
> Hi Balamanikandan,
>
> thanks for your patch!
>
> On Mon, Dec 26, 2022 at 8:39 AM Balamanikandan Gunasundar
> <balamanikandan.gunasundar@xxxxxxxxxxxxx> 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@xxxxxxxxxxxxx>
>
> 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@xxxxxxxxxx>

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



[Index of Archives]     [Linux Memonry Technology]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux