Accroding to 15ec44611904be0dcc97b84c29fbf964e5e2b36f, "mmc: sdhci: 8-bit bus width changes", add 8-bit bus width to probe_slot. And hook platform_8bit_width to support 8-bit bus width.
Signed-off-by: Major Lee <[email protected]> --- sdhci-pci.c | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) --- linux-2.6.37.bak/drivers/mmc/host/sdhci-pci.c 2011-03-31 15:19:30.838717856 +0800 +++ linux-2.6.37/drivers/mmc/host/sdhci-pci.c 2011-03-31 17:06:59.826928000 +0800 @@ -146,6 +146,21 @@ static const struct sdhci_pci_fixes sdhc }; /* + * Accroding to 15ec44611904be0dcc97b84c29fbf964e5e2b36f, + * "mmc: sdhci: 8-bit bus width changes", add 8-bit bus width + * to probe_slot. + * There is lack of declaration of SFI_DEV_TYPE_SD in + * "Simple Firmware Interface Draft 0.8.2"; and there is also + * need to add SFI_DEV_TYPE_SD in firmware. + * Currently, add MMC_CAP_8_BIT_DATA directly. + */ +static int mrst_hc_probe_slot(struct sdhci_pci_slot *slot) +{ + slot->host->mmc->caps |= MMC_CAP_8_BIT_DATA; + return 0; +} + +/* * ADMA operation is disabled for Moorestown platform due to * hardware bugs. */ @@ -161,6 +176,7 @@ static int mrst_hc_probe(struct sdhci_pc static const struct sdhci_pci_fixes sdhci_intel_mrst_hc0 = { .quirks = SDHCI_QUIRK_BROKEN_ADMA | SDHCI_QUIRK_NO_HISPD_BIT, + .probe_slot = mrst_hc_probe_slot, }; static const struct sdhci_pci_fixes sdhci_intel_mrst_hc1 = { @@ -641,8 +657,33 @@ static int sdhci_pci_enable_dma(struct s return 0; } +static int sdhci_pci_8bit_width(struct sdhci_host *host, int width) +{ + u8 ctrl; + + ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL); + + switch (width) { + case MMC_BUS_WIDTH_8: + ctrl |= SDHCI_CTRL_8BITBUS; + ctrl &= ~SDHCI_CTRL_4BITBUS; + break; + case MMC_BUS_WIDTH_4: + ctrl |= SDHCI_CTRL_4BITBUS; + ctrl &= ~SDHCI_CTRL_8BITBUS; + break; + default: + break; + } + + sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL); + + return 0; +} + static struct sdhci_ops sdhci_pci_ops = { .enable_dma = sdhci_pci_enable_dma, + .platform_8bit_width = sdhci_pci_8bit_width, }; /*********************************************************************** ******\
sdhci-pci-mrst-add-8-bit-caps.patch
Description: sdhci-pci-mrst-add-8-bit-caps.patch
_______________________________________________ MeeGo-kernel mailing list [email protected] http://lists.meego.com/listinfo/meego-kernel
