aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-omap2/hsmmc.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
index 857f7daa328..66868c5d5a2 100644
--- a/arch/arm/mach-omap2/hsmmc.c
+++ b/arch/arm/mach-omap2/hsmmc.c
@@ -145,6 +145,7 @@ static void omap4_hsmmc1_after_set_reg(struct device *dev, int slot,
145 int power_on, int vdd) 145 int power_on, int vdd)
146{ 146{
147 u32 reg; 147 u32 reg;
148 unsigned long timeout;
148 149
149 if (power_on) { 150 if (power_on) {
150 reg = omap4_ctrl_pad_readl(control_pbias_offset); 151 reg = omap4_ctrl_pad_readl(control_pbias_offset);
@@ -157,9 +158,15 @@ static void omap4_hsmmc1_after_set_reg(struct device *dev, int slot,
157 OMAP4_MMC1_PWRDNZ_MASK | 158 OMAP4_MMC1_PWRDNZ_MASK |
158 OMAP4_USBC1_ICUSB_PWRDNZ_MASK); 159 OMAP4_USBC1_ICUSB_PWRDNZ_MASK);
159 omap4_ctrl_pad_writel(reg, control_pbias_offset); 160 omap4_ctrl_pad_writel(reg, control_pbias_offset);
160 /* 4 microsec delay for comparator to generate an error*/ 161
161 udelay(4); 162 timeout = jiffies + msecs_to_jiffies(5);
162 reg = omap4_ctrl_pad_readl(control_pbias_offset); 163 do {
164 reg = omap4_ctrl_pad_readl(control_pbias_offset);
165 if (!(reg & OMAP4_MMC1_PBIASLITE_VMODE_ERROR_MASK))
166 break;
167 usleep_range(100, 200);
168 } while (!time_after(jiffies, timeout));
169
163 if (reg & OMAP4_MMC1_PBIASLITE_VMODE_ERROR_MASK) { 170 if (reg & OMAP4_MMC1_PBIASLITE_VMODE_ERROR_MASK) {
164 pr_err("Pbias Voltage is not same as LDO\n"); 171 pr_err("Pbias Voltage is not same as LDO\n");
165 /* Caution : On VMODE_ERROR Power Down MMC IO */ 172 /* Caution : On VMODE_ERROR Power Down MMC IO */