diff options
author | Thomas Abraham <thomas.abraham@linaro.org> | 2011-09-14 03:09:17 -0400 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2011-10-26 15:43:42 -0400 |
commit | 6fe47179a07009ee3ee7c8b962966fee420becc8 (patch) | |
tree | 1d5cff166a8ce97c25ff6bd0059aadca0b6b9dc4 /drivers/mmc/host/sdhci-s3c.c | |
parent | 041beb1d531f538bf62377e2ca2b4ecbaa479d75 (diff) |
mmc: sdhci-s3c: add default controller configuration
The default controller configuration which was previously setup by
platform helper functions is moved into the driver.
Cc: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/host/sdhci-s3c.c')
-rw-r--r-- | drivers/mmc/host/sdhci-s3c.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c index fe886d6c474a..82709b6da861 100644 --- a/drivers/mmc/host/sdhci-s3c.c +++ b/drivers/mmc/host/sdhci-s3c.c | |||
@@ -203,17 +203,23 @@ static void sdhci_s3c_set_clock(struct sdhci_host *host, unsigned int clock) | |||
203 | writel(ctrl, host->ioaddr + S3C_SDHCI_CONTROL2); | 203 | writel(ctrl, host->ioaddr + S3C_SDHCI_CONTROL2); |
204 | } | 204 | } |
205 | 205 | ||
206 | /* reconfigure the hardware for new clock rate */ | 206 | /* reprogram default hardware configuration */ |
207 | 207 | writel(S3C64XX_SDHCI_CONTROL4_DRIVE_9mA, | |
208 | { | 208 | host->ioaddr + S3C64XX_SDHCI_CONTROL4); |
209 | struct mmc_ios ios; | 209 | |
210 | 210 | ctrl = readl(host->ioaddr + S3C_SDHCI_CONTROL2); | |
211 | ios.clock = clock; | 211 | ctrl |= (S3C64XX_SDHCI_CTRL2_ENSTAASYNCCLR | |
212 | 212 | S3C64XX_SDHCI_CTRL2_ENCMDCNFMSK | | |
213 | if (ourhost->pdata->cfg_card) | 213 | S3C_SDHCI_CTRL2_ENFBCLKRX | |
214 | (ourhost->pdata->cfg_card)(ourhost->pdev, host->ioaddr, | 214 | S3C_SDHCI_CTRL2_DFCNT_NONE | |
215 | &ios, NULL); | 215 | S3C_SDHCI_CTRL2_ENCLKOUTHOLD); |
216 | } | 216 | writel(ctrl, host->ioaddr + S3C_SDHCI_CONTROL2); |
217 | |||
218 | /* reconfigure the controller for new clock rate */ | ||
219 | ctrl = (S3C_SDHCI_CTRL3_FCSEL1 | S3C_SDHCI_CTRL3_FCSEL0); | ||
220 | if (clock < 25 * 1000000) | ||
221 | ctrl |= (S3C_SDHCI_CTRL3_FCSEL3 | S3C_SDHCI_CTRL3_FCSEL2); | ||
222 | writel(ctrl, host->ioaddr + S3C_SDHCI_CONTROL3); | ||
217 | } | 223 | } |
218 | 224 | ||
219 | /** | 225 | /** |