mmc: dw_mmc: support 8-bit buswidth
[firefly-linux-kernel-4.4.55.git] / drivers / mmc / host / dw_mmc.c
index 2fcc82577c1b156c08102270903b5b28ef2c430f..62c8440ff04b980e82976368730accc3d115b09b 100644 (file)
@@ -562,7 +562,8 @@ static void dw_mci_setup_bus(struct dw_mci_slot *slot)
                             SDMMC_CMD_UPD_CLK | SDMMC_CMD_PRV_DAT_WAIT, 0);
 
                /* enable clock */
-               mci_writel(host, CLKENA, SDMMC_CLKEN_ENABLE);
+               mci_writel(host, CLKENA, SDMMC_CLKEN_ENABLE |
+                          SDMMC_CLKEN_LOW_PWR);
 
                /* inform CIU */
                mci_send_cmd(slot,
@@ -672,6 +673,9 @@ static void dw_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
        case MMC_BUS_WIDTH_4:
                slot->ctype = SDMMC_CTYPE_4BIT;
                break;
+       case MMC_BUS_WIDTH_8:
+               slot->ctype = SDMMC_CTYPE_8BIT;
+               break;
        }
 
        if (ios->clock) {
@@ -1441,6 +1445,12 @@ static int __init dw_mci_init_slot(struct dw_mci *host, unsigned int id)
        /* Card initially undetected */
        slot->last_detect_state = 0;
 
+       /*
+        * Card may have been plugged in prior to boot so we
+        * need to run the detect tasklet
+        */
+       tasklet_schedule(&host->card_tasklet);
+
        return 0;
 }