Hello Linus,

On Tue, Sep 30, 2014 at 4:05 PM, Linus Walleij <[email protected]> wrote:
> commit 98e90de99a0c43bd434da814c882c4332441871e
> "mmc: host: switch OF parser to use gpio descriptors"
> switched the semantic behaviour of card detect and read
> only flags such that the inversion capability flag would
> only be set if inversion was explicitly specified in the
> device tree, in the hopes that no-one was using double
> inversion.
>
> It turns out that the XOR:ing between the explicit
> inversion was indeed in use, so we need to restore the
> old semantics where both ways of inversion are checked
> and the end result XOR:ed.
>
> Reported-by: Javier Martinez Canillas <[email protected]>
> Signed-off-by: Linus Walleij <[email protected]>

Thanks a lot for the quick patch. It makes the card detection work
again but needs two subtle changes to have the same semantics than
before.

> -               ret = mmc_gpiod_request_cd(host, "cd", 0, false, 0);
> +               ret = mmc_gpiod_request_cd(host, "cd", 0, false,
> +                                          0, &gpio_invert);

As mentioned in the other thread, the old code uses
mmc_gpio_request_cd() which always sets override_active_level to true
so this should be:

ret = mmc_gpiod_request_cd(host, "cd", 0, true, 0, &gpio_invert);

> @@ -316,6 +317,8 @@ int mmc_gpiod_request_cd(struct mmc_host *host, const 
> char *con_id,
>                         return ret;
>         }
>
> +       *gpio_invert = gpiod_is_active_low(desc);
> +

The old code set gpio_inv_cd if (!(flags & OF_GPIO_ACTIVE_LOW)) so the
above should be:

*gpio_invert = !gpiod_is_active_low(desc);

And the same applies to the gpio_invert assignment in
mmc_gpiod_request_ro(). With these two changes:

Tested-by: Javier Martinez Canillas <[email protected]>

Best regards,
Javier
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to