summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVic Yang <victoryang@chromium.org>2013-07-30 16:23:10 -0700
committerChromeBot <chrome-bot@google.com>2013-08-01 18:15:47 -0700
commit191693b8815be1a2b60c1241be2a67c8e6e413f9 (patch)
tree03fc9d37471d2d6e29b8e1f0d5c892db605125b0
parentbcdfbee1b6b666ef758a35feaf37ee0aba3bf8cd (diff)
downloadchrome-ec-191693b8815be1a2b60c1241be2a67c8e6e413f9.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: I3c532523456185223420a4381f56365ad3afb2ec Original-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> Reviewed-on: https://gerrit.chromium.org/gerrit/64276
-rw-r--r--common/extpower_usb.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/common/extpower_usb.c b/common/extpower_usb.c
index 89c9a3577f..a34d0ac66c 100644
--- a/common/extpower_usb.c
+++ b/common/extpower_usb.c
@@ -67,7 +67,7 @@ enum ilim_config {
#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)
@@ -403,17 +403,10 @@ static int pwm_check_vbus_high(int vbus)
static void 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);
set_pwm_duty_cycle(new_percent);
nominal_pwm_duty = percent;