From 891a084f690276df0f9e5fc5b5e9483ec13495e3 Mon Sep 17 00:00:00 2001 From: Denis Brockus Date: Thu, 19 Mar 2020 10:00:21 -0600 Subject: tcpci: remove cached pull The cached pull is no longer needed, so removing the code. BUG=none BRANCH=none TEST=make buildall -j Signed-off-by: Denis Brockus Change-Id: Ib408b085452d6956ebbff04c038f6385a5202227 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2107995 Tested-by: Denis Brockus Reviewed-by: Edward Hill Commit-Queue: Denis Brockus Auto-Submit: Denis Brockus --- driver/tcpm/anx74xx.c | 6 ------ driver/tcpm/fusb302.c | 6 ------ driver/tcpm/it83xx.c | 6 ------ driver/tcpm/mt6370.c | 6 ------ driver/tcpm/tcpci.c | 19 +------------------ 5 files changed, 1 insertion(+), 42 deletions(-) (limited to 'driver') diff --git a/driver/tcpm/anx74xx.c b/driver/tcpm/anx74xx.c index 21d1f3e9f0..f8b12fe43d 100644 --- a/driver/tcpm/anx74xx.c +++ b/driver/tcpm/anx74xx.c @@ -737,9 +737,6 @@ static int anx74xx_tcpm_set_cc(int port, int pull) int rv = EC_SUCCESS; int reg; - /* Keep track of current CC pull value */ - tcpci_set_cached_pull(port, pull); - /* Enable CC software Control */ rv = anx74xx_cc_software_ctrl(port, 1); if (rv) @@ -1046,9 +1043,6 @@ static int anx74xx_tcpm_init(int port) { int rv = 0, reg; - /* Start with an unknown connection */ - tcpci_set_cached_pull(port, TYPEC_CC_OPEN); - memset(&anx[port], 0, sizeof(struct anx_state)); /* Bring chip in normal mode to work */ anx74xx_set_power_mode(port, ANX74XX_NORMAL_MODE); diff --git a/driver/tcpm/fusb302.c b/driver/tcpm/fusb302.c index dc2f495e96..61a5623fb9 100644 --- a/driver/tcpm/fusb302.c +++ b/driver/tcpm/fusb302.c @@ -387,9 +387,6 @@ static int fusb302_tcpm_init(int port) { int reg; - /* Start with an unknown connection */ - tcpci_set_cached_pull(port, TYPEC_CC_OPEN); - /* set default */ state[port].cc_polarity = -1; @@ -492,9 +489,6 @@ static int fusb302_tcpm_set_cc(int port, int pull) { int reg; - /* Keep track of current CC pull value */ - tcpci_set_cached_pull(port, pull); - /* NOTE: FUSB302 toggles a single pull-up between CC1 and CC2 */ /* NOTE: FUSB302 Does not support Ra. */ switch (pull) { diff --git a/driver/tcpm/it83xx.c b/driver/tcpm/it83xx.c index 2bbf0d18c4..8d48b68a00 100644 --- a/driver/tcpm/it83xx.c +++ b/driver/tcpm/it83xx.c @@ -419,9 +419,6 @@ static int it83xx_set_cc(enum usbpd_port port, int pull) static int it83xx_tcpm_init(int port) { - /* Start with an unknown connection */ - tcpci_set_cached_pull(port, TYPEC_CC_OPEN); - /* Initialize physical layer */ it83xx_init(port, PD_ROLE_DEFAULT(port)); @@ -475,9 +472,6 @@ static int it83xx_tcpm_select_rp_value(int port, int rp_sel) static int it83xx_tcpm_set_cc(int port, int pull) { - /* Keep track of current CC pull value */ - tcpci_set_cached_pull(port, pull); - return it83xx_set_cc(port, pull); } diff --git a/driver/tcpm/mt6370.c b/driver/tcpm/mt6370.c index eb0b0fc2e9..84ebd0a91e 100644 --- a/driver/tcpm/mt6370.c +++ b/driver/tcpm/mt6370.c @@ -32,9 +32,6 @@ static int mt6370_init(int port) { int rv, val; - /* Start with an unknown connection */ - tcpci_set_cached_pull(port, TYPEC_CC_OPEN); - rv = tcpc_read(port, MT6370_REG_IDLE_CTRL, &val); /* Only do soft-reset in shipping mode. (b:122017882) */ @@ -141,9 +138,6 @@ static int mt6370_get_cc(int port, enum tcpc_cc_voltage_status *cc1, static int mt6370_set_cc(int port, int pull) { - /* Keep track of current CC pull value */ - tcpci_set_cached_pull(port, pull); - if (pull == TYPEC_CC_RD) mt6370_init_cc_params(port, TYPEC_CC_VOLT_RP_DEF); return tcpci_tcpm_set_cc(port, pull); diff --git a/driver/tcpm/tcpci.c b/driver/tcpm/tcpci.c index 95c8d9bb3e..3a7f5f2de8 100644 --- a/driver/tcpm/tcpci.c +++ b/driver/tcpm/tcpci.c @@ -31,9 +31,8 @@ static int rx_en[CONFIG_USB_PD_PORT_MAX_COUNT]; #endif static int tcpc_vbus[CONFIG_USB_PD_PORT_MAX_COUNT]; -/* Cached RP/PULL role values */ +/* Cached RP role values */ static int cached_rp[CONFIG_USB_PD_PORT_MAX_COUNT]; -static enum tcpc_cc_pull cached_pull[CONFIG_USB_PD_PORT_MAX_COUNT]; #ifdef CONFIG_USB_PD_TCPC_LOW_POWER int tcpc_addr_write(int port, int i2c_addr, int reg, int val) @@ -196,16 +195,6 @@ int tcpci_get_cached_rp(int port) return cached_rp[port]; } -void tcpci_set_cached_pull(int port, enum tcpc_cc_pull pull) -{ - cached_pull[port] = pull; -} - -enum tcpc_cc_pull tcpci_get_cached_pull(int port) -{ - return cached_pull[port]; -} - static int init_alert_mask(int port) { int rv; @@ -360,9 +349,6 @@ int tcpci_tcpm_get_cc(int port, enum tcpc_cc_voltage_status *cc1, int tcpci_tcpm_set_cc(int port, int pull) { - /* Keep track of current CC pull value */ - tcpci_set_cached_pull(port, pull); - return tcpc_write(port, TCPC_REG_ROLE_CTRL, TCPC_REG_ROLE_CTRL_SET(0, tcpci_get_cached_rp(port), @@ -1167,9 +1153,6 @@ int tcpci_tcpm_init(int port) int power_status; int tries = TCPM_INIT_TRIES; - /* Start with an unknown connection */ - tcpci_set_cached_pull(port, TYPEC_CC_OPEN); - if (port >= board_get_usb_pd_port_count()) return EC_ERROR_INVAL; -- cgit v1.2.1