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-25 21:51:08 -0700
commit455fc92b195d1c0f58c84808bcc7a30ca0cc31e7 (patch)
tree72e9d3a6f8b7dc0e09f100a3c0657a072c955427
parent006731860e490dc07bb3530b5d1dca0810309ccc (diff)
downloadchrome-ec-455fc92b195d1c0f58c84808bcc7a30ca0cc31e7.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: Ib22eb7244d1f6173d4486dce7b85a55678318490 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/56674
-rw-r--r--common/extpower_usb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/extpower_usb.c b/common/extpower_usb.c
index 719527f4a3..97f74c64bb 100644
--- a/common/extpower_usb.c
+++ b/common/extpower_usb.c
@@ -318,8 +318,8 @@ static int 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 &&