Skip to contentSkip to conversation

mmc: sdhci-pxav3: dt: Support "broken-cd"/"wp-inverted" properties

PATCH In review Chris Ball 3 participants 5 messages Sep 9, 2012 – Sep 20, 2012

Subsystems (2)
lore
Share & tools
lore

Chris Ball

author
#0 lore raw

PATCH 1/1 mmc: sdhci-pxav3: dt: Support "broken-cd"/"wp-inverted" properties

---
 drivers/mmc/host/sdhci-pxav3.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/mmc/host/sdhci-pxav3.c +6 -0
index a553b18..8a9b367 100644
@@ -198,6 +198,12 @@ 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;
+
+	if (of_find_property(np, "wp-inverted", NULL))
+		pdata->quirks |= SDHCI_QUIRK_INVERTED_WRITE_PROTECT;
+
 	return pdata;
 }
 #else
Signature · 2 lines
Chris Ball   <[email protected]>   <http://printf.net/>
One Laptop Per Child
Acked-by on v1 1/1
#1 lore raw
Quoted 23 lines · Chris Ball
---
 drivers/mmc/host/sdhci-pxav3.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/mmc/host/sdhci-pxav3.c +6 -1
index a553b18..8a9b367 100644
@@ -198,6 +198,12 @@ 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;
+
+       if (of_find_property(np, "wp-inverted", NULL))
+               pdata->quirks |= SDHCI_QUIRK_INVERTED_WRITE_PROTECT;
+
        return pdata;
 }
 #else
--
Quoted 2 lines

Chris Ball <[email protected]> <http://printf.net/>
One Laptop Per Child

author
#2 lore raw

Hi,

Quoted 14 lines · Haojian Zhuang
Quoted 13 lines · Chris Ball
---
 drivers/mmc/host/sdhci-pxav3.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/mmc/host/sdhci-pxav3.c +0 -0
index a553b18..8a9b367 100644
@@ -198,6 +198,12 @@ static struct sdhci_pxa_platdata *pxav3_get_mmc_pdata(struct device *dev)
        if (clk_delay_cycles > 0)
                pdata->clk_delay_cycles = clk_delay_cycles;
 
Quoted 11 lines

drivers/mmc/host/sdhci-pxav3.c static struct sdhci_pxa_platdata *pxav3_get_mmc_pdata(struct device *dev) · line 209

Quoted 9 lines
drivers/mmc/host/sdhci-pxav3.c +6 -0
+       if (of_find_property(np, "broken-cd", NULL))
+               pdata->quirks |= SDHCI_QUIRK_BROKEN_CARD_DETECTION;
+
+       if (of_find_property(np, "wp-inverted", NULL))
+               pdata->quirks |= SDHCI_QUIRK_INVERTED_WRITE_PROTECT;
+
        return pdata;
 }
 #else

Thanks, pushed to mmc-next for 3.7.

- Chris.

Signature · 2 lines
Chris Ball   <[email protected]>   <http://printf.net/>
One Laptop Per Child
author
#3 lore raw

PATCH 1/1 mmc: sdhci-pxav3: Use sdhci_get_of_property for parsing DT quirks

In particular, this is done to gain support for broken-cd and wp-inverted.

---
(A previously submitted patch of mine added broken-cd support to sdhci-pxav3 directly; I think it's a better idea to discard that patch and use this one instead.)

 drivers/mmc/host/sdhci-pxav3.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/mmc/host/sdhci-pxav3.c +2 -0
index 3a81cd6..78d7c42 100644
@@ -296,6 +296,8 @@ static int __devinit sdhci_pxav3_probe(struct platform_device *pdev)
 
 	host->ops = &pxav3_sdhci_ops;
 
+	sdhci_get_of_property(pdev);
+
 	ret = sdhci_add_host(host);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to add host\n");
Signature · 2 lines
Chris Ball   <[email protected]>   <http://printf.net/>
One Laptop Per Child
Acked-by on v1 1/1
#4 lore raw

Re: [PATCH] mmc: sdhci-pxav3: Use sdhci_get_of_property for parsing DT quirks

Quoted 7 lines · Chris Ball

In particular, this is done to gain support for broken-cd and wp-inverted.

---
(A previously submitted patch of mine added broken-cd support to sdhci-pxav3 directly; I think it's a better idea to discard that patch and use this one instead.)

Thanks Chris, it's really better.