summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVic Yang <victoryang@chromium.org>2013-08-02 02:51:11 +0800
committerChromeBot <chrome-bot@google.com>2013-08-01 12:01:07 -0700
commit50f351de0c2a9f6309c1a27a43e756c161591f19 (patch)
tree2d8fa3d4e50a797371b8efb1d8924d444d6786ea
parent3c81c4a80fbd381687db4c80e07d0f3015aac4c8 (diff)
downloadchrome-ec-50f351de0c2a9f6309c1a27a43e756c161591f19.tar.gz
spring: Disable charging by CHARGER_EN GPIO
We've been using the trick of moving temperature zone threshold to stop charging and also blink charging LED (which doesn't exist on Spring.) However, this doesn't work anymore with the new circuit introduced to fix cap ringing. We need to disable charging by setting CHARGER_EN to 0. This also get rid of unnecessary I2C transactions. BUG=None TEST=Unplug battery, wait for 15 seconds, and check CHARGER_EN=0. TEST=Plug battery back in and check CHARGER_EN=1. TEST='pmu' and check registers 0x5-0x9 are with correct values. BRANCH=Spring Change-Id: I093a56677a33dca4accb3029491bb5d70d5bd2b6 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/64244 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r--common/pmu_tps65090_charger.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/common/pmu_tps65090_charger.c b/common/pmu_tps65090_charger.c
index 1f357ad946..f5f9409cb0 100644
--- a/common/pmu_tps65090_charger.c
+++ b/common/pmu_tps65090_charger.c
@@ -489,28 +489,14 @@ void pmu_charger_task(void)
pre_chg_start = get_time();
/* Fall through */
case ST_CHARGING:
- if (pmu_blink_led(0))
- next_state = ST_CHARGING_ERROR;
- else
- enable_charging(1);
- break;
- case ST_CHARGING_ERROR:
- /*
- * Enable hardware charging circuit after set
- * PMU to hardware error state.
- */
- if (pmu_blink_led(1))
- enable_charging(0);
- else
- enable_charging(1);
+ enable_charging(1);
break;
case ST_IDLE:
case ST_REINIT:
case ST_BAD_COND:
case ST_DISCHARGING:
+ case ST_CHARGING_ERROR:
enable_charging(0);
- /* Ignore charger error when discharging */
- pmu_blink_led(0);
break;
}
}