diff options
Diffstat (limited to 'drivers/mmc/host/omap_hsmmc.c')
-rw-r--r-- | drivers/mmc/host/omap_hsmmc.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 483e591f7bbb..fd1657ad2a74 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c | |||
@@ -77,6 +77,7 @@ | |||
77 | #define MSBS (1 << 5) | 77 | #define MSBS (1 << 5) |
78 | #define BCE (1 << 1) | 78 | #define BCE (1 << 1) |
79 | #define FOUR_BIT (1 << 1) | 79 | #define FOUR_BIT (1 << 1) |
80 | #define DW8 (1 << 5) | ||
80 | #define CC 0x1 | 81 | #define CC 0x1 |
81 | #define TC 0x02 | 82 | #define TC 0x02 |
82 | #define OD 0x1 | 83 | #define OD 0x1 |
@@ -817,6 +818,7 @@ static void omap_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) | |||
817 | u16 dsor = 0; | 818 | u16 dsor = 0; |
818 | unsigned long regval; | 819 | unsigned long regval; |
819 | unsigned long timeout; | 820 | unsigned long timeout; |
821 | u32 con; | ||
820 | 822 | ||
821 | switch (ios->power_mode) { | 823 | switch (ios->power_mode) { |
822 | case MMC_POWER_OFF: | 824 | case MMC_POWER_OFF: |
@@ -827,12 +829,18 @@ static void omap_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) | |||
827 | break; | 829 | break; |
828 | } | 830 | } |
829 | 831 | ||
832 | con = OMAP_HSMMC_READ(host->base, CON); | ||
830 | switch (mmc->ios.bus_width) { | 833 | switch (mmc->ios.bus_width) { |
834 | case MMC_BUS_WIDTH_8: | ||
835 | OMAP_HSMMC_WRITE(host->base, CON, con | DW8); | ||
836 | break; | ||
831 | case MMC_BUS_WIDTH_4: | 837 | case MMC_BUS_WIDTH_4: |
838 | OMAP_HSMMC_WRITE(host->base, CON, con & ~DW8); | ||
832 | OMAP_HSMMC_WRITE(host->base, HCTL, | 839 | OMAP_HSMMC_WRITE(host->base, HCTL, |
833 | OMAP_HSMMC_READ(host->base, HCTL) | FOUR_BIT); | 840 | OMAP_HSMMC_READ(host->base, HCTL) | FOUR_BIT); |
834 | break; | 841 | break; |
835 | case MMC_BUS_WIDTH_1: | 842 | case MMC_BUS_WIDTH_1: |
843 | OMAP_HSMMC_WRITE(host->base, CON, con & ~DW8); | ||
836 | OMAP_HSMMC_WRITE(host->base, HCTL, | 844 | OMAP_HSMMC_WRITE(host->base, HCTL, |
837 | OMAP_HSMMC_READ(host->base, HCTL) & ~FOUR_BIT); | 845 | OMAP_HSMMC_READ(host->base, HCTL) & ~FOUR_BIT); |
838 | break; | 846 | break; |
@@ -1057,7 +1065,9 @@ static int __init omap_mmc_probe(struct platform_device *pdev) | |||
1057 | mmc->ocr_avail = mmc_slot(host).ocr_mask; | 1065 | mmc->ocr_avail = mmc_slot(host).ocr_mask; |
1058 | mmc->caps |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED; | 1066 | mmc->caps |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED; |
1059 | 1067 | ||
1060 | if (pdata->slots[host->slot_id].wires >= 4) | 1068 | if (pdata->slots[host->slot_id].wires >= 8) |
1069 | mmc->caps |= MMC_CAP_8_BIT_DATA; | ||
1070 | else if (pdata->slots[host->slot_id].wires >= 4) | ||
1061 | mmc->caps |= MMC_CAP_4_BIT_DATA; | 1071 | mmc->caps |= MMC_CAP_4_BIT_DATA; |
1062 | 1072 | ||
1063 | omap_hsmmc_init(host); | 1073 | omap_hsmmc_init(host); |