If the PCF50633 ADC is disabled, but the charger is enabled we can't determine
the charger type using the pulldown. The safest thing we can do is to fallback
to 100mA that should be supplied according to the USB specs.

Signed-off-by: Sven Rebhan <[email protected]>

diff --git a/arch/arm/mach-s3c2442/mach-gta02.c 
b/arch/arm/mach-s3c2442/mach-gta02.c
index 9ad7b90..cd4d161 100644
--- a/arch/arm/mach-s3c2442/mach-gta02.c
+++ b/arch/arm/mach-s3c2442/mach-gta02.c
@@ -194,10 +194,15 @@ static void gta02_charger_worker(struct work_struct *work)
                return;
        }
 
+#ifdef CONFIG_PCF50633_ADC
        pcf50633_adc_async_read(gta02_pcf,
                PCF50633_ADCC1_MUX_ADCIN1,
                PCF50633_ADCC1_AVERAGE_16,
                gta02_configure_pmu_for_charger, NULL);
+#else
+               /* If the PCF50633 ADC is disabled we fallback to a 100mA limit 
for safety. */
+               pcf50633_mbc_usb_curlim_set(pcf, 100);
+#endif
 }
 
 #define GTA02_CHARGER_CONFIGURE_TIMEOUT ((3000 * HZ) / 1000)
-- 
1.6.0.6


Reply via email to