usb: typec: tcpci: add tcpm_transmit_type to tcpm_pd_receive
authorRD Babiera <rdbabiera@google.com>
Mon, 8 Jan 2024 19:16:17 +0000 (19:16 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 28 Jan 2024 01:38:25 +0000 (17:38 -0800)
commit3bbb9ba4f66006f27ad0d5ceaf2480117e16d489
tree51cf759b0b04a5f633f1adff6ce77e1672582c33
parent59cd27a0cab1ceddcc4251309fd3643921ed9ab9
usb: typec: tcpci: add tcpm_transmit_type to tcpm_pd_receive

tcpm_pd_receive adds the SOP type as a parameter, and passes it within the
pd_rx_event struct for tcpm_pd_rx_handler to use. For now, the handler
drops all SOP' messages.

Maxim based tcpci drivers are capable of SOP' communication, so process_rx
now takes the SOP type into account and passes the value to
tcpm_pd_receive.

tcpci_set_pd_rx now utilizes the cable_comm_capable flag to determine if
TCPC_RX_DETECT_SOP1 should be added to the bitfield when enabling PD
message reception.

For all other consumers of tcpm_pd_receive, default the new field to
TCPC_TX_SOP.

Signed-off-by: RD Babiera <rdbabiera@google.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20240108191620.987785-18-rdbabiera@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/tcpm/fusb302.c
drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_pdphy.c
drivers/usb/typec/tcpm/tcpci.c
drivers/usb/typec/tcpm/tcpci_maxim_core.c
drivers/usb/typec/tcpm/tcpm.c
drivers/usb/typec/tcpm/wcove.c
include/linux/usb/tcpci.h
include/linux/usb/tcpm.h