From: Li Jun Date: Wed, 7 Aug 2019 07:43:08 +0000 (+0800) Subject: MLK-22406 usb: typec: tcpm: create parter for source only port X-Git-Tag: rel_imx_4.19.35_1.1.0~131 X-Git-Url: https://git.somdevices.com/?a=commitdiff_plain;h=7a7948a883f803955523e0b0e32a27a792936f2f;p=linux.git MLK-22406 usb: typec: tcpm: create parter for source only port After the hack of moving forward tcpm state machine for source only port but with usb data device mode support, we need further to create its partner, so app(like android) can use it to judge if the connection exists or not. Reviewed-by: Peter Chen Signed-off-by: Li Jun --- diff --git a/drivers/usb/typec/tcpm.c b/drivers/usb/typec/tcpm.c index 5645e5ee61d7..f5f44b66191f 100644 --- a/drivers/usb/typec/tcpm.c +++ b/drivers/usb/typec/tcpm.c @@ -3227,9 +3227,10 @@ static void run_state_machine(struct tcpm_port *port) if (ret < 0) tcpm_set_state(port, SNK_UNATTACHED, 0); else if (port->port_type == TYPEC_PORT_SRC && - port->typec_caps.data == TYPEC_PORT_DRD) + port->typec_caps.data == TYPEC_PORT_DRD) { + tcpm_typec_connect(port); tcpm_log(port, "Keep at SNK_ATTACHED for USB data."); - else + } else tcpm_set_state(port, SNK_STARTUP, 0); break; case SNK_STARTUP: