diff options
-rw-r--r-- | board/daisy/board.c | 6 | ||||
-rw-r--r-- | board/snow/board.c | 3 | ||||
-rw-r--r-- | board/spring/board.c | 4 | ||||
-rw-r--r-- | common/pmu_tps65090.c | 7 | ||||
-rw-r--r-- | common/pmu_tps65090_charger.c | 16 |
5 files changed, 19 insertions, 17 deletions
diff --git a/board/daisy/board.c b/board/daisy/board.c index 10a5c2e39f..f66f276b92 100644 --- a/board/daisy/board.c +++ b/board/daisy/board.c @@ -4,11 +4,11 @@ */ /* Daisy board-specific configuration */ -#include "board.h" #include "common.h" #include "dma.h" -#include "i2c.h" +#include "extpower.h" #include "gpio.h" +#include "i2c.h" #include "pmu_tpschrome.h" #include "registers.h" #include "spi.h" @@ -198,7 +198,7 @@ void board_keyboard_suppress_noise(void) gpio_set_level(GPIO_CODEC_INT, 1); } -int board_get_ac(void) +int extpower_is_present(void) { /* * Detect AC state using combined gpio pins diff --git a/board/snow/board.c b/board/snow/board.c index 507a732c07..03867296c4 100644 --- a/board/snow/board.c +++ b/board/snow/board.c @@ -8,6 +8,7 @@ #include "common.h" #include "console.h" #include "dma.h" +#include "extpower.h" #include "gpio.h" #include "hooks.h" #include "i2c.h" @@ -419,7 +420,7 @@ int board_pmu_init(void) } #endif /* CONFIG_BOARD_PMU_INIT */ -int board_get_ac(void) +int extpower_is_present(void) { /* * Detect AC state using combined gpio pins diff --git a/board/spring/board.c b/board/spring/board.c index cd98e21d7e..963ed5492b 100644 --- a/board/spring/board.c +++ b/board/spring/board.c @@ -9,7 +9,7 @@ #include "common.h" #include "console.h" #include "dma.h" -#include "ec_commands.h" +#include "extpower.h" #include "gpio.h" #include "hooks.h" #include "host_command.h" @@ -297,7 +297,7 @@ int board_pmu_init(void) } #endif /* CONFIG_BOARD_PMU_INIT */ -int board_get_ac(void) +int extpower_is_present(void) { static int last_vbus; int vbus, vbus_good; diff --git a/common/pmu_tps65090.c b/common/pmu_tps65090.c index b48fbe8f2d..07375e01cd 100644 --- a/common/pmu_tps65090.c +++ b/common/pmu_tps65090.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2012 The Chromium OS Authors. All rights reserved. +/* Copyright (c) 2013 The Chromium OS Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. * @@ -8,6 +8,7 @@ #include "clock.h" #include "console.h" #include "common.h" +#include "extpower.h" #include "host_command.h" #include "hooks.h" #include "i2c.h" @@ -455,7 +456,7 @@ int pmu_adc_read(int adc_idx, int flags) void pmu_irq_handler(enum gpio_signal signal) { #ifdef CONFIG_AC_POWER_STATUS - gpio_set_level(GPIO_AC_STATUS, board_get_ac()); + gpio_set_level(GPIO_AC_STATUS, extpower_is_present()); #endif pmu_task_throttled_wake(); CPRINTF("Charger IRQ received.\n"); @@ -643,7 +644,7 @@ static int command_pmu(int argc, char **argv) if (rv) return rv; CPRINTF("pmu events b%08b\n", value); - CPRINTF("ac gpio %d\n", board_get_ac()); + CPRINTF("ac gpio %d\n", extpower_is_present()); if (rv) ccprintf("Failed - error %d\n", rv); diff --git a/common/pmu_tps65090_charger.c b/common/pmu_tps65090_charger.c index f33ab2099b..9d3fea4630 100644 --- a/common/pmu_tps65090_charger.c +++ b/common/pmu_tps65090_charger.c @@ -1,15 +1,15 @@ -/* Copyright (c) 2012 The Chromium OS Authors. All rights reserved. +/* Copyright (c) 2013 The Chromium OS Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. * * TI TPS65090 PMU charging task. */ -#include "board.h" #include "clock.h" #include "chipset.h" #include "common.h" #include "console.h" +#include "extpower.h" #include "hooks.h" #include "gpio.h" #include "pmu_tpschrome.h" @@ -191,7 +191,7 @@ static int calc_next_state(int state) switch (state) { case ST_IDLE: /* Check AC and chiset state */ - if (!board_get_ac()) { + if (!extpower_is_present()) { if (chipset_in_state(CHIPSET_STATE_ON)) return ST_DISCHARGING; return ST_IDLE; @@ -228,7 +228,7 @@ static int calc_next_state(int state) return ST_IDLE; case ST_PRE_CHARGING: - if (!board_get_ac()) + if (!extpower_is_present()) return ST_IDLE; /* If the battery goes online after enable the charger, @@ -249,7 +249,7 @@ static int calc_next_state(int state) case ST_CHARGING: /* Go back to idle state when AC is unplugged */ - if (!board_get_ac()) + if (!extpower_is_present()) return ST_IDLE; /* @@ -302,7 +302,7 @@ static int calc_next_state(int state) * - battery temperature is in start charging range * - no battery alarm */ - if (board_get_ac()) { + if (extpower_is_present()) { if (battery_status(&alarm)) return ST_CHARGING_ERROR; @@ -323,7 +323,7 @@ static int calc_next_state(int state) case ST_DISCHARGING: /* Go back to idle state when AC is plugged */ - if (board_get_ac()) + if (extpower_is_present()) return ST_IDLE; /* Prepare EC sleep after system stopped discharging */ @@ -479,7 +479,7 @@ void pmu_charger_task(void) pre_charging_count++; break; default: - if (board_get_ac()) { + if (extpower_is_present()) { wait_time = T1_USEC; break; } else if (chipset_in_state(CHIPSET_STATE_ANY_OFF)) { |