Do not trickle charge when battery ask for no current

When battery ask for no current, we should go back to init state to
determine what to do next.

BUG=chrome-os-partner:10946
TEST=none

Change-Id: Idf3ac7554a0774655138c5efe9c5e6de7f6cb7a0
Reviewed-on: https://gerrit.chromium.org/gerrit/26310
Reviewed-by: Rong Chang <rongchang@chromium.org>
Tested-by: Vic Yang <victoryang@chromium.org>
Commit-Ready: Vic Yang <victoryang@chromium.org>
This commit is contained in:
Vic Yang
2012-06-28 15:45:24 +08:00
committed by Gerrit
parent 21aaa0b406
commit b38e3405ea

View File

@@ -335,7 +335,8 @@ static enum power_state state_charge(struct power_state_context *ctx)
if (ctx->curr.error)
return PWR_STATE_ERROR;
if (ctx->curr.batt.desired_current < ctx->charger->current_min)
if (ctx->curr.batt.desired_current < ctx->charger->current_min &&
ctx->curr.batt.desired_current > 0)
return trickle_charge(ctx);
/* Check charger reset */