On 4 June 2015 at 11:56, Lu Y.B. <[email protected]> wrote:
> Pls see my comments below.
>
>> -----Original Message-----
>> From: Ulf Hansson [mailto:[email protected]]
>> Sent: Thursday, June 04, 2015 3:51 PM
>> To: Lu Yangbo-B47093
>> Cc: linux-mmc; Chris Ball
>> Subject: Re: [PATCH 2/2] mmc: esdhc: add quirk to support 3.3v for T4240
>>
>> On 2 June 2015 at 09:09, Yangbo Lu <[email protected]> wrote:
>> > Add SDHCI_QUIRK2_CIRCUIT_SUPPORT_VS33 for T4240
>> >
>> > Signed-off-by: Yangbo Lu <[email protected]>
>> > ---
>> >  drivers/mmc/host/sdhci-of-esdhc.c | 3 +++
>> >  1 file changed, 3 insertions(+)
>> >
>> > diff --git a/drivers/mmc/host/sdhci-of-esdhc.c
>> b/drivers/mmc/host/sdhci-of-esdhc.c
>> > index 22e9111..4f5fe42 100644
>> > --- a/drivers/mmc/host/sdhci-of-esdhc.c
>> > +++ b/drivers/mmc/host/sdhci-of-esdhc.c
>> > @@ -369,6 +369,9 @@ static int sdhci_esdhc_probe(struct platform_device
>> *pdev)
>> >                 host->quirks2 |= SDHCI_QUIRK2_BROKEN_HOST_CONTROL;
>> >         }
>> >
>> > +       if (of_device_is_compatible(np, "fsl,t4240-esdhc"))
>> > +               host->quirks2 |= SDHCI_QUIRK2_CIRCUIT_SUPPORT_VS33;
>> > +
>>
>> Instead of checking the compatible, could you check the "ocr_avail"
>> mask which mmc_of_parse() create from the vmmc regulator?
>
> It could get ocr_mask value supporting 3.3v from dts, and get ocr_avail not 
> supporting 3.3v from capability register.
> But in sdhci.c, the ocr_avail will "&" the ocr_mask value, this makes 3.3v 
> supporting bit cleaned.
>
> if (host->ocr_mask)
>         ocr_avail &= host->ocr_mask;

I have to admit that this looks a bit odd...

Anyway, as long as you don't specify the "host->ocr_mask" the above
"if" will not change the ocr_avail mask.

Looking a bit further up in the code in sdhci_add_host(), you will
find that the ocr_avail mask is created by calling
mmc_regulator_get_supply() (and not mmc_of_parse() as told you
before). If there are external regulators, the ocr_avail mask will
then override the values from SDHCI's caps register.

Anyway, as this patch seems to intended fixing something related to
the IO voltage, it all looks wrong.

[...]

Kind regards
Uffe
--
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