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

usb: typec: intel_pmc_mux: Configure Displayport Alternate mode 2.1

Mux agent driver can configure cable details such as cable type and
cable speed received as a part of displayport configuration to support
Displayport Alternate mode 2.1.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Utkarsh Patel <utkarsh.h.patel@intel.com>
Link: https://lore.kernel.org/r/20230920023243.2494410-6-utkarsh.h.patel@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Utkarsh Patel and committed by
Greg Kroah-Hartman
6c29de68 70ca6c73

+24
+24
drivers/usb/typec/mux/intel_pmc_mux.c
··· 191 191 return port->orientation - 1; 192 192 } 193 193 194 + static bool is_pmc_mux_tbt(struct acpi_device *adev) 195 + { 196 + return acpi_dev_hid_uid_match(adev, "INTC1072", NULL) || 197 + acpi_dev_hid_uid_match(adev, "INTC1079", NULL); 198 + } 199 + 194 200 static int pmc_usb_send_command(struct intel_scu_ipc_dev *ipc, u8 *msg, u32 len) 195 201 { 196 202 u8 response[4]; ··· 298 292 299 293 req.mode_data |= (state->mode - TYPEC_STATE_MODAL) << 300 294 PMC_USB_ALTMODE_DP_MODE_SHIFT; 295 + 296 + if (!is_pmc_mux_tbt(port->pmc->iom_adev)) { 297 + u8 cable_speed = (data->conf & DP_CONF_SIGNALLING_MASK) >> 298 + DP_CONF_SIGNALLING_SHIFT; 299 + 300 + u8 cable_type = (data->conf & DP_CONF_CABLE_TYPE_MASK) >> 301 + DP_CONF_CABLE_TYPE_SHIFT; 302 + 303 + req.mode_data |= PMC_USB_ALTMODE_CABLE_SPD(cable_speed); 304 + 305 + if (cable_type == DP_CONF_CABLE_TYPE_OPTICAL) 306 + req.mode_data |= PMC_USB_ALTMODE_CABLE_TYPE; 307 + else if (cable_type == DP_CONF_CABLE_TYPE_RE_TIMER) 308 + req.mode_data |= PMC_USB_ALTMODE_ACTIVE_CABLE | 309 + PMC_USB_ALTMODE_RETIMER_CABLE; 310 + else if (cable_type == DP_CONF_CABLE_TYPE_RE_DRIVER) 311 + req.mode_data |= PMC_USB_ALTMODE_ACTIVE_CABLE; 312 + } 301 313 302 314 ret = pmc_usb_command(port, (void *)&req, sizeof(req)); 303 315 if (ret)