summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVic Yang <victoryang@chromium.org>2013-07-30 05:06:49 +0800
committerChromeBot <chrome-bot@google.com>2013-07-29 16:36:26 -0700
commit179a5881d31ccd605ead78f84970e646853eba6c (patch)
treed51cd3feb96f93a377f54f0fe82d96f3733ba802
parent2e9d175ed13c18209ff17d498fd6d06f5c6024ae (diff)
downloadchrome-ec-179a5881d31ccd605ead78f84970e646853eba6c.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: Iec2ec96e3c2c341f14888aa50bd84f72af75c073 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/63626 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r--board/spring/usb_charging.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/board/spring/usb_charging.c b/board/spring/usb_charging.c
index 08f55708bb..c33a64d85b 100644
--- a/board/spring/usb_charging.c
+++ b/board/spring/usb_charging.c
@@ -359,16 +359,7 @@ void board_pwm_duty_cycle(int percent)
void board_pwm_init_limit(void)
{
- int dummy;
-
- /*
- * Shut off power input if battery is good. Otherwise, leave
- * 500mA to sustain the system.
- */
- if (battery_current(&dummy))
- board_pwm_duty_cycle(I_LIMIT_500MA);
- else
- board_ilim_config(ILIM_CONFIG_MANUAL_ON);
+ board_pwm_duty_cycle(I_LIMIT_500MA);
}
/**
@@ -418,7 +409,7 @@ static void board_pwm_tweak(void)
vbus = adc_read_channel(ADC_CH_USB_VBUS_SNS);
if (battery_current(&current))
- return;
+ current = 0;
if (user_pwm_duty >= 0) {
if (current_pwm_duty != user_pwm_duty)