summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Brockus <dbrockus@google.com>2020-03-19 10:00:21 -0600
committerCommit Bot <commit-bot@chromium.org>2020-03-20 04:39:58 +0000
commit891a084f690276df0f9e5fc5b5e9483ec13495e3 (patch)
tree69a3838c01afd23c452de54d30d74fb743e7fbfc
parent03f5a8686a6a2274c176ead7fb928571a3e7c1f5 (diff)
downloadchrome-ec-891a084f690276df0f9e5fc5b5e9483ec13495e3.tar.gz
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 <dbrockus@google.com> Change-Id: Ib408b085452d6956ebbff04c038f6385a5202227 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2107995 Tested-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org>
-rw-r--r--driver/tcpm/anx74xx.c6
-rw-r--r--driver/tcpm/fusb302.c6
-rw-r--r--driver/tcpm/it83xx.c6
-rw-r--r--driver/tcpm/mt6370.c6
-rw-r--r--driver/tcpm/tcpci.c19
5 files changed, 1 insertions, 42 deletions
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;