]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge remote-tracking branch 'mmc/mmc-next'
authorStephen Rothwell <sfr@canb.auug.org.au>
Fri, 5 Aug 2011 01:50:59 +0000 (11:50 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 5 Aug 2011 01:50:59 +0000 (11:50 +1000)
Conflicts:
drivers/mmc/host/sdhci-esdhc-imx.c

1  2 
drivers/mmc/host/dw_mmc.c
drivers/mmc/host/sdhci-esdhc-imx.c

Simple merge
index 9ebfb4b482f5983870169b1b4f0662b1fd4c7e24,e62d33fb5ebbe4a9720b7d4c3387554e24dc6266..468e487ab9f5ccc714a5677fda6e58d1d5826ae3
@@@ -140,14 -86,35 +141,36 @@@ static void esdhc_writel_le(struct sdhc
  {
        struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
        struct pltfm_imx_data *imx_data = pltfm_host->priv;
-       if (unlikely((reg == SDHCI_INT_ENABLE || reg == SDHCI_SIGNAL_ENABLE)
-                       && (boarddata->cd_type == ESDHC_CD_GPIO)))
-               /*
-                * these interrupts won't work with a custom card_detect gpio
-                */
-               val &= ~(SDHCI_INT_CARD_REMOVE | SDHCI_INT_CARD_INSERT);
 +      struct esdhc_platform_data *boarddata = &imx_data->boarddata;
 -              if (imx_data->flags & ESDHC_FLAG_GPIO_FOR_CD)
+       u32 data;
+       if (unlikely(reg == SDHCI_INT_ENABLE || reg == SDHCI_SIGNAL_ENABLE)) {
++              if (boarddata->cd_type == ESDHC_CD_GPIO))
+                       /*
+                        * these interrupts won't work with a
+                        * custom card_detect gpio
+                        * (only applied to mx25/35)
+                        */
+                       val &= ~(SDHCI_INT_CARD_REMOVE | SDHCI_INT_CARD_INSERT);
+               if (val & SDHCI_INT_CARD_INT) {
+                       /*
+                        * clear D3CD bit and set D3CD bit to avoid
+                        * missing the card interrupt
+                        * this is a eSDHC controller problem so that
+                        * we need to apply the following workaround
+                        * clear and set D3CD bit will make eSDHC
+                        * re-sample the card interrupt, In case
+                        * a card interrupt was lost, re-sample it by
+                        * the following steps.
+                        */
+                       data = readl(host->ioaddr + SDHCI_HOST_CONTROL);
+                       data &= ~SDHCI_CTRL_D3CD;
+                       writel(data, host->ioaddr + SDHCI_HOST_CONTROL);
+                       data |= SDHCI_CTRL_D3CD;
+                       writel(data, host->ioaddr + SDHCI_HOST_CONTROL);
+               }
+       }
  
        if (unlikely((imx_data->flags & ESDHC_FLAG_MULTIBLK_NO_INT)
                                && (reg == SDHCI_INT_STATUS)