diff options
author | Manuel Lauss <mano@roarinelk.homelinux.net> | 2008-06-09 02:37:33 -0400 |
---|---|---|
committer | Pierre Ossman <drzeus@drzeus.cx> | 2008-07-15 08:14:43 -0400 |
commit | 281dd23ea03e9893c02d237d9e35a7d20d412452 (patch) | |
tree | 1eba66e44a9c9e712e543a36d47ce93a1df9d833 /drivers | |
parent | c4223c2c91fa9e5addd6eadd804e57a925ac5e5e (diff) |
au1xmmc: enable 4 bit transfer mode
Signed-off-by: Manuel Lauss <mano@roarinelk.homelinux.net>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mmc/host/au1xmmc.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/drivers/mmc/host/au1xmmc.c b/drivers/mmc/host/au1xmmc.c index d8776d61b3cc..2bd4cf427093 100644 --- a/drivers/mmc/host/au1xmmc.c +++ b/drivers/mmc/host/au1xmmc.c | |||
@@ -95,14 +95,13 @@ static inline void IRQ_OFF(struct au1xmmc_host *host, u32 mask) | |||
95 | 95 | ||
96 | static inline void SEND_STOP(struct au1xmmc_host *host) | 96 | static inline void SEND_STOP(struct au1xmmc_host *host) |
97 | { | 97 | { |
98 | 98 | u32 config2; | |
99 | /* We know the value of CONFIG2, so avoid a read we don't need */ | ||
100 | u32 mask = SD_CONFIG2_EN; | ||
101 | 99 | ||
102 | WARN_ON(host->status != HOST_S_DATA); | 100 | WARN_ON(host->status != HOST_S_DATA); |
103 | host->status = HOST_S_STOP; | 101 | host->status = HOST_S_STOP; |
104 | 102 | ||
105 | au_writel(mask | SD_CONFIG2_DF, HOST_CONFIG2(host)); | 103 | config2 = au_readl(HOST_CONFIG2(host)); |
104 | au_writel(config2 | SD_CONFIG2_DF, HOST_CONFIG2(host)); | ||
106 | au_sync(); | 105 | au_sync(); |
107 | 106 | ||
108 | /* Send the stop commmand */ | 107 | /* Send the stop commmand */ |
@@ -697,6 +696,7 @@ static void au1xmmc_reset_controller(struct au1xmmc_host *host) | |||
697 | static void au1xmmc_set_ios(struct mmc_host* mmc, struct mmc_ios* ios) | 696 | static void au1xmmc_set_ios(struct mmc_host* mmc, struct mmc_ios* ios) |
698 | { | 697 | { |
699 | struct au1xmmc_host *host = mmc_priv(mmc); | 698 | struct au1xmmc_host *host = mmc_priv(mmc); |
699 | u32 config2; | ||
700 | 700 | ||
701 | if (ios->power_mode == MMC_POWER_OFF) | 701 | if (ios->power_mode == MMC_POWER_OFF) |
702 | au1xmmc_set_power(host, 0); | 702 | au1xmmc_set_power(host, 0); |
@@ -708,6 +708,18 @@ static void au1xmmc_set_ios(struct mmc_host* mmc, struct mmc_ios* ios) | |||
708 | au1xmmc_set_clock(host, ios->clock); | 708 | au1xmmc_set_clock(host, ios->clock); |
709 | host->clock = ios->clock; | 709 | host->clock = ios->clock; |
710 | } | 710 | } |
711 | |||
712 | config2 = au_readl(HOST_CONFIG2(host)); | ||
713 | switch (ios->bus_width) { | ||
714 | case MMC_BUS_WIDTH_4: | ||
715 | config2 |= SD_CONFIG2_WB; | ||
716 | break; | ||
717 | case MMC_BUS_WIDTH_1: | ||
718 | config2 &= ~SD_CONFIG2_WB; | ||
719 | break; | ||
720 | } | ||
721 | au_writel(config2, HOST_CONFIG2(host)); | ||
722 | au_sync(); | ||
711 | } | 723 | } |
712 | 724 | ||
713 | #define STATUS_TIMEOUT (SD_STATUS_RAT | SD_STATUS_DT) | 725 | #define STATUS_TIMEOUT (SD_STATUS_RAT | SD_STATUS_DT) |
@@ -952,7 +964,7 @@ static int __devinit au1xmmc_probe(struct platform_device *pdev) | |||
952 | mmc->max_blk_count = 512; | 964 | mmc->max_blk_count = 512; |
953 | 965 | ||
954 | mmc->ocr_avail = AU1XMMC_OCR; | 966 | mmc->ocr_avail = AU1XMMC_OCR; |
955 | mmc->caps = 0; | 967 | mmc->caps = MMC_CAP_4_BIT_DATA; |
956 | 968 | ||
957 | host->status = HOST_S_IDLE; | 969 | host->status = HOST_S_IDLE; |
958 | 970 | ||