Skip to contentSkip to conversation

dw_mmc: add quirks unreliable detect and capabilities

PATCH In review Jaehoon Chung 3 participants 4 messages Feb 25, 2011 – Mar 17, 2011

Subsystems (2)
lore
Share & tools
lore

Jaehoon Chung

author maintainer
#0 lore raw

PATCH 3/3 dw_mmc: add quirks unreliable detect and capabilities

This patch added quirks and capabilities in platdata.

Some card didn't use the CDn pin. In that case, We assume card inserted, then the card initialized or not.
And Some board need other capabilities. So added capabilities in board platdata.

---
 drivers/mmc/host/dw_mmc.c  |   10 ++++++++--
 include/linux/mmc/dw_mmc.h |   10 +++++++---
 2 files changed, 15 insertions(+), 5 deletions(-)
drivers/mmc/host/dw_mmc.c +8 -2
index 338fedc..6c01b1e 100644
@@ -730,7 +730,9 @@ static int dw_mci_get_cd(struct mmc_host *mmc)
 	struct dw_mci_board *brd = slot->host->pdata;
 
 	/* Use platform get_cd function, else try onboard card detect */
-	if (brd->get_cd)
+	if (brd->quirks & DW_MCI_QUIRK_BROKEN_CARD_DETECTION)
+		present = 1;
+	else if (brd->get_cd)
 		present = !brd->get_cd(slot->id);
 	else
 		present = (mci_readl(slot->host, CDETECT) & (1 << slot->id))
@@ -1408,7 +1410,11 @@ static int __init dw_mci_init_slot(struct dw_mci *host, unsigned int id)
 	if (host->pdata->setpower)
 		host->pdata->setpower(id, 0);
 
-	mmc->caps = 0;
+	if (host->pdata->caps)
+		mmc->caps = host->pdata->caps;
+	else
+		mmc->caps = 0;
+
 	if (host->pdata->get_bus_wd)
 		if (host->pdata->get_bus_wd(slot->id) >= 4)
 			mmc->caps |= MMC_CAP_4_BIT_DATA;
include/linux/mmc/dw_mmc.h +7 -3
index a39c497..45b9298 100644
@@ -168,11 +168,13 @@ struct dw_mci_dma_ops {
 
 /* IP Quirks/flags. */
 /* DTO fix for command transmission with IDMAC configured */
-#define DW_MCI_QUIRK_IDMAC_DTO		BIT(0)
+#define DW_MCI_QUIRK_IDMAC_DTO			BIT(0)
 /* delay needed between retries on some 2.11a implementations */
-#define DW_MCI_QUIRK_RETRY_DELAY	BIT(1)
+#define DW_MCI_QUIRK_RETRY_DELAY		BIT(1)
 /* High Speed Capable - Supports HS cards (upto 50MHz) */
-#define DW_MCI_QUIRK_HIGHSPEED		BIT(2)
+#define DW_MCI_QUIRK_HIGHSPEED			BIT(2)
+/* Unreliable card detection */
+#define DW_MCI_QUIRK_BROKEN_CARD_DETECTION	BIT(3)
 
 
 struct dma_pdata;
@@ -192,6 +194,8 @@ struct dw_mci_board {
 	u32 quirks; /* Workaround / Quirk flags */
 	unsigned int bus_hz; /* Bus speed */
 
+	unsigned int caps;	/* Capabilities */
+
 	/* delay in mS before detecting cards after interrupt */
 	u32 detect_delay_ms;
 
Acked-by on v1 3/3
#1 lore raw
Quoted 6 lines · Jaehoon Chung

This patch added quirks and capabilities in platdata.

Some card didn't use the CDn pin. In that case, We assume card inserted, then the card initialized or not.
And Some board need other capabilities. So added capabilities in board platdata.

Quoted 6 lines

---
 drivers/mmc/host/dw_mmc.c  |   10 ++++++++--
 include/linux/mmc/dw_mmc.h |   10 +++++++---

 2 files changed, 15 insertions(+), 5 deletions(-)
author maintainer
#2 lore raw

Hi Chris..

I want to know your opinion..

Regards,
Jaehoon Chung

Quoted 20 lines · Will Newton
Quoted 6 lines · Jaehoon Chung

This patch added quirks and capabilities in platdata.

Some card didn't use the CDn pin. In that case, We assume card inserted, then the card initialized or not.
And Some board need other capabilities. So added capabilities in board platdata.

Quoted 6 lines
---
 drivers/mmc/host/dw_mmc.c  |   10 ++++++++--
 include/linux/mmc/dw_mmc.h |   10 +++++++---
 2 files changed, 15 insertions(+), 5 deletions(-)

--
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

#3 lore raw
In reply to Jaehoon Chung

Hi,

Quoted 8 lines · Jaehoon Chung

This patch added quirks and capabilities in platdata.

Some card didn't use the CDn pin. In that case, We assume card inserted, then the card initialized or not.
And Some board need other capabilities. So added capabilities in board platdata.

Thanks, will merge for .39 with Will's ACK.

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