From 5b8ddb8e81c6f9ce7a595343ab23b012d9ded4f1 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 8 Jan 2021 11:44:10 -0700 Subject: 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 Change-Id: I95d3445f61e3cbeef167dbf03b5456908566be3f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2617368 Reviewed-by: Keith Short Reviewed-by: Jack Rosenthal --- board/volteer/board.c | 14 -------------- board/volteer/build.mk | 1 + board/volteer/cbi.c | 27 +++++++++++++++++++++++++++ 3 files changed, 28 insertions(+), 14 deletions(-) create mode 100644 board/volteer/cbi.c (limited to 'board/volteer') 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); +} -- cgit v1.2.1