summaryrefslogtreecommitdiff
path: root/zephyr/projects/nissa/src/nereid
diff options
context:
space:
mode:
authorAndrew McRae <amcrae@google.com>2022-01-31 16:03:43 +1100
committerCommit Bot <commit-bot@chromium.org>2022-01-31 07:53:22 +0000
commit38063669c7c9efee40fed489b6b2c7272e920e6e (patch)
tree8af67c1ba31c5fb14d2c814aa5c36959f715d6bb /zephyr/projects/nissa/src/nereid
parentc182ea76fa2272de9363a0c43b68fbe079c8b514 (diff)
downloadchrome-ec-38063669c7c9efee40fed489b6b2c7272e920e6e.tar.gz
nissa: Consolidate common code into a single file.
Consolidate common code for nivviks/nereid into a common file BUG=b:217091028 TEST=zmake configure -b {nereid,nivviks} BRANCH=none Signed-off-by: Andrew McRae <amcrae@google.com> Change-Id: I87d49f63073a861455f7a868e3ce18d4fc46fc68 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3426244 Reviewed-by: Peter Marheine <pmarheine@chromium.org>
Diffstat (limited to 'zephyr/projects/nissa/src/nereid')
-rw-r--r--zephyr/projects/nissa/src/nereid/charger.c15
-rw-r--r--zephyr/projects/nissa/src/nereid/usbc.c68
2 files changed, 0 insertions, 83 deletions
diff --git a/zephyr/projects/nissa/src/nereid/charger.c b/zephyr/projects/nissa/src/nereid/charger.c
index a366081edd..168179694c 100644
--- a/zephyr/projects/nissa/src/nereid/charger.c
+++ b/zephyr/projects/nissa/src/nereid/charger.c
@@ -53,18 +53,3 @@ __override void board_check_extpower(void)
last_extpower_present = extpower_present;
}
-
-/*
- * Count of chargers depends on sub board presence.
- */
-__override uint8_t board_get_charger_chip_count(void)
-{
- switch (nissa_get_sb_type()) {
- default:
- return 1;
-
- case NISSA_SB_C_A:
- case NISSA_SB_C_LTE:
- return 2;
- }
-}
diff --git a/zephyr/projects/nissa/src/nereid/usbc.c b/zephyr/projects/nissa/src/nereid/usbc.c
index 6e4dd33867..7975b7a8a6 100644
--- a/zephyr/projects/nissa/src/nereid/usbc.c
+++ b/zephyr/projects/nissa/src/nereid/usbc.c
@@ -41,68 +41,6 @@ struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_MAX_COUNT] = {
},
};
-/*
- * TODO(b/197480501): Move common code into common file.
- */
-
-struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_MAX_COUNT] = {
- {
- .usb_port = 0,
- .driver = &virtual_usb_mux_driver,
- .hpd_update = &virtual_hpd_update,
- },
- { /* sub-board */
- .usb_port = 1,
- .driver = &virtual_usb_mux_driver,
- .hpd_update = &virtual_hpd_update,
- },
-};
-
-static uint8_t cached_usb_pd_port_count;
-
-__override uint8_t board_get_usb_pd_port_count(void)
-{
- if (cached_usb_pd_port_count == 0)
- CPRINTS("USB PD Port count not initialized!");
- return cached_usb_pd_port_count;
-}
-
-/*
- * Initialise the USB PD port count, which
- * depends on which sub-board is attached.
- */
-static void init_usb_pd_port_count(void)
-{
- switch (nissa_get_sb_type()) {
- default:
- cached_usb_pd_port_count = 1;
- break;
-
- case NISSA_SB_C_A:
- case NISSA_SB_C_LTE:
- cached_usb_pd_port_count = 2;
- break;
- }
-}
-/*
- * Make sure setup is done after EEPROM is readable.
- */
-DECLARE_HOOK(HOOK_INIT, init_usb_pd_port_count, HOOK_PRIO_INIT_I2C + 1);
-
-void board_set_charge_limit(int port, int supplier, int charge_ma,
- int max_ma, int charge_mv)
-{
- int icl = MAX(charge_ma, CONFIG_CHARGER_INPUT_CURRENT);
-
- /*
- * Assume charger overdraws by about 4%, keeping the actual draw
- * within spec. This adjustment can be changed with characterization
- * of actual hardware.
- */
- icl = icl * 96 / 100;
- charge_set_input_current_limit(icl, charge_mv);
-}
-
/* Vconn control for integrated ITE TCPC */
void board_pd_vconn_ctrl(int port, enum usbpd_cc_pin cc_pin, int enabled)
{
@@ -160,12 +98,6 @@ uint16_t tcpc_get_alert_status(void)
return status;
}
-int pd_check_vconn_swap(int port)
-{
- /* Allow VCONN swaps if the AP is on. */
- return chipset_in_state(CHIPSET_STATE_ANY_SUSPEND | CHIPSET_STATE_ON);
-}
-
void pd_power_supply_reset(int port)
{
}