]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/mmc/host/sdhci.c
sdhci: don't assign mmc->caps at SDHCI directly
[net-next-2.6.git] / drivers / mmc / host / sdhci.c
index c6d1bd8d4ac43d917e2772f2242dcdea03aa6040..3896069bd9845283edb314a6c23d3e554d3123a7 100644 (file)
@@ -1159,6 +1159,11 @@ static void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 
        ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL);
 
+       if (ios->bus_width == MMC_BUS_WIDTH_8)
+               ctrl |= SDHCI_CTRL_8BITBUS;
+       else
+               ctrl &= ~SDHCI_CTRL_8BITBUS;
+
        if (ios->bus_width == MMC_BUS_WIDTH_4)
                ctrl |= SDHCI_CTRL_4BITBUS;
        else
@@ -1687,7 +1692,8 @@ int sdhci_add_host(struct sdhci_host *host)
                        host->version);
        }
 
-       caps = sdhci_readl(host, SDHCI_CAPABILITIES);
+       caps = (host->quirks & SDHCI_QUIRK_MISSING_CAPS) ? host->caps :
+               sdhci_readl(host, SDHCI_CAPABILITIES);
 
        if (host->quirks & SDHCI_QUIRK_FORCE_DMA)
                host->flags |= SDHCI_USE_SDMA;
@@ -1786,12 +1792,12 @@ int sdhci_add_host(struct sdhci_host *host)
         */
        mmc->ops = &sdhci_ops;
        if (host->quirks & SDHCI_QUIRK_NONSTANDARD_CLOCK &&
-                       host->ops->set_clock && host->ops->get_min_clock)
+                       host->ops->get_min_clock)
                mmc->f_min = host->ops->get_min_clock(host);
        else
                mmc->f_min = host->max_clk / 256;
        mmc->f_max = host->max_clk;
-       mmc->caps = MMC_CAP_SDIO_IRQ;
+       mmc->caps |= MMC_CAP_SDIO_IRQ;
 
        if (!(host->quirks & SDHCI_QUIRK_FORCE_1_BIT_DATA))
                mmc->caps |= MMC_CAP_4_BIT_DATA;