summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2012-10-29 14:13:36 -0700
committerGerrit <chrome-bot@google.com>2012-10-30 14:50:03 -0700
commita21ea56e76ff71849d45f59608c0beb7bede4c02 (patch)
treed8e3bd5d57920878f9603cf4c3fee7b39b371188 /common
parent80467aff915c638b1c3f96a51becffd493791962 (diff)
downloadchrome-ec-a21ea56e76ff71849d45f59608c0beb7bede4c02.tar.gz
Rename power_button module to switch
Since it handles not just power button, but also lid switch, AC detect, and other switches. No functional changes; just renaming. BUG=chrome-os-partner:15579 BRANCH=none TEST=boot system, power on/off with power button Change-Id: I51628a52293f7207715f5f6bf368a08fe6c3dbce Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/36821
Diffstat (limited to 'common')
-rw-r--r--common/charge_state.c6
-rw-r--r--common/console_output.c2
-rw-r--r--common/x86_power.c10
3 files changed, 9 insertions, 9 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();
diff --git a/common/console_output.c b/common/console_output.c
index ea84e6364d..12e35f55a3 100644
--- a/common/console_output.c
+++ b/common/console_output.c
@@ -32,9 +32,9 @@ static const char *channel_names[CC_CHANNEL_COUNT] = {
"lightbar",
"lpc",
"port80",
- "powerbtn",
"pwm",
"spi",
+ "switch",
"system",
"task",
"thermal",
diff --git a/common/x86_power.c b/common/x86_power.c
index 7b8b492067..4d9f5bbcfe 100644
--- a/common/x86_power.c
+++ b/common/x86_power.c
@@ -11,7 +11,7 @@
#include "gpio.h"
#include "hooks.h"
#include "host_command.h"
-#include "power_button.h"
+#include "switch.h"
#include "system.h"
#include "task.h"
#include "timer.h"
@@ -333,7 +333,7 @@ DECLARE_HOOK(HOOK_LID_CHANGE, x86_lid_change, HOOK_PRIO_DEFAULT);
static void x86_power_ac_change(void)
{
- if (power_ac_present()) {
+ if (switch_get_ac_present()) {
CPRINTF("[%T x86 AC on]\n");
} else {
CPRINTF("[%T x86 AC off]\n");
@@ -431,7 +431,7 @@ void x86_power_task(void)
}
in_want = 0;
- if (power_ac_present())
+ if (switch_get_ac_present())
task_wait_event(-1);
else {
uint64_t target_time = last_shutdown_time +
@@ -477,7 +477,7 @@ void x86_power_task(void)
* of reset so it can wake the processor.
*/
gpio_set_level(GPIO_TOUCHSCREEN_RESETn,
- power_lid_open_debounced());
+ switch_get_lid_open());
/* Check for state transitions */
if (gpio_get_level(GPIO_PCH_SLP_S3n) == 1) {
@@ -749,7 +749,7 @@ static int command_hibernation_delay(int argc, char **argv)
/* Print the current setting */
ccprintf("Hibernation delay: %d s\n", hibernate_delay);
- if (state == X86_G3 && !power_ac_present()) {
+ if (state == X86_G3 && !switch_get_ac_present()) {
ccprintf("Time G3: %d s\n", time_g3);
ccprintf("Time left: %d s\n", hibernate_delay - time_g3);
}