Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions drivers/usb/typec/tipd/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1151,6 +1151,21 @@ static void cd321x_update_work(struct work_struct *work)
new_role = USB_ROLE_DEVICE;
else
new_role = USB_ROLE_HOST;
} else if (new_connected && !cd321x->tbt_switch &&
device_is_compatible(tps->dev, "apple,t8132-sn201202x") &&
(st.data_status & (TPS_DATA_STATUS_TBT_CONNECTION |
CD321X_DATA_STATUS_USB4_CONNECTION))) {
/*
* In Thunderbolt 3 alt mode the controller reports neither a
* USB2 nor a USB3 connection. With a USB4/Thunderbolt router,
* the partner's USB is tunnelled through it. A T8132 port
* without a router has nothing to tunnel through, and a T8132
* PHY without the CIO calibration serves the partner's USB 2.0
* on D+/D- instead of the link. Give the port the USB role of
* its Type-C data role, or its USB controller never starts.
*/
new_role = TPS_STATUS_TO_TYPEC_DATAROLE(st.status) == TYPEC_HOST ?
USB_ROLE_HOST : USB_ROLE_DEVICE;
}

if (new_connected) {
Expand Down
1 change: 1 addition & 0 deletions tools/testing/selftests/drivers/gpu/apple-dcp/lifecycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ def function(file, name):
enum usb_role { USB_ROLE_NONE, USB_ROLE_HOST, USB_ROLE_DEVICE };
enum typec_pwr_opmode { TYPEC_PWR_MODE_USB, TYPEC_PWR_MODE_PD };
enum typec_orientation { TYPEC_ORIENTATION_NONE, TYPEC_ORIENTATION_NORMAL, TYPEC_ORIENTATION_REVERSE };
enum typec_data_role { TYPEC_DEVICE, TYPEC_HOST };
struct usb_pd_identity { int id; };
static void * __attribute__((unused)) memchr_inv(const void *p, int c, size_t n)
{ const unsigned char *b = p; for (size_t i = 0; i < n; i++) if (b[i] != (unsigned char)c) return (void *)(b + i); return NULL; }
Expand Down
Loading