From a904f9ef691062a43baa5542cf63daed45a1185a Mon Sep 17 00:00:00 2001 From: Hung-Te Lin Date: Thu, 11 Apr 2013 15:58:12 +0800 Subject: ec/google: Isolate EC bus protocol implementation. The Chrome EC can be connected by different types of bus like LPC / I2C / SPI, and the current implementation is only for LPC. To support other types, we must first isolate the LPC protocol stuff and add configuration variable (EC_GOOGLE_CHROMEEC_LPC) to specify bus type. Verified by building google/link (with chromeec) configuration successfully. Change-Id: Ib2920d8d935bcc77a5394e818f69e9265e26e8a0 Signed-off-by: Hung-Te Lin Reviewed-on: http://review.coreboot.org/3068 Reviewed-by: Paul Menzel Tested-by: build bot (Jenkins) Reviewed-by: David Hendricks --- src/ec/google/chromeec/ec.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/ec/google/chromeec/ec.h') diff --git a/src/ec/google/chromeec/ec.h b/src/ec/google/chromeec/ec.h index f056d266e6..c78560f973 100644 --- a/src/ec/google/chromeec/ec.h +++ b/src/ec/google/chromeec/ec.h @@ -46,4 +46,17 @@ enum usb_charge_mode { }; int google_chromeec_set_usb_charge_mode(u8 port_id, enum usb_charge_mode mode); +/* internal structure to send a command to the EC and wait for response. */ +struct chromeec_command { + uint8_t cmd_code; /* command code in, status out */ + uint8_t cmd_version; /* command version */ + const void* cmd_data_in; /* command data, if any */ + void* cmd_data_out; /* command response, if any */ + uint16_t cmd_size_in; /* size of command data */ + uint16_t cmd_size_out; /* expected size of command response in, + * actual received size out */ +}; + +int google_chromeec_command(struct chromeec_command *cec_command); + #endif /* _EC_GOOGLE_CHROMEEC_EC_H */ -- cgit v1.2.3