diff mbox

mmc: dt: Add property for broken hs200 quirk

Message ID 1418412516-10682-1-git-send-email-bjorn.andersson@sonymobile.com
State New, archived
Headers show

Commit Message

Bjorn Andersson Dec. 12, 2014, 7:28 p.m. UTC
Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
---
 Documentation/devicetree/bindings/mmc/mmc.txt | 2 ++
 drivers/mmc/host/sdhci-pltfm.c                | 3 +++
 2 files changed, 5 insertions(+)

Comments

Ulf Hansson Dec. 19, 2014, 11:38 a.m. UTC | #1
On 12 December 2014 at 20:28, Bjorn Andersson
<bjorn.andersson@sonymobile.com> wrote:

Some more explanation to why this needed would be good.

> Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
> ---
>  Documentation/devicetree/bindings/mmc/mmc.txt | 2 ++

This file lists the generic mmc DT bindings, but you want to add a
specific binding for sdhci?

>  drivers/mmc/host/sdhci-pltfm.c                | 3 +++
>  2 files changed, 5 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/mmc/mmc.txt b/Documentation/devicetree/bindings/mmc/mmc.txt
> index b52628b..04f80ef 100644
> --- a/Documentation/devicetree/bindings/mmc/mmc.txt
> +++ b/Documentation/devicetree/bindings/mmc/mmc.txt
> @@ -22,6 +22,8 @@ Optional properties:
>  - wp-inverted: when present, polarity on the WP line is inverted. See the note
>    below for the case, when a GPIO is used for the WP line
>  - max-frequency: maximum operating clock frequency
> +- broken-hs200: when present, denotes that eMMC HS200 modes are not supported on
> +  this system, even if the controller claims it is.
>  - no-1-8-v: when present, denotes that 1.8v card voltage is not supported on
>    this system, even if the controller claims it is.
>  - cap-sd-highspeed: SD high-speed timing is supported
> diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c
> index c5b01d6..570837f 100644
> --- a/drivers/mmc/host/sdhci-pltfm.c
> +++ b/drivers/mmc/host/sdhci-pltfm.c
> @@ -90,6 +90,9 @@ void sdhci_get_of_property(struct platform_device *pdev)
>                 if (of_get_property(np, "broken-cd", NULL))
>                         host->quirks |= SDHCI_QUIRK_BROKEN_CARD_DETECTION;
>
> +               if (of_get_property(np, "broken-hs200", NULL))
> +                       host->quirks2 |= SDHCI_QUIRK2_BROKEN_HS200;
> +
>                 if (of_get_property(np, "no-1-8-v", NULL))
>                         host->quirks2 |= SDHCI_QUIRK2_NO_1_8_V;
>
> --
> 1.8.2.2
>

Kind regards
Uffe
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Bjorn Andersson Dec. 19, 2014, 8:01 p.m. UTC | #2
On Fri, Dec 19, 2014 at 3:38 AM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> On 12 December 2014 at 20:28, Bjorn Andersson
> <bjorn.andersson@sonymobile.com> wrote:
>
> Some more explanation to why this needed would be good.
>

Because (according to the git log) some of the memories that we
mounted in Xperia Z1 does not support HS200 even though they advertise
they are.

I thought we needed for the device I'm testing with, but a couple of
regulator_set_optimum_mode() solved that - so I have to provide a
patch for that as well...

>> Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
>> ---
>>  Documentation/devicetree/bindings/mmc/mmc.txt | 2 ++
>
> This file lists the generic mmc DT bindings, but you want to add a
> specific binding for sdhci?
>

Looking in sdhci_get_of_property() it's a mash of device specific
properties, sdhci specific properties documented in mmc.txt and
generic sdhci properties documented in device specific bindings.

Would you like me to move it to a generic sdhci.txt binding and update
the individual sdhci-* to reference that instead of mmc.txt? Or should
I just add the property in the device specific bindings? Or maybe we
could keep it as a optional property in mmc.txt?

Regards,
Bjorn
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ulf Hansson Dec. 22, 2014, 10:04 a.m. UTC | #3
On 19 December 2014 at 21:01, Bjorn Andersson <bjorn@kryo.se> wrote:
> On Fri, Dec 19, 2014 at 3:38 AM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
>> On 12 December 2014 at 20:28, Bjorn Andersson
>> <bjorn.andersson@sonymobile.com> wrote:
>>
>> Some more explanation to why this needed would be good.
>>
>
> Because (according to the git log) some of the memories that we
> mounted in Xperia Z1 does not support HS200 even though they advertise
> they are.

I see. How about using an mmc card quirk instead of a DT binding then?

Kind regards
Uffe

>
> I thought we needed for the device I'm testing with, but a couple of
> regulator_set_optimum_mode() solved that - so I have to provide a
> patch for that as well...
>
>>> Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
>>> ---
>>>  Documentation/devicetree/bindings/mmc/mmc.txt | 2 ++
>>
>> This file lists the generic mmc DT bindings, but you want to add a
>> specific binding for sdhci?
>>
>
> Looking in sdhci_get_of_property() it's a mash of device specific
> properties, sdhci specific properties documented in mmc.txt and
> generic sdhci properties documented in device specific bindings.
>
> Would you like me to move it to a generic sdhci.txt binding and update
> the individual sdhci-* to reference that instead of mmc.txt? Or should
> I just add the property in the device specific bindings? Or maybe we
> could keep it as a optional property in mmc.txt?
>
> Regards,
> Bjorn
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Bjorn Andersson Dec. 29, 2014, 10:37 p.m. UTC | #4
On Mon 22 Dec 02:04 PST 2014, Ulf Hansson wrote:

> On 19 December 2014 at 21:01, Bjorn Andersson <bjorn@kryo.se> wrote:
> > On Fri, Dec 19, 2014 at 3:38 AM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> >> On 12 December 2014 at 20:28, Bjorn Andersson
> >> <bjorn.andersson@sonymobile.com> wrote:
> >>
> >> Some more explanation to why this needed would be good.
> >>
> >
> > Because (according to the git log) some of the memories that we
> > mounted in Xperia Z1 does not support HS200 even though they advertise
> > they are.
> 
> I see. How about using an mmc card quirk instead of a DT binding then?
> 

I've missed the fact that you can have card specific quirks as well, that looks
more sound than having to specify it separately in dt.

Let's drop this and I'll see if I can find some details about what memory this
might have been so I can add such a quirk. If I can find the information I'll
give it a try and send you a new patch.

Regards,
Bjorn
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/mmc/mmc.txt b/Documentation/devicetree/bindings/mmc/mmc.txt
index b52628b..04f80ef 100644
--- a/Documentation/devicetree/bindings/mmc/mmc.txt
+++ b/Documentation/devicetree/bindings/mmc/mmc.txt
@@ -22,6 +22,8 @@  Optional properties:
 - wp-inverted: when present, polarity on the WP line is inverted. See the note
   below for the case, when a GPIO is used for the WP line
 - max-frequency: maximum operating clock frequency
+- broken-hs200: when present, denotes that eMMC HS200 modes are not supported on
+  this system, even if the controller claims it is.
 - no-1-8-v: when present, denotes that 1.8v card voltage is not supported on
   this system, even if the controller claims it is.
 - cap-sd-highspeed: SD high-speed timing is supported
diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c
index c5b01d6..570837f 100644
--- a/drivers/mmc/host/sdhci-pltfm.c
+++ b/drivers/mmc/host/sdhci-pltfm.c
@@ -90,6 +90,9 @@  void sdhci_get_of_property(struct platform_device *pdev)
 		if (of_get_property(np, "broken-cd", NULL))
 			host->quirks |= SDHCI_QUIRK_BROKEN_CARD_DETECTION;
 
+		if (of_get_property(np, "broken-hs200", NULL))
+			host->quirks2 |= SDHCI_QUIRK2_BROKEN_HS200;
+
 		if (of_get_property(np, "no-1-8-v", NULL))
 			host->quirks2 |= SDHCI_QUIRK2_NO_1_8_V;