diff options
-rw-r--r-- | arch/arm/mach-s3c2440/mach-gta02.c | 4 | ||||
-rw-r--r-- | drivers/i2c/chips/pcf50633.c | 12 |
2 files changed, 10 insertions, 6 deletions
diff --git a/arch/arm/mach-s3c2440/mach-gta02.c b/arch/arm/mach-s3c2440/mach-gta02.c index aa350a1fe78..33c1cc3f7c0 100644 --- a/arch/arm/mach-s3c2440/mach-gta02.c +++ b/arch/arm/mach-s3c2440/mach-gta02.c @@ -1358,7 +1358,7 @@ static void gta02_glamo_mmc_set_power(unsigned char power_mode, unsigned short vdd) { int mv = 1650; - int timeout = 100; + int timeout = 500; printk(KERN_DEBUG "mmc_set_power(power_mode=%u, vdd=%u\n", power_mode, vdd); @@ -1378,7 +1378,7 @@ gta02_glamo_mmc_set_power(unsigned char power_mode, unsigned short vdd) while (pcf50633_ready(pcf50633_global) && (timeout--)) msleep(5); - if (!timeout) { + if (timeout < 0) { printk(KERN_ERR"gta02_glamo_mmc_set_power " "BAILING on timeout\n"); return; diff --git a/drivers/i2c/chips/pcf50633.c b/drivers/i2c/chips/pcf50633.c index 2c739b41fe1..2dbeecbe700 100644 --- a/drivers/i2c/chips/pcf50633.c +++ b/drivers/i2c/chips/pcf50633.c @@ -2152,8 +2152,6 @@ static int pcf50633_detect(struct i2c_adapter *adapter, int address, int kind) goto exit_free; } - pcf50633_global = pcf; - init_resume_dependency_list(&pcf->resume_dependency); populate_sysfs_group(pcf); @@ -2229,11 +2227,13 @@ static int pcf50633_detect(struct i2c_adapter *adapter, int address, int kind) backlight_update_status(pcf->backlight); } - pcf->probe_completed = 1; - if (pcf->pdata->flag_use_apm_emulation) apm_get_power_status = pcf50633_get_power_status; + pcf->probe_completed = 1; + pcf50633_global = pcf; + dev_info(&new_client->dev, "probe completed\n"); + /* if platform was interested, give him a chance to register * platform devices that switch power with us as the parent * at registration time -- ensures suspend / resume ordering @@ -2473,6 +2473,10 @@ int pcf50633_ready(struct pcf50633_data *pcf) if (!pcf) return -EACCES; + /* this was seen during boot with Qi, mmc_rescan racing us */ + if (!pcf->probe_completed) + return -EACCES; + if ((pcf->suspend_state != PCF50633_SS_RUNNING) && (pcf->suspend_state < PCF50633_SS_COMPLETED_RESUME)) return -EBUSY; |