[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250914132929.GA1645557@robin.jannau.net>
Date: Sun, 14 Sep 2025 15:29:29 +0200
From: Janne Grunau <j@...nau.net>
To: Sven Peter <sven@...nel.org>
Cc: Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Neal Gompa <neal@...pa.dev>, linux-usb@...r.kernel.org,
linux-kernel@...r.kernel.org, asahi@...ts.linux.dev,
linux-arm-kernel@...ts.infradead.org,
Hector Martin <marcan@...can.st>
Subject: Re: [PATCH 11/11] usb: typec: tipd: Handle mode transitions for
CD321x
On Sun, Sep 14, 2025 at 12:56:16PM +0000, Sven Peter wrote:
> From: Hector Martin <marcan@...can.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@...can.st>
> Reviewed-by: Heikki Krogerus <heikki.krogerus@...ux.intel.com>
> Reviewed-by: Neal Gompa <neal@...pa.dev>
> Co-developed-by: Sven Peter <sven@...nel.org>
> Signed-off-by: Sven Peter <sven@...nel.org>
> ---
> drivers/usb/typec/tipd/core.c | 290 +++++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 286 insertions(+), 4 deletions(-)
Reviewed-by: Janne Grunau <j@...nau.net>
Janne
Powered by blists - more mailing lists