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
This commit is contained in:
Vic Yang
2013-05-25 11:52:02 +08:00
committed by ChromeBot
parent 006731860e
commit 455fc92b19

View File

@@ -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 &&