summaryrefslogtreecommitdiff
path: root/common/charge_state.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/charge_state.c')
-rw-r--r--common/charge_state.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/common/charge_state.c b/common/charge_state.c
index 09efefffe1..f658b3daea 100644
--- a/common/charge_state.c
+++ b/common/charge_state.c
@@ -15,10 +15,10 @@
#include "gpio.h"
#include "hooks.h"
#include "host_command.h"
-#include "power_button.h"
#include "power_led.h"
#include "printf.h"
#include "smart_battery.h"
+#include "switch.h"
#include "system.h"
#include "task.h"
#include "timer.h"
@@ -146,7 +146,7 @@ static int state_common(struct power_state_context *ctx)
curr->error = 0;
/* Detect AC change */
- curr->ac = power_ac_present();
+ curr->ac = switch_get_ac_present();
if (curr->ac != prev->ac) {
if (curr->ac) {
/* AC on
@@ -569,7 +569,7 @@ int charge_get_percent(void)
static int enter_force_idle_mode(void)
{
- if (!power_ac_present())
+ if (!switch_get_ac_present())
return EC_ERROR_UNKNOWN;
state_machine_force_idle = 1;
charger_post_init();