Re: [PATCH] mmc: atmel: convert to gpio descriptos

From: Arnd Bergmann
Date: Fri Jan 27 2023 - 05:50:16 EST


On Fri, Jan 27, 2023, at 11:32, Nicolas Ferre wrote:
> Hi Arnd,
>
> On 26/01/2023 at 14:50, Arnd Bergmann wrote:
>> From: Arnd Bergmann <arnd@xxxxxxxx>
>>
>> All Atmel (now Microchip) machines boot using DT, so the
>> old platform_data for this driver is no longer used by any
>> boards.
>>
>> Removing the pdata probe lets us simplify the GPIO handling
>> with the use of the descriptor API.
>
> Thanks for your patch. I would like to know if it's related to the
> initiative started by Bala in this series:
>
> https://lore.kernel.org/all/20221226073908.17317-1-balamanikandan.gunasundar@xxxxxxxxxxxxx/
>
> It's true that it didn't come to a conclusion yet...

I hadn't seen that one, my patch was a somewhat older series to
convert a couple of subsystems over from the old of_get_named_gpio(),
with no special interest in this platform.

It looks like the patches are fairly similar, with two differences
I can see immediately:

- I use the normal devm_gpiod_get_optional(), while Bala uses
the fwnode variant that should not be needed here since the
fwnode is the one for the platform device itself.
- I use the normal gpiod_get_value(), which will handle polarity
as specified in DT, while Bala's patch uses gpiod_get_raw_value().
The difference is what happens when the GPIO_ACTIVE_LOW flag
is set in the DT, and the possible combinations with the
"cd-inverted" flag. I did not test my version, so I assume
Bala is correct here, but it would be good to review this
carefully either way.

Arnd