Re: [PATCH v2 06/10] usb: tcpm: skip state machine for pd-disable ports

Sebastian Reichel <[email protected]>
Newsgroups gmane.comp.boot-loaders.u-boot.general,gmane.comp.boot-loaders.u-boot
Message-ID <ano9_Sj_h36TZCpb@venus>
Hi,

On Sun, Jun 21, 2026 at 10:06:42AM +0800, Peng Fan (OSS) wrote:
> From: Peng Fan <[email protected]>
> 
> Check the pd-disable property in the connector node during
> tcpm_post_probe(). When set, skip tcpm_port_init() and
> tcpm_poll_event() so the TCPCI driver is probed (I2C accessible,
> ops available) but the PD state machine does not run.
> 
> This is needed for dual-role data ports where running the state
> machine during probe would disrupt an already-established USB
> connection.
> 
> Signed-off-by: Peng Fan <[email protected]>
> ---

Reviewed-by: Sebastian Reichel <[email protected]>

-- Sebastian

>  drivers/usb/tcpm/tcpm.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/tcpm/tcpm.c b/drivers/usb/tcpm/tcpm.c
> index 1ce46118fea..32c67b8886e 100644
> --- a/drivers/usb/tcpm/tcpm.c
> +++ b/drivers/usb/tcpm/tcpm.c
> @@ -2306,8 +2306,15 @@ static void tcpm_poll_event(struct udevice *dev)
>  
>  int tcpm_post_probe(struct udevice *dev)
>  {
> -	int ret = tcpm_port_init(dev);
> +	const struct dm_tcpm_ops *drvops = dev_get_driver_ops(dev);
> +	ofnode connector;
> +	int ret;
> +
> +	ret = drvops->get_connector_node(dev, &connector);
> +	if (!ret && ofnode_read_bool(connector, "pd-disable"))
> +		return 0;
>  
> +	ret = tcpm_port_init(dev);
>  	if (ret < 0) {
>  		dev_err(dev, "failed to tcpm port init\n");
>  		return ret;
> 
> -- 
> 2.51.0
>
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAmp6PhIACgkQ2O7X88g7
+pp83hAAlV6s1nX/HP5ZegKrk9nU2HHgnFbCAcbSGaFC4mw+O0buPgeM4bVXE3kF
KkYQlJya+b/kWlMl/T1Fssdwz/UWhGPvFVIJUXeK8MrTjLPZaU9Z27WtNRqIipR6
N9Bt8s+DeJaqz9+9Y+u+09/rlDls0CHffTmvygVPjyXpb53laiekpmxzqexkjX99
T9RRDs6Rg36iyYKk6t2KU+Q7tj1GcgDK9b8bGXY9XiimM9kADZwbSKO8o8nemFPn
Y7SLaPwrGiO2n3TPoTr5sgpbxf2jGBiuQiQ/XBKuEf7xb57kY40Q9Cn4pTLkG8fk
J8wbFm+Q/NuidBNiM2gDF4Ypv/fbx6dOnEGjaMT/ZdpnGsryjiZ2sH6eE+kiUrQo
cKVCK8+pPexjza+FR/VV3QCY8GQ4EcxonGV5Tvl4ajZ7Ki1Az+92Npf/olOlwSkb
zRrkczn/Y1IfMt6Uwxrw+2e0lnv8oN+3mSn2Bysv5A1gKZE5gcxN7XqG7cY55g1R
TKEh77Duy+vg2juDe6D0WdkMln3VITZQvDuKTyAg1qtydP0aWDjAQbYqHpw0Lq8+
dfi7R7hyRoc2l7uwgDDmDTQxRVtKS6LFZhEuruRE9quXcKdAU6/Tw/KeZx5SBFiq
w28rMnKtHEOPFvJtxQS/j5Uha/NIAf6w36EaNvy8ohdVjFhiBmU=
=Lmv7
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.