diff options
author | Shawn Nematbakhsh <shawnn@chromium.org> | 2015-01-30 10:49:26 -0800 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-01-31 04:32:30 +0000 |
commit | d93544bbed59789f728527cb8c73f9997598130c (patch) | |
tree | a9c727b8d25d341071eeef772c0cf0001f9f73f9 | |
parent | 06db9a691151f03eff9f23981f582d8155cb255c (diff) | |
download | chrome-ec-d93544bbed59789f728527cb8c73f9997598130c.tar.gz |
mcdp28x0: Move structure definitions to ec_commands.h
mcdp_info is a logging payload, so related structures need to be moved
to the public include file.
BUG=chrome-os-partner:35935
TEST=make buildall -j
BRANCH=Samus
Change-Id: Idb939db884821fa85faafbfe643e713f5bcdbc59
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/244780
Reviewed-by: Alec Berg <alecaberg@chromium.org>
-rw-r--r-- | driver/mcdp28x0.c | 1 | ||||
-rw-r--r-- | driver/mcdp28x0.h | 16 | ||||
-rw-r--r-- | include/ec_commands.h | 20 | ||||
-rw-r--r-- | util/ectool.c | 1 |
4 files changed, 21 insertions, 17 deletions
diff --git a/driver/mcdp28x0.c b/driver/mcdp28x0.c index de334b5c59..de2572c87e 100644 --- a/driver/mcdp28x0.c +++ b/driver/mcdp28x0.c @@ -8,6 +8,7 @@ #include "config.h" #include "console.h" #include "common.h" +#include "ec_commands.h" #include "mcdp28x0.h" #include "timer.h" #include "usart-stm32f0.h" diff --git a/driver/mcdp28x0.h b/driver/mcdp28x0.h index 3a6ead9bfb..c32c9fe4aa 100644 --- a/driver/mcdp28x0.h +++ b/driver/mcdp28x0.h @@ -11,28 +11,12 @@ #define MCDP_OUTBUF_MAX 16 #define MCDP_INBUF_MAX 16 -#define MCDP_CHIPID(chipid) ((chipid[0] << 8) | chipid[1]) -#define MCDP_FAMILY(family) ((family[0] << 8) | family[1]) - #define MCDP_CMD_GETINFO 0x40 #define MCDP_LEN_GETINFO 12 /* length byte + cmd byte + data len */ #define MCDP_RSP_LEN(len) (len + 2) -struct mcdp_version { - uint8_t major; - uint8_t minor; - uint16_t build; -}; - -struct mcdp_info { - uint8_t family[2]; - uint8_t chipid[2]; - struct mcdp_version irom; - struct mcdp_version fw; -}; - /** * Enable mcdp driver. */ diff --git a/include/ec_commands.h b/include/ec_commands.h index ce10f80b85..f42e525c4a 100644 --- a/include/ec_commands.h +++ b/include/ec_commands.h @@ -2921,6 +2921,26 @@ struct ec_response_pd_log { #define PS_FAULT_OVP 3 #define PS_FAULT_DISCH 4 +/* + * PD_EVENT_VIDEO_CODEC payload is "struct mcdp_info". + */ +struct mcdp_version { + uint8_t major; + uint8_t minor; + uint16_t build; +} __packed; + +struct mcdp_info { + uint8_t family[2]; + uint8_t chipid[2]; + struct mcdp_version irom; + struct mcdp_version fw; +} __packed; + +/* struct mcdp_info field decoding */ +#define MCDP_CHIPID(chipid) ((chipid[0] << 8) | chipid[1]) +#define MCDP_FAMILY(family) ((family[0] << 8) | family[1]) + /* Get/Set USB-PD Alternate mode info */ #define EC_CMD_USB_PD_GET_AMODE 0x116 struct ec_params_usb_pd_get_mode_request { diff --git a/util/ectool.c b/util/ectool.c index 1e46e2de8f..251e604b84 100644 --- a/util/ectool.c +++ b/util/ectool.c @@ -17,7 +17,6 @@ #include "battery.h" #include "comm-host.h" #include "compile_time_macros.h" -#include "driver/mcdp28x0.h" #include "ec_flash.h" #include "ectool.h" #include "lightbar.h" |