linux/drivers/usb/typec
Jameson Thies 0be3870f7c usb: typec: ucsi: Check capabilities before cable and identity discovery
Check the UCSI_CAP_GET_PD_MESSAGE bit before sending GET_PD_MESSAGE to
discover partner and cable identity, check UCSI_CAP_CABLE_DETAILS before
sending GET_CABLE_PROPERTY to discover the cable and check
UCSI_CAP_ALT_MODE_DETAILS before registering the a cable plug. Additionally,
move 8 bits from reserved_1 to features in the ucsi_capability struct. This
makes the field 16 bits, still 8 short of the 24 bits allocated for it in
UCSI v3.0, but it will not overflow because UCSI only defines 14 bits in
bmOptionalFeatures.

Fixes: 38ca416597 ("usb: typec: ucsi: Register cables based on GET_CABLE_PROPERTY")
Link: https://lore.kernel.org/linux-usb/44e8142f-d9b3-487b-83fe-39deadddb492@linaro.org
Suggested-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Jameson Thies <jthies@google.com>
Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on SM8550-QRD
Reviewed-by: Benson Leung <bleung@chromium.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20240315171836.343830-2-jthies@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-03-26 15:01:15 +01:00
..
altmodes USB/Thunderbolt changes for 6.9-rc1 2024-03-21 12:35:20 -07:00
mux usb: typec: mux: Add ITE IT5205 Alternate Mode Passive MUX driver 2024-01-27 16:44:14 -08:00
tcpm usb: typec: tcpm: Update PD of Type-C port upon pd_set 2024-03-26 11:02:18 +01:00
tipd usb: typec: tipd: fix use of device-specific init function 2024-01-05 13:52:53 +01:00
ucsi usb: typec: ucsi: Check capabilities before cable and identity discovery 2024-03-26 15:01:15 +01:00
anx7411.c usb: typec: drop check because i2c_unregister_device() is NULL safe 2023-10-02 13:56:37 +02:00
bus.c usb: typec: altmodes: add typec_cable_ops to typec_altmode 2024-01-27 17:38:25 -08:00
bus.h USB: mark all struct bus_type as const 2023-03-23 13:22:00 +01:00
class.c usb: typec: Return size of buffer if pd_set operation succeeds 2024-03-26 14:59:13 +01:00
class.h usb: typec: constify struct class usage 2024-03-02 20:21:06 +01:00
hd3ss3220.c usb: Switch i2c drivers back to use .probe() 2023-05-29 15:53:11 +01:00
Kconfig usb: typec: qcom: Add Qualcomm PMIC Type-C driver 2023-05-13 19:03:46 +09:00
Makefile usb: typec: qcom: Add Qualcomm PMIC Type-C driver 2023-05-13 19:03:46 +09:00
mux.c usb: typec: constify struct class usage 2024-03-02 20:21:06 +01:00
mux.h
pd.c usb: typec: constify the struct device_type usage 2024-02-19 09:35:46 +01:00
pd.h
port-mapper.c usb: typec: Link enumerated USB devices with Type-C partner 2023-10-16 20:02:36 +02:00
retimer.c usb: typec: constify struct class usage 2024-03-02 20:21:06 +01:00
retimer.h usb: typec: Make bus switch code retimer-aware 2023-01-17 17:29:00 +01:00
rt1719.c usb: Switch i2c drivers back to use .probe() 2023-05-29 15:53:11 +01:00
stusb160x.c usb: Switch i2c drivers back to use .probe() 2023-05-29 15:53:11 +01:00
wusb3801.c usb: Switch i2c drivers back to use .probe() 2023-05-29 15:53:11 +01:00