Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

usb: typec: ucsi: Add UCSI_USB4_IMPLIES_USB quirk for X1E80100

On X1E80100, when we connect a USB4 capable dock, the PARTNER_FLAGS
indicate USB4_GEN3 being set whilst keeping the PARTNER_FLAGS_USB
cleared. Due to this, during ucsi_partner_change call, the usb role
is marked as ROLE_NONE and passed to DWC3 controller the same way.

Fix this by adding UCSI_USB4_IMPLIES_USB quirk and check for it to
decide and pass on proper ROLE information to DWC3 layer.

Signed-off-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://patch.msgid.link/20260312101431.2375709-1-krishna.kurapati@oss.qualcomm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Krishna Kurapati and committed by
Greg Kroah-Hartman
0c8ee850 849fbecd

+9 -2
+4 -2
drivers/usb/typec/ucsi/ucsi.c
··· 1184 1184 } 1185 1185 } 1186 1186 1187 - /* Only notify USB controller if partner supports USB data */ 1188 - if (!(UCSI_CONSTAT(con, PARTNER_FLAG_USB))) 1187 + if ((!UCSI_CONSTAT(con, PARTNER_FLAG_USB)) && 1188 + ((con->ucsi->quirks & UCSI_USB4_IMPLIES_USB) && 1189 + (!(UCSI_CONSTAT(con, PARTNER_FLAG_USB4_GEN3) || 1190 + UCSI_CONSTAT(con, PARTNER_FLAG_USB4_GEN4))))) 1189 1191 u_role = USB_ROLE_NONE; 1190 1192 1191 1193 ret = usb_role_switch_set_role(con->usb_role_sw, u_role);
+3
drivers/usb/typec/ucsi/ucsi.h
··· 497 497 unsigned long quirks; 498 498 #define UCSI_NO_PARTNER_PDOS BIT(0) /* Don't read partner's PDOs */ 499 499 #define UCSI_DELAY_DEVICE_PDOS BIT(1) /* Reading PDOs fails until the parter is in PD mode */ 500 + 501 + /* USB4 connection can imply that USB communcation is supported */ 502 + #define UCSI_USB4_IMPLIES_USB BIT(2) 500 503 }; 501 504 502 505 #define UCSI_MAX_DATA_LENGTH(u) (((u)->version < UCSI_VERSION_2_0) ? 0x10 : 0xff)
+2
drivers/usb/typec/ucsi/ucsi_glink.c
··· 371 371 static unsigned long quirk_sc8180x = UCSI_NO_PARTNER_PDOS; 372 372 static unsigned long quirk_sc8280xp = UCSI_NO_PARTNER_PDOS | UCSI_DELAY_DEVICE_PDOS; 373 373 static unsigned long quirk_sm8450 = UCSI_DELAY_DEVICE_PDOS; 374 + static unsigned long quirk_x1e80100 = UCSI_DELAY_DEVICE_PDOS | UCSI_USB4_IMPLIES_USB; 374 375 375 376 static const struct of_device_id pmic_glink_ucsi_of_quirks[] = { 376 377 { .compatible = "qcom,glymur-pmic-glink", .data = &quirk_sm8450, }, ··· 382 381 { .compatible = "qcom,sm8350-pmic-glink", .data = &quirk_sc8180x, }, 383 382 { .compatible = "qcom,sm8450-pmic-glink", .data = &quirk_sm8450, }, 384 383 { .compatible = "qcom,sm8550-pmic-glink", .data = &quirk_sm8450, }, 384 + { .compatible = "qcom,x1e80100-pmic-glink", .data = &quirk_x1e80100, }, 385 385 {} 386 386 }; 387 387