Re: [PATCH 08/10] mmc: pxa: Use the slot GPIO descriptor

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

 



On Tue, Nov 13, 2018 at 9:24 AM Robert Jarzmik <robert.jarzmik@xxxxxxx> wrote:

> I'd like some improvement here and there. Let's tackle first the generic parts :
>  - patch split
>    I'd like the mach-pxa part to be in a separate patch. Looking at your patch,
>    that probably means, if I'm right, a split in 4 patches :
>      1) Add the GPIO_LOOKUP entries
>      2) Add the pxamci part to use GPIO tables
>      3) Remove the platform_data in mach-pxa
>      4) Remove the dead code from pxamci
>    That will enable easier "Fixes:" tags, and easier maintainance for me and
>    Ulf, as the fixes will go either on a patch for his tree or mine, so neither
>    of use will have to bother with other conflicts.

OK usually when I do these manufacturings I take quite big
steps mainly because I do not see that the above will help
bisectability of anything breaks: all possible regressions
will be in patch (2) and all fixes will be to that patch as well
(unless purely syntactic issues).

But I'm happy to do it any way the PXA maintainers like it,
so sure!

>  - GPIO tables
>    Don't use number, only defines.

OK.

>  - the zylonite specific case
>    This is the real showstopper here, which could block this conversion and
>    deserves your full brain power :)
>    I already had attempted this conversion in the past, and came to a limitation
>    in the GPIO_LOOKUP model. The problem is that there are 2 gpio expanders (see
>    zylonite_pxa300.c), struct zylonite_i2c_board_info[].
>    Therefore, the GPIO_LOOKUP is not088413bc0bd5f5fb66ca22a19d66a49d7154ba4c guaranteed AFAIK to check the correct
>    expander to get the gpio ... That problem is a good one for the GPIO
>    maintainer :)

This is no big deal usually, see e.g. commit
088413bc0bd5f5fb66ca22a19d66a49d7154ba4c

The GPIOs are looked up to the gpio_chip .label field,
this is not an ABI or anything so all we need to do is make
sure that this label is unique for each GPIO expander.
pca9539 probes drivers/gpio/gpio-pca953x.c
and as you can see label is set from the i2c client
name. This is bad practice, let's just patch it to use
the dev_name on the I2C struct device* instead.

That makes things very easy since I2C board data has
a way of naming I2C devices using .dev_name.
If you set .dev_name to "expander-a" on the first
instance, and "expander-b" on the second instance,
the gpiochip labels will be "i2c-expander-a" and
"i2c-expander-b" as you can see in drivers/i2c/i2c-core-base.c

I'll send a patch.

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