diff options
author | Vic Yang <victoryang@chromium.org> | 2013-07-30 16:23:10 -0700 |
---|---|---|
committer | ChromeBot <chrome-bot@google.com> | 2013-07-30 16:40:27 -0700 |
commit | 910a2e972756316a960ea0e4948ec923eef0cfc0 (patch) | |
tree | 90770d0053185f35378e4245913b6c41096462d2 | |
parent | 1eba04284a82c931dfd3758abbb26c3f83f8ba89 (diff) | |
download | chrome-ec-910a2e972756316a960ea0e4948ec923eef0cfc0.tar.gz |
spring: Allow a minimum 100mA current input
With this, we are able to boot with a super dead battery even with a bad
charger. This however breaks support for chargers that cannot even
supply 100mA, but that's very unlikely to happen.
BUG=chrome-os-partner:21107
TEST=Charge a dead battery with a bad charger and a super long cable.
BRANCH=Spring
Change-Id: I6b7b0df0ae7bdf863420755ea92e09d87f6866c3
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/63804
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r-- | board/spring/usb_charging.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/board/spring/usb_charging.c b/board/spring/usb_charging.c index 56916527d5..5556886cd6 100644 --- a/board/spring/usb_charging.c +++ b/board/spring/usb_charging.c @@ -61,7 +61,7 @@ #define I_LIMIT_3000MA 0 /* PWM control loop parameters */ -#define PWM_CTRL_MAX_DUTY 96 /* Minimum current for dead battery */ +#define PWM_CTRL_MAX_DUTY I_LIMIT_100MA /* Minimum current */ #define PWM_CTRL_BEGIN_OFFSET 90 #define PWM_CTRL_OC_MARGIN 15 #define PWM_CTRL_OC_DETECT_TIME (1200 * MSEC) @@ -443,17 +443,10 @@ DECLARE_HOOK(HOOK_SECOND, board_pwm_tweak, HOOK_PRIO_DEFAULT); void board_pwm_nominal_duty_cycle(int percent) { - int dummy; int new_percent = percent; new_percent += PWM_CTRL_BEGIN_OFFSET; - - /* - * If the battery is dead, leave a minimum amount of current - * input to sustain the system. - */ - if (battery_current(&dummy)) - new_percent = MIN(new_percent, PWM_CTRL_MAX_DUTY); + new_percent = MIN(new_percent, PWM_CTRL_MAX_DUTY); board_pwm_duty_cycle(new_percent); nominal_pwm_duty = percent; |