diff options
author | Simon Glass <sjg@chromium.org> | 2021-01-08 11:44:10 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-01-12 21:03:54 +0000 |
commit | 5b8ddb8e81c6f9ce7a595343ab23b012d9ded4f1 (patch) | |
tree | e6b1f90cb012b09a41ca7284a9258cd5904ea5c1 | |
parent | 9cdf0dbd2fe9c6d7ca2f3a2eae4e7c1de2a799c3 (diff) | |
download | chrome-ec-5b8ddb8e81c6f9ce7a595343ab23b012d9ded4f1.tar.gz |
volteer: Split out board CBI code into its own file
Move this out of board.c so we can use it on volteer.
BUG=b:175434113
BRANCH=none
TEST=make BOARD=volteer -j30
With a zephyr-chrome CL, build volteer on zephyr
Signed-off-by: Simon Glass <sjg@chromium.org>
Change-Id: I95d3445f61e3cbeef167dbf03b5456908566be3f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2617368
Reviewed-by: Keith Short <keithshort@chromium.org>
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
-rw-r--r-- | board/volteer/board.c | 14 | ||||
-rw-r--r-- | board/volteer/build.mk | 1 | ||||
-rw-r--r-- | board/volteer/cbi.c | 27 |
3 files changed, 28 insertions, 14 deletions
diff --git a/board/volteer/board.c b/board/volteer/board.c index dd92ee499c..7717a57668 100644 --- a/board/volteer/board.c +++ b/board/volteer/board.c @@ -59,12 +59,6 @@ struct keyboard_scan_config keyscan_config = { }; /******************************************************************************/ -/* - * FW_CONFIG defaults for Volteer if the CBI data is not initialized. - */ -union volteer_cbi_fw_config fw_config_defaults = { - .usb_db = DB_USB4_GEN2, -}; static void board_init(void) { @@ -352,14 +346,6 @@ void board_reset_pd_mcu(void) } } -__override void board_cbi_init(void) -{ - config_usb3_db_type(); - if ((!IS_ENABLED(TEST_BUILD) && !ec_cfg_has_numeric_pad()) || - get_board_id() <= 2) - keyboard_raw_set_cols(KEYBOARD_COLS_NO_KEYPAD); -} - static void board_tcpc_init(void) { /* Don't reset TCPCs after initial reset */ diff --git a/board/volteer/build.mk b/board/volteer/build.mk index 7b8cc5c6f8..76c2a1330c 100644 --- a/board/volteer/build.mk +++ b/board/volteer/build.mk @@ -13,6 +13,7 @@ BASEBOARD:=volteer board-y=board.o board-y+=battery.o +board-y+=cbi.o board-y+=led.o board-y+=sensors.o board-y+=usbc_config.o diff --git a/board/volteer/cbi.c b/board/volteer/cbi.c new file mode 100644 index 0000000000..b39f0d7d2f --- /dev/null +++ b/board/volteer/cbi.c @@ -0,0 +1,27 @@ +/* Copyright 2021 The Chromium OS Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/* Features common to ECOS and Zephyr */ +#include "common.h" +#include "cbi.h" +#include "cbi_ec_fw_config.h" +#include "keyboard_raw.h" +#include "usbc_config.h" + +/******************************************************************************/ +/* + * FW_CONFIG defaults for Volteer if the CBI data is not initialized. + */ +union volteer_cbi_fw_config fw_config_defaults = { + .usb_db = DB_USB4_GEN2, +}; + +__override void board_cbi_init(void) +{ + config_usb3_db_type(); + if ((!IS_ENABLED(TEST_BUILD) && !ec_cfg_has_numeric_pad()) || + get_board_id() <= 2) + keyboard_raw_set_cols(KEYBOARD_COLS_NO_KEYPAD); +} |