aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Green <andy@openmoko.com>2008-11-19 17:09:47 +0000
committerAndy Green <agreen@pads.home.warmcat.com>2008-11-19 17:09:47 +0000
commit600130555575e59b2ad9891fda11d24b94b0667b (patch)
treead814a1b395664b170d6be3f8bfae2a903b7a8e5
parentcb0cd9f7d6db9646244daf8fa7a7a3b0cf462c0f (diff)
fix-glamo-mci-power-setting-timeout-waiting-for-pcf50633.patch
Glamo MCI power setting stuff spins on pcf50633 but it won't hurt if it gives up after a second or two instead of stalling the resume silently. Signed-off-by: Andy Green <andy@openmoko.com>
-rw-r--r--arch/arm/mach-s3c2440/mach-gta02.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/arch/arm/mach-s3c2440/mach-gta02.c b/arch/arm/mach-s3c2440/mach-gta02.c
index 5980ea9110e..69a952a89c6 100644
--- a/arch/arm/mach-s3c2440/mach-gta02.c
+++ b/arch/arm/mach-s3c2440/mach-gta02.c
@@ -1265,6 +1265,7 @@ static void
gta02_glamo_mmc_set_power(unsigned char power_mode, unsigned short vdd)
{
int mv = 1650;
+ int timeout = 100;
printk(KERN_DEBUG "mmc_set_power(power_mode=%u, vdd=%u\n",
power_mode, vdd);
@@ -1281,8 +1282,14 @@ gta02_glamo_mmc_set_power(unsigned char power_mode, unsigned short vdd)
case MMC_POWER_ON:
case MMC_POWER_UP:
/* depend on pcf50633 driver init + not suspended */
- while (pcf50633_ready(pcf50633_global))
- msleep(1);
+ while (pcf50633_ready(pcf50633_global) && (timeout--))
+ msleep(5);
+
+ if (!timeout) {
+ printk(KERN_ERR"gta02_glamo_mmc_set_power "
+ "BAILING on timeout\n");
+ return;
+ }
/* select and set the voltage */
if (vdd > 7) {
mv += 300 + 100 * (vdd - 8);