summaryrefslogtreecommitdiff
path: root/include/linux/usb
diff options
context:
space:
mode:
authorBadhri Jagan Sridharan <badhri@google.com>2021-02-02 03:30:59 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-02-02 19:38:05 +0300
commita69bdb283f79949b67632878ef1822badae9299f (patch)
treec0cf8560d17333143295bb7dd2d5cac6d5b557dc /include/linux/usb
parent2b8ff93fd7443d7bd4c085ac0249d87238c755ba (diff)
downloadlinux-a69bdb283f79949b67632878ef1822badae9299f.tar.xz
usb: typec: tcpm: Add Callback to Usb Communication capable partner
The USB Communications Capable bit indicates if port partner is capable of communication over the USB data lines (e.g. D+/- or SS Tx/Rx). Notify the status of the bit to low level drivers to perform chip specific operation. For instance, low level driver enables USB switches on D+/D- lines to set up data path when the bit is set. Refactored from patch initially authored by Kyle Tso <kyletso@google.com> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Badhri Jagan Sridharan <badhri@google.com> Link: https://lore.kernel.org/r/20210202003101.221145-1-badhri@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/usb')
-rw-r--r--include/linux/usb/tcpm.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/usb/tcpm.h b/include/linux/usb/tcpm.h
index 3af99f85e8b9..42fcfbe10590 100644
--- a/include/linux/usb/tcpm.h
+++ b/include/linux/usb/tcpm.h
@@ -108,6 +108,10 @@ enum tcpm_transmit_type {
* is supported by TCPC, set this callback for TCPM to query
* whether vbus is at VSAFE0V when needed.
* Returns true when vbus is at VSAFE0V, false otherwise.
+ * @set_partner_usb_comm_capable:
+ * Optional; The USB Communications Capable bit indicates if port
+ * partner is capable of communication over the USB data lines
+ * (e.g. D+/- or SS Tx/Rx). Called to notify the status of the bit.
*/
struct tcpc_dev {
struct fwnode_handle *fwnode;
@@ -139,6 +143,7 @@ struct tcpc_dev {
int (*set_auto_vbus_discharge_threshold)(struct tcpc_dev *dev, enum typec_pwr_opmode mode,
bool pps_active, u32 requested_vbus_voltage);
bool (*is_vbus_vsafe0v)(struct tcpc_dev *dev);
+ void (*set_partner_usb_comm_capable)(struct tcpc_dev *dev, bool enable);
};
struct tcpm_port;