diff options
author | Major Lee <major_lee@wistron.com> | 2011-06-29 07:23:46 -0400 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2011-07-20 17:21:07 -0400 |
commit | 68077b0261f00e4eb2d26f066efca1edb89488a8 (patch) | |
tree | eb26b65ceb14fb313f8f5b1f9cd849df3ebb595a /drivers/mmc/host/sdhci-pci.c | |
parent | 94dd5b3371c989b32685a00a54cba7bb530f864d (diff) |
mmc: sdhci-pci: add 8-bit bus width support for mrst hc0
And hook platform_8bit_width to support 8-bit bus width.
Signed-off-by: Major Lee <major_lee@wistron.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/host/sdhci-pci.c')
-rw-r--r-- | drivers/mmc/host/sdhci-pci.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/drivers/mmc/host/sdhci-pci.c b/drivers/mmc/host/sdhci-pci.c index 936bbca19c0a..e1ae855960b9 100644 --- a/drivers/mmc/host/sdhci-pci.c +++ b/drivers/mmc/host/sdhci-pci.c | |||
@@ -143,6 +143,12 @@ static const struct sdhci_pci_fixes sdhci_cafe = { | |||
143 | SDHCI_QUIRK_BROKEN_TIMEOUT_VAL, | 143 | SDHCI_QUIRK_BROKEN_TIMEOUT_VAL, |
144 | }; | 144 | }; |
145 | 145 | ||
146 | static int mrst_hc_probe_slot(struct sdhci_pci_slot *slot) | ||
147 | { | ||
148 | slot->host->mmc->caps |= MMC_CAP_8_BIT_DATA; | ||
149 | return 0; | ||
150 | } | ||
151 | |||
146 | /* | 152 | /* |
147 | * ADMA operation is disabled for Moorestown platform due to | 153 | * ADMA operation is disabled for Moorestown platform due to |
148 | * hardware bugs. | 154 | * hardware bugs. |
@@ -159,6 +165,7 @@ static int mrst_hc_probe(struct sdhci_pci_chip *chip) | |||
159 | 165 | ||
160 | static const struct sdhci_pci_fixes sdhci_intel_mrst_hc0 = { | 166 | static const struct sdhci_pci_fixes sdhci_intel_mrst_hc0 = { |
161 | .quirks = SDHCI_QUIRK_BROKEN_ADMA | SDHCI_QUIRK_NO_HISPD_BIT, | 167 | .quirks = SDHCI_QUIRK_BROKEN_ADMA | SDHCI_QUIRK_NO_HISPD_BIT, |
168 | .probe_slot = mrst_hc_probe_slot, | ||
162 | }; | 169 | }; |
163 | 170 | ||
164 | static const struct sdhci_pci_fixes sdhci_intel_mrst_hc1_hc2 = { | 171 | static const struct sdhci_pci_fixes sdhci_intel_mrst_hc1_hc2 = { |
@@ -789,8 +796,34 @@ static int sdhci_pci_enable_dma(struct sdhci_host *host) | |||
789 | return 0; | 796 | return 0; |
790 | } | 797 | } |
791 | 798 | ||
799 | static int sdhci_pci_8bit_width(struct sdhci_host *host, int width) | ||
800 | { | ||
801 | u8 ctrl; | ||
802 | |||
803 | ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL); | ||
804 | |||
805 | switch (width) { | ||
806 | case MMC_BUS_WIDTH_8: | ||
807 | ctrl |= SDHCI_CTRL_8BITBUS; | ||
808 | ctrl &= ~SDHCI_CTRL_4BITBUS; | ||
809 | break; | ||
810 | case MMC_BUS_WIDTH_4: | ||
811 | ctrl |= SDHCI_CTRL_4BITBUS; | ||
812 | ctrl &= ~SDHCI_CTRL_8BITBUS; | ||
813 | break; | ||
814 | default: | ||
815 | ctrl &= ~(SDHCI_CTRL_8BITBUS | SDHCI_CTRL_4BITBUS); | ||
816 | break; | ||
817 | } | ||
818 | |||
819 | sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL); | ||
820 | |||
821 | return 0; | ||
822 | } | ||
823 | |||
792 | static struct sdhci_ops sdhci_pci_ops = { | 824 | static struct sdhci_ops sdhci_pci_ops = { |
793 | .enable_dma = sdhci_pci_enable_dma, | 825 | .enable_dma = sdhci_pci_enable_dma, |
826 | .platform_8bit_width = sdhci_pci_8bit_width, | ||
794 | }; | 827 | }; |
795 | 828 | ||
796 | /*****************************************************************************\ | 829 | /*****************************************************************************\ |