mainboard/glkrvp: Add EC_GOOGLE_CHROMEEC_SWITCHES

This patch adds the EC_GOOGLE_CHROMEEC_SWITCHES option so that we
use the common switch.c file

Change-Id: I93a2ba63015db17989c89ce1b5897de6a93e201f
Signed-off-by: Hannah Williams <hannah.williams@intel.com>
Reviewed-on: https://review.coreboot.org/23131
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
This commit is contained in:
Shaunak Saha 2018-01-04 23:14:35 -08:00 committed by Martin Roth
parent f9bd2c5052
commit f40fd5b508
2 changed files with 1 additions and 27 deletions

View File

@ -46,6 +46,7 @@ config CHROMEOS
config VBOOT
select HAS_RECOVERY_MRC_CACHE
select MRC_CLEAR_NORMAL_CACHE_ON_RECOVERY_RETRAIN
select EC_GOOGLE_CHROMEEC_SWITCHES
config MAINBOARD_DIR
string

View File

@ -35,39 +35,12 @@ void fill_lb_gpios(struct lb_gpios *gpios)
lb_add_gpios(gpios, chromeos_gpios, ARRAY_SIZE(chromeos_gpios));
}
int get_lid_switch(void)
{
if (IS_ENABLED(CONFIG_EC_GOOGLE_CHROMEEC))
/* Read lid switch state from the EC. */
return !!(google_chromeec_get_switches() & EC_SWITCH_LID_OPEN);
else
return 1;
}
int get_developer_mode_switch(void)
{
/* No physical developer mode switch. It's virtual. */
return 0;
}
int get_recovery_mode_switch(void)
{
if (!IS_ENABLED(CONFIG_EC_GOOGLE_CHROMEEC))
return 0;
/* Check if the EC has posted the keyboard recovery event. */
return !!(google_chromeec_get_events_b() &
EC_HOST_EVENT_MASK(EC_HOST_EVENT_KEYBOARD_RECOVERY));
}
int clear_recovery_mode_switch(void)
{
if (!IS_ENABLED(CONFIG_EC_GOOGLE_CHROMEEC))
return 0;
/* Clear keyboard recovery event. */
return google_chromeec_clear_events_b(
EC_HOST_EVENT_MASK(EC_HOST_EVENT_KEYBOARD_RECOVERY));
}
int get_write_protect_state(void)
{
return 0;