summaryrefslogtreecommitdiff
path: root/src/ec
diff options
context:
space:
mode:
Diffstat (limited to 'src/ec')
-rw-r--r--src/ec/google/chromeec/ec.h1
-rw-r--r--src/ec/google/chromeec/ec_lpc.c6
2 files changed, 7 insertions, 0 deletions
diff --git a/src/ec/google/chromeec/ec.h b/src/ec/google/chromeec/ec.h
index 8dfefd41cf..3bc62c9427 100644
--- a/src/ec/google/chromeec/ec.h
+++ b/src/ec/google/chromeec/ec.h
@@ -53,6 +53,7 @@ int google_chromeec_kbbacklight(int percent);
void google_chromeec_post(u8 postcode);
void google_chromeec_log_events(u32 mask);
int google_chromeec_vbnv_context(int is_read, uint8_t *data, int len);
+uint8_t google_chromeec_get_switches(void);
/* For MEC, access ranges 0x800 thru 0x9ff using EMI interface instead of LPC */
#define MEC_EMI_RANGE_START EC_HOST_CMD_REGION0
diff --git a/src/ec/google/chromeec/ec_lpc.c b/src/ec/google/chromeec/ec_lpc.c
index 9d1121bc6f..003a5f259e 100644
--- a/src/ec/google/chromeec/ec_lpc.c
+++ b/src/ec/google/chromeec/ec_lpc.c
@@ -364,6 +364,12 @@ static int google_chromeec_command_v1(struct chromeec_command *cec_command)
return 0;
}
+/* Return the byte of EC switch states */
+uint8_t google_chromeec_get_switches(void)
+{
+ return read_byte(EC_LPC_ADDR_MEMMAP + EC_MEMMAP_SWITCHES);
+}
+
#ifdef __PRE_RAM__
int google_chromeec_command(struct chromeec_command *cec_command)