aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/davinci_mmc.c37
1 files changed, 16 insertions, 21 deletions
diff --git a/drivers/mmc/host/davinci_mmc.c b/drivers/mmc/host/davinci_mmc.c
index 547d29c31b40..56afe0a00f56 100644
--- a/drivers/mmc/host/davinci_mmc.c
+++ b/drivers/mmc/host/davinci_mmc.c
@@ -909,19 +909,26 @@ static void mmc_davinci_cmd_done(struct mmc_davinci_host *host,
909 } 909 }
910} 910}
911 911
912static void 912static inline void mmc_davinci_reset_ctrl(struct mmc_davinci_host *host,
913davinci_abort_data(struct mmc_davinci_host *host, struct mmc_data *data) 913 int val)
914{ 914{
915 u32 temp; 915 u32 temp;
916 916
917 /* reset command and data state machines */
918 temp = readl(host->base + DAVINCI_MMCCTL); 917 temp = readl(host->base + DAVINCI_MMCCTL);
919 writel(temp | MMCCTL_CMDRST | MMCCTL_DATRST, 918 if (val) /* reset */
920 host->base + DAVINCI_MMCCTL); 919 temp |= MMCCTL_CMDRST | MMCCTL_DATRST;
920 else /* enable */
921 temp &= ~(MMCCTL_CMDRST | MMCCTL_DATRST);
921 922
922 temp &= ~(MMCCTL_CMDRST | MMCCTL_DATRST);
923 udelay(10);
924 writel(temp, host->base + DAVINCI_MMCCTL); 923 writel(temp, host->base + DAVINCI_MMCCTL);
924 udelay(10);
925}
926
927static void
928davinci_abort_data(struct mmc_davinci_host *host, struct mmc_data *data)
929{
930 mmc_davinci_reset_ctrl(host, 1);
931 mmc_davinci_reset_ctrl(host, 0);
925} 932}
926 933
927static irqreturn_t mmc_davinci_irq(int irq, void *dev_id) 934static irqreturn_t mmc_davinci_irq(int irq, void *dev_id)
@@ -1125,15 +1132,8 @@ static inline void mmc_davinci_cpufreq_deregister(struct mmc_davinci_host *host)
1125#endif 1132#endif
1126static void __init init_mmcsd_host(struct mmc_davinci_host *host) 1133static void __init init_mmcsd_host(struct mmc_davinci_host *host)
1127{ 1134{
1128 /* DAT line portion is diabled and in reset state */
1129 writel(readl(host->base + DAVINCI_MMCCTL) | MMCCTL_DATRST,
1130 host->base + DAVINCI_MMCCTL);
1131
1132 /* CMD line portion is diabled and in reset state */
1133 writel(readl(host->base + DAVINCI_MMCCTL) | MMCCTL_CMDRST,
1134 host->base + DAVINCI_MMCCTL);
1135 1135
1136 udelay(10); 1136 mmc_davinci_reset_ctrl(host, 1);
1137 1137
1138 writel(0, host->base + DAVINCI_MMCCLK); 1138 writel(0, host->base + DAVINCI_MMCCLK);
1139 writel(MMCCLK_CLKEN, host->base + DAVINCI_MMCCLK); 1139 writel(MMCCLK_CLKEN, host->base + DAVINCI_MMCCLK);
@@ -1141,12 +1141,7 @@ static void __init init_mmcsd_host(struct mmc_davinci_host *host)
1141 writel(0x1FFF, host->base + DAVINCI_MMCTOR); 1141 writel(0x1FFF, host->base + DAVINCI_MMCTOR);
1142 writel(0xFFFF, host->base + DAVINCI_MMCTOD); 1142 writel(0xFFFF, host->base + DAVINCI_MMCTOD);
1143 1143
1144 writel(readl(host->base + DAVINCI_MMCCTL) & ~MMCCTL_DATRST, 1144 mmc_davinci_reset_ctrl(host, 0);
1145 host->base + DAVINCI_MMCCTL);
1146 writel(readl(host->base + DAVINCI_MMCCTL) & ~MMCCTL_CMDRST,
1147 host->base + DAVINCI_MMCCTL);
1148
1149 udelay(10);
1150} 1145}
1151 1146
1152static int __init davinci_mmcsd_probe(struct platform_device *pdev) 1147static int __init davinci_mmcsd_probe(struct platform_device *pdev)