ARM: OMAP4: MMC: increase delay for pbias
4 micro seconds is not enough for PBIAS if MMC regulator is enabled from MMC regulator OFF. Increase the delay for PBIAS to stabilize. Wait for PBIAS and timeout if not. Resolves MMC/SD failure on OMAP4 "Pbias Voltage is not same as LDO" Signed-off-by: Balaji T K <balajitk@ti.com> Acked-by: Kishore Kadiyala <kishore.kadiyala@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
This commit is contained in:
parent
1704bf15de
commit
1fcecf281b
@ -145,6 +145,7 @@ static void omap4_hsmmc1_after_set_reg(struct device *dev, int slot,
|
|||||||
int power_on, int vdd)
|
int power_on, int vdd)
|
||||||
{
|
{
|
||||||
u32 reg;
|
u32 reg;
|
||||||
|
unsigned long timeout;
|
||||||
|
|
||||||
if (power_on) {
|
if (power_on) {
|
||||||
reg = omap4_ctrl_pad_readl(control_pbias_offset);
|
reg = omap4_ctrl_pad_readl(control_pbias_offset);
|
||||||
@ -157,9 +158,15 @@ static void omap4_hsmmc1_after_set_reg(struct device *dev, int slot,
|
|||||||
OMAP4_MMC1_PWRDNZ_MASK |
|
OMAP4_MMC1_PWRDNZ_MASK |
|
||||||
OMAP4_USBC1_ICUSB_PWRDNZ_MASK);
|
OMAP4_USBC1_ICUSB_PWRDNZ_MASK);
|
||||||
omap4_ctrl_pad_writel(reg, control_pbias_offset);
|
omap4_ctrl_pad_writel(reg, control_pbias_offset);
|
||||||
/* 4 microsec delay for comparator to generate an error*/
|
|
||||||
udelay(4);
|
timeout = jiffies + msecs_to_jiffies(5);
|
||||||
|
do {
|
||||||
reg = omap4_ctrl_pad_readl(control_pbias_offset);
|
reg = omap4_ctrl_pad_readl(control_pbias_offset);
|
||||||
|
if (!(reg & OMAP4_MMC1_PBIASLITE_VMODE_ERROR_MASK))
|
||||||
|
break;
|
||||||
|
usleep_range(100, 200);
|
||||||
|
} while (!time_after(jiffies, timeout));
|
||||||
|
|
||||||
if (reg & OMAP4_MMC1_PBIASLITE_VMODE_ERROR_MASK) {
|
if (reg & OMAP4_MMC1_PBIASLITE_VMODE_ERROR_MASK) {
|
||||||
pr_err("Pbias Voltage is not same as LDO\n");
|
pr_err("Pbias Voltage is not same as LDO\n");
|
||||||
/* Caution : On VMODE_ERROR Power Down MMC IO */
|
/* Caution : On VMODE_ERROR Power Down MMC IO */
|
||||||
|
Loading…
Reference in New Issue
Block a user