usb: typec: tcpci: set local CC to Rd only when cc1/cc2 status is Rp
authorXu Yang <xu.yang_2@nxp.com>
Wed, 11 Dec 2024 10:57:53 +0000 (18:57 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 23 Dec 2024 17:40:46 +0000 (18:40 +0100)
commit8534229375f8cc4422039fbad74c4ca01ef2f651
tree853ec4d1dea385daef394577a66c72bf91b0715f
parentc975c9b8f8204c34213e9a6821f597bbda021f8e
usb: typec: tcpci: set local CC to Rd only when cc1/cc2 status is Rp

The cc1 and cc2 status returned by tcpci_get_cc() may be TYPEC_CC_OPEN
or TYPEC_CC_RA. So don't assume it's just TYPEC_CC_RD or TYPEC_CC_RP_*.
This will let local port present Rd on CC only when cc1/cc2 status is
TYPEC_CC_RP_*.

Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20241211105753.1205312-1-xu.yang_2@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/tcpm/tcpci.c