Merge tag 'usb-5.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
[ddiss/linux.git] / drivers / usb / typec / mux / intel_pmc_mux.c
index e4021e13af40a3b3b440b9eed1fa53887a513fa1..ec7da0fa3cf8c6c54b430d9edeb97a7c47e567af 100644 (file)
@@ -61,14 +61,11 @@ enum {
 
 #define PMC_USB_ALTMODE_ORI_SHIFT      1
 #define PMC_USB_ALTMODE_UFP_SHIFT      3
-#define PMC_USB_ALTMODE_ORI_AUX_SHIFT  4
-#define PMC_USB_ALTMODE_ORI_HSL_SHIFT  5
 
 /* DP specific Mode Data bits */
 #define PMC_USB_ALTMODE_DP_MODE_SHIFT  8
 
 /* TBT specific Mode Data bits */
-#define PMC_USB_ALTMODE_HPD_HIGH       BIT(14)
 #define PMC_USB_ALTMODE_TBT_TYPE       BIT(17)
 #define PMC_USB_ALTMODE_CABLE_TYPE     BIT(18)
 #define PMC_USB_ALTMODE_ACTIVE_LINK    BIT(20)
@@ -179,15 +176,9 @@ pmc_usb_mux_dp(struct pmc_usb_port *port, struct typec_mux_state *state)
        req.mode_data = (port->orientation - 1) << PMC_USB_ALTMODE_ORI_SHIFT;
        req.mode_data |= (port->role - 1) << PMC_USB_ALTMODE_UFP_SHIFT;
 
-       req.mode_data |= sbu_orientation(port) << PMC_USB_ALTMODE_ORI_AUX_SHIFT;
-       req.mode_data |= hsl_orientation(port) << PMC_USB_ALTMODE_ORI_HSL_SHIFT;
-
        req.mode_data |= (state->mode - TYPEC_STATE_MODAL) <<
                         PMC_USB_ALTMODE_DP_MODE_SHIFT;
 
-       if (data->status & DP_STATUS_HPD_STATE)
-               req.mode_data |= PMC_USB_ALTMODE_HPD_HIGH;
-
        ret = pmc_usb_command(port, (void *)&req, sizeof(req));
        if (ret)
                return ret;
@@ -212,9 +203,6 @@ pmc_usb_mux_tbt(struct pmc_usb_port *port, struct typec_mux_state *state)
        req.mode_data = (port->orientation - 1) << PMC_USB_ALTMODE_ORI_SHIFT;
        req.mode_data |= (port->role - 1) << PMC_USB_ALTMODE_UFP_SHIFT;
 
-       req.mode_data |= sbu_orientation(port) << PMC_USB_ALTMODE_ORI_AUX_SHIFT;
-       req.mode_data |= hsl_orientation(port) << PMC_USB_ALTMODE_ORI_HSL_SHIFT;
-
        if (TBT_ADAPTER(data->device_mode) == TBT_ADAPTER_TBT3)
                req.mode_data |= PMC_USB_ALTMODE_TBT_TYPE;
 
@@ -497,6 +485,7 @@ err_remove_ports:
        for (i = 0; i < pmc->num_ports; i++) {
                typec_switch_unregister(pmc->port[i].typec_sw);
                typec_mux_unregister(pmc->port[i].typec_mux);
+               usb_role_switch_unregister(pmc->port[i].usb_sw);
        }
 
        return ret;
@@ -510,6 +499,7 @@ static int pmc_usb_remove(struct platform_device *pdev)
        for (i = 0; i < pmc->num_ports; i++) {
                typec_switch_unregister(pmc->port[i].typec_sw);
                typec_mux_unregister(pmc->port[i].typec_mux);
+               usb_role_switch_unregister(pmc->port[i].usb_sw);
        }
 
        return 0;