summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVic Yang <victoryang@chromium.org>2013-05-25 11:52:02 +0800
committerChromeBot <chrome-bot@google.com>2013-05-28 08:51:35 -0700
commita7979bac1a17f6bc381663e7a3f691c49f375c65 (patch)
treec0a3bfd344b117b6efe4a4936a2fc5f7e4e20ea0
parentc3aa27602647069d21a200d3ff4b8f14bd2c7a26 (diff)
downloadchrome-ec-a7979bac1a17f6bc381663e7a3f691c49f375c65.tar.gz
spring: Avoid over-current on the same PWM duty cycle
While in fast mode, we step on the same PWM duty cycle which caused over-current. We should avoid this. BUG=chrome-os-partner:18301 TEST=None BRANCH=spring Change-Id: I0ff29d47aa52d4e306c84e35ef0753f680403bc4 Original-Change-Id: Ib22eb7244d1f6173d4486dce7b85a55678318490 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/56675 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r--board/spring/usb_charging.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/board/spring/usb_charging.c b/board/spring/usb_charging.c
index 5715431fcc..e48d25906e 100644
--- a/board/spring/usb_charging.c
+++ b/board/spring/usb_charging.c
@@ -318,8 +318,8 @@ static int board_pwm_get_next_lower(void)
if (current_limit_mode == LIMIT_AGGRESSIVE) {
if (pwm_fast_mode &&
- fast_next >= nominal_pwm_duty - PWM_CTRL_OC_MARGIN &&
- fast_next >= over_current_pwm_duty)
+ fast_next > nominal_pwm_duty - PWM_CTRL_OC_MARGIN &&
+ fast_next > over_current_pwm_duty)
return MAX(fast_next, 0);
if (current_pwm_duty > nominal_pwm_duty -
PWM_CTRL_OC_MARGIN &&