[PATCH 11/11] usb: typec: tipd: Handle mode transitions for CD321x
Janne Grunau
j at jannau.net
Sun Sep 14 06:29:29 PDT 2025
On Sun, Sep 14, 2025 at 12:56:16PM +0000, Sven Peter wrote:
> From: Hector Martin <marcan at marcan.st>
>
> On Apple Silicon machines there is no control over which alt mode is
> chosen. The CD321x' firmware negotiates the target mode on its own and
> only lets the main CPU know after the mode has already been chosen.
> Especially after plugging a new cable in this can result to quick mode
> changes from e.g. power only -> USB3 only -> USB3+DisplayPort in a short
> time. It is not possile to influence this in any way and we also do not
> get direct access to the PDOs or VDOs exchanged via USB PD.
>
> Additionally, mode changes must be tightly synchronized between DWC3 and
> the Type C PHY and most mode changes require a full reset of DWC3 to
> make the port work correctly.
> This is all done synchronously from the role switch handler inside the
> DWC3 glue driver on these machines to avoid tripping any failsafes or
> watchdogs inside the Type-C PHY that may, in the worst case, reset the
> entire SoC.
>
> To be able to control all this we trigger the entire process in the
> correct order directly from the TIPD driver and de-bounce any mode
> changes to avoid tearing down and re-setting DWC3 back up multiple times
> any time a new connection is made.
>
> Signed-off-by: Hector Martin <marcan at marcan.st>
> Reviewed-by: Heikki Krogerus <heikki.krogerus at linux.intel.com>
> Reviewed-by: Neal Gompa <neal at gompa.dev>
> Co-developed-by: Sven Peter <sven at kernel.org>
> Signed-off-by: Sven Peter <sven at kernel.org>
> ---
> drivers/usb/typec/tipd/core.c | 290 +++++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 286 insertions(+), 4 deletions(-)
Reviewed-by: Janne Grunau <j at jannau.net>
Janne
More information about the linux-arm-kernel
mailing list