diff options
author | jimmy.wu <jimmy.wu@lcfc.corp-partner.google.com> | 2022-07-20 16:49:51 +0800 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-07-22 04:10:39 +0000 |
commit | bafd346ad0a1dc58a47d2b21b7c15e6ff8b3c39d (patch) | |
tree | 26b30031e963ee3c5883007380c058760478c768 | |
parent | 4cc509c1ec7d19319d0884ab1402eb36f6332e52 (diff) | |
download | chrome-ec-bafd346ad0a1dc58a47d2b21b7c15e6ff8b3c39d.tar.gz |
pujjo: Remove second type-c port/charger code.
Disable GPIO I2c function for hdmi pin.
Remove type-c port1, second charger code.
BUG=b:239653512
TEST=zmake build pujjo
BRANCH=none
Signed-off-by: jimmy.wu <jimmy.wu@lcfc.corp-partner.google.com>
Change-Id: I87ddb8d8df18d70363349f06bf986da8f14c65cc
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3775788
Reviewed-by: Peter Marheine <pmarheine@chromium.org>
Reviewed-by: Andrew McRae <amcrae@google.com>
-rw-r--r-- | zephyr/projects/nissa/pujjo/generated.dts | 14 | ||||
-rw-r--r-- | zephyr/projects/nissa/pujjo/overlay.dts | 37 | ||||
-rw-r--r-- | zephyr/projects/nissa/pujjo/prj.conf | 2 | ||||
-rw-r--r-- | zephyr/projects/nissa/pujjo/src/charger.c | 4 | ||||
-rw-r--r-- | zephyr/projects/nissa/pujjo/src/usbc.c | 35 | ||||
-rw-r--r-- | zephyr/projects/nissa/src/sub_board.c | 2 |
6 files changed, 3 insertions, 91 deletions
diff --git a/zephyr/projects/nissa/pujjo/generated.dts b/zephyr/projects/nissa/pujjo/generated.dts index 11a0ef2315..0304679fee 100644 --- a/zephyr/projects/nissa/pujjo/generated.dts +++ b/zephyr/projects/nissa/pujjo/generated.dts @@ -214,10 +214,6 @@ i2c-port = <&i2c3_0>; enum-name = "I2C_PORT_USB_C0_TCPC"; }; - i2c_ec_i2c_sub_usb_c1: ec_i2c_sub_usb_c1 { - i2c-port = <&i2c5_1>; - enum-name = "I2C_PORT_USB_C1_TCPC"; - }; i2c_ec_i2c_batt: ec_i2c_batt { i2c-port = <&i2c7_0>; enum-name = "I2C_PORT_BATTERY"; @@ -253,12 +249,6 @@ pinctrl-names = "default"; }; -&i2c5_1 { - status = "okay"; - pinctrl-0 = <&i2c5_1_sda_scl_gpf4_f5>; - pinctrl-names = "default"; -}; - &i2c7_0 { status = "okay"; pinctrl-0 = <&i2c7_0_sda_scl_gpb2_b3>; @@ -277,10 +267,6 @@ status = "okay"; }; -&i2c_ctrl5 { - status = "okay"; -}; - &i2c_ctrl7 { status = "okay"; }; diff --git a/zephyr/projects/nissa/pujjo/overlay.dts b/zephyr/projects/nissa/pujjo/overlay.dts index a7c6c24cc5..9721ca5712 100644 --- a/zephyr/projects/nissa/pujjo/overlay.dts +++ b/zephyr/projects/nissa/pujjo/overlay.dts @@ -204,38 +204,6 @@ compatible = "cros-ec,usbc-mux-virtual"; }; }; - /* - * TODO(b:211693800): port1 may not be present on some - * sub-boards. - */ - port1@1 { - compatible = "named-usbc-port"; - reg = <1>; - bc12 { - compatible = "pericom,pi3usb9201"; - port = <&i2c_ec_i2c_sub_usb_c1>; - }; - chg { - compatible = "intersil,isl923x"; - status = "okay"; - port = <&i2c_ec_i2c_sub_usb_c1>; - }; - /* - * Some sub-boards may disable all usb muxes in chain - * except virtual_mux_1 - */ - usb-muxes = <&virtual_mux_1 &anx7483_mux_1>; - }; - port1-muxes { - virtual_mux_1: virtual-mux-1 { - compatible = "cros-ec,usbc-mux-virtual"; - }; - anx7483_mux_1: anx7483-mux-1 { - compatible = "analogix,anx7483"; - port = <&i2c_ec_i2c_sub_usb_c1>; - i2c-addr-flags = "ANX7483_I2C_ADDR0_FLAGS"; - }; - }; }; fans { @@ -308,11 +276,6 @@ clock-frequency = <I2C_BITRATE_FAST_PLUS>; }; -&i2c5_1 { - label = "I2C_SUB_C1_TCPC"; - clock-frequency = <I2C_BITRATE_FAST_PLUS>; -}; - &i2c7_0 { label = "I2C_BATTERY"; clock-frequency = <I2C_BITRATE_STANDARD>; diff --git a/zephyr/projects/nissa/pujjo/prj.conf b/zephyr/projects/nissa/pujjo/prj.conf index 8b3ae50b55..bea0a68755 100644 --- a/zephyr/projects/nissa/pujjo/prj.conf +++ b/zephyr/projects/nissa/pujjo/prj.conf @@ -32,9 +32,7 @@ CONFIG_PLATFORM_EC_USB_PD_5V_EN_CUSTOM=y CONFIG_PLATFORM_EC_USBC_RETIMER_ANX7483=y # Charger driver and configuration -CONFIG_PLATFORM_EC_OCPC=y CONFIG_PLATFORM_EC_CHARGER_RAA489000=y -CONFIG_PLATFORM_EC_OCPC_DEF_RBATT_MOHMS=22 # VSENSE: PP3300_S5 & PP1050_PROC CONFIG_ADC_CMP_NPCX=y diff --git a/zephyr/projects/nissa/pujjo/src/charger.c b/zephyr/projects/nissa/pujjo/src/charger.c index c6209bdf75..4c6c4061f8 100644 --- a/zephyr/projects/nissa/pujjo/src/charger.c +++ b/zephyr/projects/nissa/pujjo/src/charger.c @@ -48,9 +48,7 @@ __override void board_check_extpower(void) __override void board_hibernate(void) { /* Shut down the chargers */ - if (board_get_usb_pd_port_count() == 2) - raa489000_hibernate(CHARGER_SECONDARY, true); - raa489000_hibernate(CHARGER_PRIMARY, true); + raa489000_hibernate(0, true); LOG_INF("Charger(s) hibernated"); cflush(); } diff --git a/zephyr/projects/nissa/pujjo/src/usbc.c b/zephyr/projects/nissa/pujjo/src/usbc.c index 16a763efb0..d7dc4be290 100644 --- a/zephyr/projects/nissa/pujjo/src/usbc.c +++ b/zephyr/projects/nissa/pujjo/src/usbc.c @@ -31,17 +31,6 @@ struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_MAX_COUNT] = { .flags = TCPC_FLAGS_TCPCI_REV2_0 | TCPC_FLAGS_VBUS_MONITOR, }, - { /* sub-board */ - .bus_type = EC_BUS_TYPE_I2C, - .i2c_info = { - .port = I2C_PORT_USB_C1_TCPC, - .addr_flags = RAA489000_TCPC0_I2C_FLAGS, - }, - .drv = &raa489000_tcpm_drv, - /* RAA489000 implements TCPCI 2.0 */ - .flags = TCPC_FLAGS_TCPCI_REV2_0 | - TCPC_FLAGS_VBUS_MONITOR, - }, }; int board_is_sourcing_vbus(int port) @@ -138,19 +127,6 @@ uint16_t tcpc_get_alert_status(void) status |= PD_STATUS_TCPC_ALERT_0; } } - - if (board_get_usb_pd_port_count() == 2 && - !gpio_pin_get_dt(GPIO_DT_FROM_ALIAS(gpio_usb_c1_int_odl))) { - if (!tcpc_read16(1, TCPC_REG_ALERT, ®val)) { - /* TCPCI spec Rev 1.0 says to ignore bits 14:12. */ - if (!(tcpc_config[1].flags & TCPC_FLAGS_TCPCI_REV2_0)) - regval &= ~((1 << 14) | (1 << 13) | (1 << 12)); - - if (regval) - status |= PD_STATUS_TCPC_ALERT_1; - } - } - return status; } @@ -223,8 +199,6 @@ void board_reset_pd_mcu(void) static void poll_c0_int(void); DECLARE_DEFERRED(poll_c0_int); -static void poll_c1_int(void); -DECLARE_DEFERRED(poll_c1_int); static void usbc_interrupt_trigger(int port) { @@ -247,12 +221,6 @@ static void poll_c0_int(void) &poll_c0_int_data); } -static void poll_c1_int(void) -{ - poll_usb_gpio(1, GPIO_DT_FROM_ALIAS(gpio_usb_c1_int_odl), - &poll_c1_int_data); -} - void usb_interrupt(enum gpio_signal signal) { int port; @@ -261,9 +229,6 @@ void usb_interrupt(enum gpio_signal signal) if (signal == GPIO_SIGNAL(DT_NODELABEL(gpio_usb_c0_int_odl))) { port = 0; ud = &poll_c0_int_data; - } else { - port = 1; - ud = &poll_c1_int_data; } /* * We've just been called from a falling edge, so there's definitely diff --git a/zephyr/projects/nissa/src/sub_board.c b/zephyr/projects/nissa/src/sub_board.c index ad0f1a33a2..379511c836 100644 --- a/zephyr/projects/nissa/src/sub_board.c +++ b/zephyr/projects/nissa/src/sub_board.c @@ -152,6 +152,7 @@ static void nereid_subboard_config(void) * USB-C port: the default configuration has I2C on the I2C pins, * but the interrupt line needs to be configured. */ +#if CONFIG_USB_PD_PORT_MAX_COUNT > 1 if (sb == NISSA_SB_C_A || sb == NISSA_SB_C_LTE) { /* Configure interrupt input */ gpio_pin_configure_dt(GPIO_DT_FROM_ALIAS(gpio_usb_c1_int_odl), @@ -160,6 +161,7 @@ static void nereid_subboard_config(void) /* Port doesn't exist, doesn't need muxing */ usb_muxes[1].next_mux = NULL; } +#endif switch (sb) { #if BOARD_HAS_HDMI_SUPPORT |