mmc: dt: Add 'broken-cd' DT binding

Message ID 87vcgc5wfn.fsf@octavius.laptop.org
State New
Headers show

Commit Message

Chris Ball Aug. 21, 2012, 11:14 a.m.
Hi,

On Tue, Aug 21 2012, Arnd Bergmann wrote:
> On Tuesday 21 August 2012, Thomas Abraham wrote:
>> diff --git a/Documentation/devicetree/bindings/mmc/mmc.txt
>> b/Documentation/devicetree/bindings/mmc/mmc.txt
>> index 8a6811f..1aa527a 100644
>> --- a/Documentation/devicetree/bindings/mmc/mmc.txt
>> +++ b/Documentation/devicetree/bindings/mmc/mmc.txt
>> @@ -16,6 +16,8 @@ Optional properties:
>>  - wp-inverted: when present, polarity on the wp gpio line is inverted
>>  - non-removable: non-removable slot (like eMMC)
>>  - max-frequency: maximum operating clock frequency
>> +- broken-cd: when present, indicates that the cd-gpios line is not
>> +       connected to the card-detect pad of the MMC host controller.
>
> What is the difference between listing the cd line as broken and
> listing no cd line at all?

I think the documentation's incorrect here -- "broken-cd" should be used
without a cd-gpios node, and tells the driver that there is no working
WP and we'll need to poll the host (SDHCI_QUIRK_BROKEN_CARD_DETECTION):


So, I'd say:

"- broken-cd: when present, indicates that there is no card-detect
   line available on the host; polling should be used instead."

Thanks,

- Chris.

Patch

diff --git a/drivers/mmc/host/sdhci-pxav3.c b/drivers/mmc/host/sdhci-pxav3.c
index 25733ef..23ebdbb 100644
--- a/drivers/mmc/host/sdhci-pxav3.c
+++ b/drivers/mmc/host/sdhci-pxav3.c
@@ -198,6 +198,9 @@  static struct sdhci_pxa_platdata *pxav3_get_mmc_pdata(struct device *dev)
 	if (clk_delay_cycles > 0)
 		pdata->clk_delay_cycles = clk_delay_cycles;
 
+	if (of_find_property(np, "broken-cd", NULL))
+		pdata->quirks |= SDHCI_QUIRK_BROKEN_CARD_DETECTION;
+
 	return pdata;
 }
 #else