summaryrefslogtreecommitdiff
path: root/board/kinox
diff options
context:
space:
mode:
authorMatt Wang <matt_wang@compal.corp-partner.google.com>2022-03-18 10:09:52 +0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-03-31 12:15:46 +0000
commitf3af2a08fdaee00ae4dd766ced0250430533e2e7 (patch)
treecbe0ed83f6f9ae3c7536286b488a2ee55abed925 /board/kinox
parenta8275395a4cb859effee01e8a5e0bc0eb1b71939 (diff)
downloadchrome-ec-f3af2a08fdaee00ae4dd766ced0250430533e2e7.tar.gz
kinox: remove the bj_power fw config setting
Remove the barrel jack fw_config bits(0-3) then set to the reserved. BUG=b:218786349;b:223380935 BRANCH=none TEST=make BOARD=kinox Signed-off-by: Matt Wang <matt_wang@compal.corp-partner.google.com> Change-Id: I64f6a6442521afe6517a6f834dc4de7f577c7a1d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3535279 Reviewed-by: Zhuohao Lee <zhuohao@chromium.org>
Diffstat (limited to 'board/kinox')
-rw-r--r--board/kinox/board.c40
-rw-r--r--board/kinox/board.h2
-rw-r--r--board/kinox/fw_config.c34
-rw-r--r--board/kinox/fw_config.h13
-rw-r--r--board/kinox/gpio.inc2
5 files changed, 3 insertions, 88 deletions
diff --git a/board/kinox/board.c b/board/kinox/board.c
index 43a1cef501..0dae3b0f5e 100644
--- a/board/kinox/board.c
+++ b/board/kinox/board.c
@@ -104,42 +104,6 @@ void board_set_charge_limit(int port, int supplier, int charge_ma,
{
}
-/******************************************************************************/
-/*
- * Barrel jack power supply handling
- *
- * EN_PPVAR_BJ_ADP_L must default active to ensure we can power on when the
- * barrel jack is connected, and the USB-C port can bring the EC up fine in
- * dead-battery mode. Both the USB-C and barrel jack switches do reverse
- * protection, so we're safe to turn one on then the other off- but we should
- * only do that if the system is off since it might still brown out.
- */
-
-#define ADP_DEBOUNCE_MS 1000 /* Debounce time for BJ plug/unplug */
-/* Debounced connection state of the barrel jack */
-static int8_t adp_connected = -1;
-static void adp_connect_deferred(void)
-{
- struct charge_port_info pi = { 0 };
- int connected = !gpio_get_level(GPIO_BJ_ADP_PRESENT_ODL);
-
- /* Debounce */
- if (connected == adp_connected)
- return;
- if (connected)
- ec_bj_power(&pi.voltage, &pi.current);
- charge_manager_update_charge(CHARGE_SUPPLIER_DEDICATED,
- DEDICATED_CHARGE_PORT, &pi);
- adp_connected = connected;
-}
-DECLARE_DEFERRED(adp_connect_deferred);
-
-/* IRQ for BJ plug/unplug. It shouldn't be called if BJ is the power source. */
-void adp_connect_interrupt(enum gpio_signal signal)
-{
- hook_call_deferred(&adp_connect_deferred_data, ADP_DEBOUNCE_MS * MSEC);
-}
-
static void adp_state_init(void)
{
ASSERT(CHARGE_PORT_ENUM_COUNT == CHARGE_PORT_COUNT);
@@ -151,14 +115,10 @@ static void adp_state_init(void)
for (int j = 0; j < CHARGE_SUPPLIER_COUNT; j++)
charge_manager_update_charge(j, i, NULL);
}
-
- /* Report charge state from the barrel jack. */
- adp_connect_deferred();
}
DECLARE_HOOK(HOOK_INIT, adp_state_init, HOOK_PRIO_INIT_CHARGE_MANAGER + 1);
static void board_init(void)
{
- gpio_enable_interrupt(GPIO_BJ_ADP_PRESENT_ODL);
}
DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT);
diff --git a/board/kinox/board.h b/board/kinox/board.h
index fbe156bbc2..b2ede09c16 100644
--- a/board/kinox/board.h
+++ b/board/kinox/board.h
@@ -169,8 +169,6 @@ enum mft_channel {
MFT_CH_COUNT
};
-extern void adp_connect_interrupt(enum gpio_signal signal);
-
#endif /* !__ASSEMBLER__ */
#endif /* __CROS_EC_BOARD_H */
diff --git a/board/kinox/fw_config.c b/board/kinox/fw_config.c
index d4ae66ac17..9f7f72f132 100644
--- a/board/kinox/fw_config.c
+++ b/board/kinox/fw_config.c
@@ -19,26 +19,7 @@ BUILD_ASSERT(sizeof(fw_config) == sizeof(uint32_t));
* FW_CONFIG defaults for kinox if the CBI.FW_CONFIG data is not
* initialized.
*/
-static const union kinox_cbi_fw_config fw_config_defaults = {
- .bj_power = BJ_135W,
-};
-
-/*
- * Barrel-jack power adapter ratings.
- */
-static const struct {
- int voltage;
- int current;
-} bj_power[] = {
- [BJ_135W] = { /* 0 - 135W (also default) */
- .voltage = 19500,
- .current = 6920
- },
- [BJ_230W] = { /* 1 - 230W */
- .voltage = 19500,
- .current = 11800
- }
-};
+static const union kinox_cbi_fw_config fw_config_defaults = {0};
/****************************************************************************
* Kinox FW_CONFIG access
@@ -50,16 +31,3 @@ void board_init_fw_config(void)
fw_config = fw_config_defaults;
}
}
-
-void ec_bj_power(uint32_t *voltage, uint32_t *current)
-{
- unsigned int bj;
-
- bj = fw_config.bj_power;
- /* Out of range value defaults to 0 */
- if (bj >= ARRAY_SIZE(bj_power))
- bj = 0;
-
- *voltage = bj_power[bj].voltage;
- *current = bj_power[bj].current;
-}
diff --git a/board/kinox/fw_config.h b/board/kinox/fw_config.h
index 02e46e10b6..f9ebfa8c9f 100644
--- a/board/kinox/fw_config.h
+++ b/board/kinox/fw_config.h
@@ -14,15 +14,9 @@
* Source of truth is the project/brask/kinox/config.star configuration file.
*/
-enum ec_cfg_bj_power {
- BJ_135W = 0,
- BJ_230W = 1
-};
-
union kinox_cbi_fw_config {
struct {
- uint32_t bj_power : 2;
- uint32_t reserved_1 : 30;
+ uint32_t reserved_1 : 32;
};
uint32_t raw_value;
};
@@ -34,9 +28,4 @@ union kinox_cbi_fw_config {
*/
union kinox_cbi_fw_config get_fw_config(void);
-/**
- * Get the barrel-jack power from FW_CONFIG.
- */
-void ec_bj_power(uint32_t *voltage, uint32_t *current);
-
#endif /* __BOARD_KINOX_FW_CONFIG_H_ */
diff --git a/board/kinox/gpio.inc b/board/kinox/gpio.inc
index efe9e37eeb..d21782ba37 100644
--- a/board/kinox/gpio.inc
+++ b/board/kinox/gpio.inc
@@ -19,7 +19,6 @@ GPIO_INT(SYS_SLP_S0IX_L, PIN(D, 5), GPIO_INT_BOTH, power_signal_inte
GPIO_INT(USB_C0_BC12_INT_ODL, PIN(C, 6), GPIO_INT_FALLING, bc12_interrupt)
GPIO_INT(USB_C0_PPC_INT_ODL, PIN(F, 5), GPIO_INT_FALLING, ppc_interrupt)
GPIO_INT(USB_C0_TCPC_INT_ODL, PIN(A, 2), GPIO_INT_FALLING, tcpc_alert_event)
-GPIO_INT(BJ_ADP_PRESENT_ODL, PIN(8, 2), GPIO_INT_BOTH | GPIO_PULL_UP, adp_connect_interrupt)
GPIO_INT(EC_RECOVERY_BTN_OD, PIN(2, 3), GPIO_INT_BOTH, button_interrupt)
/* CCD */
@@ -38,6 +37,7 @@ GPIO(HDMI_CONN_OC_ODL, PIN(2, 4), GPIO_INPUT)
/* BarrelJack */
GPIO(EN_PPVAR_BJ_ADP_L, PIN(0, 7), GPIO_OUT_LOW)
+GPIO(BJ_ADP_PRESENT_ODL, PIN(8, 2), GPIO_INPUT)
/* Chipset PCH */
GPIO(EC_PCHHOT_ODL, PIN(7, 4), GPIO_INPUT)