diff options
author | Vic Yang <victoryang@chromium.org> | 2013-07-30 05:06:49 +0800 |
---|---|---|
committer | ChromeBot <chrome-bot@google.com> | 2013-08-01 18:15:46 -0700 |
commit | bcdfbee1b6b666ef758a35feaf37ee0aba3bf8cd (patch) | |
tree | a5a7d8309ff2c0f6de395606526e02c26e358073 | |
parent | 311812b5697000e68cfe50181997a7d78382c991 (diff) | |
download | chrome-ec-bcdfbee1b6b666ef758a35feaf37ee0aba3bf8cd.tar.gz |
spring: Always pull 500mA before charger type is determined
To prevent the EC browning out when the battery is too low, let's always
pull 500mA before we can determine the charger type. The correct current
limit can then be set after we know the charger type.
Also, even if the battery is not present, keep the PWM tweaking loop
going.
BUG=chrome-os-partner:21107
TEST=Plug in charger to a device with a dead battery and see it charge.
BRANCH=Spring
Change-Id: Iad5599b60d20fb405d78d30b2be74bcc98958dd5
Original-Change-Id: Iec2ec96e3c2c341f14888aa50bd84f72af75c073
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/63626
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/64275
-rw-r--r-- | common/extpower_usb.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/common/extpower_usb.c b/common/extpower_usb.c index e7ec5e710c..89c9a3577f 100644 --- a/common/extpower_usb.c +++ b/common/extpower_usb.c @@ -671,16 +671,7 @@ static void usb_device_change(int dev_type) */ void extpower_charge_init(void) { - int dummy; - - /* - * Shut off power input if battery is good. Otherwise, leave - * 500mA to sustain the system. - */ - if (battery_current(&dummy)) - set_pwm_duty_cycle(I_LIMIT_500MA); - else - ilim_config(ILIM_CONFIG_MANUAL_ON); + set_pwm_duty_cycle(I_LIMIT_500MA); /* * Somehow TSU6721 comes up slowly. Let's wait for a moment before @@ -821,7 +812,7 @@ static void pwm_tweak(void) vbus = adc_read_channel(ADC_CH_USB_VBUS_SNS); if (battery_current(¤t)) - return; + current = 0; if (user_pwm_duty >= 0) { if (current_pwm_duty != user_pwm_duty) |