From 102142c9e01f1b40b02db5239710bf37f4a17293 Mon Sep 17 00:00:00 2001 From: Andrei Pistirica Date: Thu, 28 Jan 2016 15:30:18 +0530 Subject: drivers: mmc: add driver for Microchip PIC32 SDHCI controller. This driver implements platform specific glue and fixups for PIC32 internal SDHCI controller. Signed-off-by: Andrei Pistirica Signed-off-by: Sandeep Sheriker Mallikarjun Signed-off-by: Purna Chandra Mandal Reviewed-by: Tom Rini Reviewed-by: Daniel Schwierzeck --- drivers/mmc/sdhci.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'drivers/mmc/sdhci.c') diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c index ff770b1..8586d89 100644 --- a/drivers/mmc/sdhci.c +++ b/drivers/mmc/sdhci.c @@ -443,6 +443,12 @@ static int sdhci_init(struct mmc *mmc) sdhci_set_power(host, fls(mmc->cfg->voltages) - 1); if (host->quirks & SDHCI_QUIRK_NO_CD) { +#if defined(CONFIG_PIC32_SDHCI) + /* PIC32 SDHCI CD errata: + * - set CD_TEST and clear CD_TEST_INS bit + */ + sdhci_writeb(host, SDHCI_CTRL_CD_TEST, SDHCI_HOST_CONTROL); +#else unsigned int status; sdhci_writeb(host, SDHCI_CTRL_CD_TEST_INS | SDHCI_CTRL_CD_TEST, @@ -453,6 +459,7 @@ static int sdhci_init(struct mmc *mmc) (!(status & SDHCI_CARD_STATE_STABLE)) || (!(status & SDHCI_CARD_DETECT_PIN_LEVEL))) status = sdhci_readl(host, SDHCI_PRESENT_STATE); +#endif } /* Enable only interrupts served by the SD controller */ -- cgit v1.1