diff options
author | Vincent Palatin <vpalatin@chromium.org> | 2012-09-19 09:41:11 -0700 |
---|---|---|
committer | Gerrit <chrome-bot@google.com> | 2012-09-20 07:14:18 -0700 |
commit | c350c20f443eb69429727f2f967522e7b2817515 (patch) | |
tree | 2726920511b4b2299f330889db46f77a952f79fe /common/pmu_tps65090_charger.c | |
parent | 07cae3f8e1f7e8b53c8b60752d4e7d519ff01a74 (diff) | |
download | chrome-ec-c350c20f443eb69429727f2f967522e7b2817515.tar.gz |
tpschrome: AC detection is board specific.
the PMU VACG signal used to detect AC state is connected to a GPIO, so
it's a board specific configuration.
On top of that, Daisy variants have custom logic on that line which is
not present on the next boards, so we need to update it before doing BSP
for next-gen boards.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:14313
TEST=make BOARD=snow && make BOARD=daisy
on snow EC console, type "pmu" command with AC plugge and unplugged, see
that the "ac gpio" line reflects the right value.
BRANCH=none
Change-Id: If1e19b89b2f2de45d8dddc8340931e56c5f7f0a5
Reviewed-on: https://gerrit.chromium.org/gerrit/33630
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'common/pmu_tps65090_charger.c')
-rw-r--r-- | common/pmu_tps65090_charger.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/common/pmu_tps65090_charger.c b/common/pmu_tps65090_charger.c index be3abd0bb2..d710262954 100644 --- a/common/pmu_tps65090_charger.c +++ b/common/pmu_tps65090_charger.c @@ -194,7 +194,7 @@ static int calc_next_state(int state) switch (state) { case ST_IDLE: /* Check AC and chiset state */ - if (!pmu_get_ac()) { + if (!board_get_ac()) { if (chipset_in_state(CHIPSET_STATE_ON)) return ST_DISCHARGING; return ST_IDLE; @@ -231,7 +231,7 @@ static int calc_next_state(int state) return ST_IDLE; case ST_PRE_CHARGING: - if (!pmu_get_ac()) + if (!board_get_ac()) return ST_IDLE; /* If the battery goes online after enable the charger, @@ -252,7 +252,7 @@ static int calc_next_state(int state) case ST_CHARGING: /* Go back to idle state when AC is unplugged */ - if (!pmu_get_ac()) + if (!board_get_ac()) return ST_IDLE; /* @@ -305,7 +305,7 @@ static int calc_next_state(int state) * - battery temperature is in start charging range * - no battery alarm */ - if (pmu_get_ac()) { + if (board_get_ac()) { if (battery_status(&alarm)) return ST_CHARGING_ERROR; @@ -326,7 +326,7 @@ static int calc_next_state(int state) case ST_DISCHARGING: /* Go back to idle state when AC is plugged */ - if (pmu_get_ac()) + if (board_get_ac()) return ST_IDLE; /* Prepare EC sleep after system stopped discharging */ @@ -453,7 +453,7 @@ void pmu_charger_task(void) pre_charging_count++; break; default: - if (pmu_get_ac()) { + if (board_get_ac()) { wait_time = T1_USEC; break; } else if (chipset_in_state(CHIPSET_STATE_ANY_OFF)) { |