diff mbox series

[v4,1/1] usb: typec: intel_pmc_mux: Configure cable generation value for USB4

Message ID 20201209042408.23079-2-utkarsh.h.patel@intel.com
State New
Headers show
Series Thunderbolt3/USB4 cable rounded and active cable plug link training support | expand

Commit Message

Patel, Utkarsh H Dec. 9, 2020, 4:24 a.m. UTC
USB4 specification chapter 3 indicates that cable data rates have to be
rounded for USB4 device to operate as USB4.
With that configure cable generation value to use rounded data rates for
USB4.

Signed-off-by: Utkarsh Patel <utkarsh.h.patel@intel.com>
---
Changes in v4:
- Removed usage of tbt_mode_vdo since data rates should always be rounded
  in the case of USB4.
- Updated commit message to reflect the change.

Changes in v3:
- Moved TBT_CABLE_ROUNDED_SUPPORT assignment to the same line.

Changes in v2:
- No change.
---
 drivers/usb/typec/mux/intel_pmc_mux.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Heikki Krogerus Dec. 10, 2020, 11:50 a.m. UTC | #1
On Tue, Dec 08, 2020 at 08:24:08PM -0800, Utkarsh Patel wrote:
> USB4 specification chapter 3 indicates that cable data rates have to be
> rounded for USB4 device to operate as USB4.
> With that configure cable generation value to use rounded data rates for
> USB4.
> 
> Signed-off-by: Utkarsh Patel <utkarsh.h.patel@intel.com>

Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>

> ---
> Changes in v4:
> - Removed usage of tbt_mode_vdo since data rates should always be rounded
>   in the case of USB4.
> - Updated commit message to reflect the change.
> 
> Changes in v3:
> - Moved TBT_CABLE_ROUNDED_SUPPORT assignment to the same line.
> 
> Changes in v2:
> - No change.
> ---
>  drivers/usb/typec/mux/intel_pmc_mux.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/usb/typec/mux/intel_pmc_mux.c b/drivers/usb/typec/mux/intel_pmc_mux.c
> index e58ae8a7fefb..cf37a59ce130 100644
> --- a/drivers/usb/typec/mux/intel_pmc_mux.c
> +++ b/drivers/usb/typec/mux/intel_pmc_mux.c
> @@ -327,6 +327,11 @@ pmc_usb_mux_usb4(struct pmc_usb_port *port, struct typec_mux_state *state)
>  		fallthrough;
>  	default:
>  		req.mode_data |= PMC_USB_ALTMODE_ACTIVE_CABLE;
> +
> +		/* Configure data rate to rounded in the case of Active TBT3
> +		 * and USB4 cables.
> +		 */
> +		req.mode_data |= PMC_USB_ALTMODE_TBT_GEN(1);
>  		break;
>  	}
>  
> -- 
> 2.17.1
diff mbox series

Patch

diff --git a/drivers/usb/typec/mux/intel_pmc_mux.c b/drivers/usb/typec/mux/intel_pmc_mux.c
index e58ae8a7fefb..cf37a59ce130 100644
--- a/drivers/usb/typec/mux/intel_pmc_mux.c
+++ b/drivers/usb/typec/mux/intel_pmc_mux.c
@@ -327,6 +327,11 @@  pmc_usb_mux_usb4(struct pmc_usb_port *port, struct typec_mux_state *state)
 		fallthrough;
 	default:
 		req.mode_data |= PMC_USB_ALTMODE_ACTIVE_CABLE;
+
+		/* Configure data rate to rounded in the case of Active TBT3
+		 * and USB4 cables.
+		 */
+		req.mode_data |= PMC_USB_ALTMODE_TBT_GEN(1);
 		break;
 	}