summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLi Jun <jun.li@nxp.com>2019-08-19 10:32:53 +0800
committerDong Aisheng <aisheng.dong@nxp.com>2019-11-25 15:57:16 +0800
commit651f8d74dc25b04f75d4cac60194ec0defee162d (patch)
tree2291173f5b0764c077c14918b1f0f5dde7441b79
parente0d71896b1a8fc44f0939951dc2dd87c95a405e4 (diff)
MLK-16013-17 usb: typec: tcpm: set cc when attached
As the cc setting while drp toggling may not be the correct value for attached state, which only means the start value in case of tcpci, so update the cc setting when src/snk attached state. Signed-off-by: Li Jun <jun.li@nxp.com>
-rw-r--r--drivers/usb/typec/tcpm/tcpm.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
index 0dceca4bc4cc..2c2515a36904 100644
--- a/drivers/usb/typec/tcpm/tcpm.c
+++ b/drivers/usb/typec/tcpm/tcpm.c
@@ -2623,6 +2623,8 @@ static int tcpm_src_attach(struct tcpm_port *port)
if (port->attached)
return 0;
+ tcpm_set_cc(port, tcpm_rp_cc(port));
+
ret = tcpm_set_polarity(port, polarity);
if (ret < 0)
return ret;
@@ -2744,6 +2746,8 @@ static int tcpm_snk_attach(struct tcpm_port *port)
if (port->attached)
return 0;
+ tcpm_set_cc(port, TYPEC_CC_RD);
+
ret = tcpm_set_polarity(port, port->cc2 != TYPEC_CC_OPEN ?
TYPEC_POLARITY_CC2 : TYPEC_POLARITY_CC1);
if (ret < 0)