Re: [PATCH 02/16] usb: typec: tcpm: Add STM32 tcpp driver

Marek Vasut <[email protected]>
Newsgroups org.infradead.lists.linux-phy,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel,org.kernel.vger.linux-usb
Message-ID <[email protected]>
On 8/21/26 6:23 PM, Fabrice Gasnier wrote:
> From: Christian Bruel <[email protected]>
> 
> Add support for the STMicroelectronics TCPP02 and TCPP03 USB-C PD
> protection for dual role power (DRP).
> It can be used with the STM32 family embedding UCPD controller.

[...]

> +++ b/drivers/usb/typec/tcpm/st_tcpp.h
> @@ -0,0 +1,21 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +/*
> + * Copyright (C) 2026 STMicroelectronics
> + */
> +
> +#ifndef __ST_TCPP_H__
> +#define __ST_TCPP_H__
> +
> +typedef void (*tcpp_vbus_cb_t)(void *data, bool vbus_present);
> +
> +int tcpp_init(struct device *tcpp);
> +void tcpp_deinit(struct device *tcpp);
> +int tcpp_get_vbus(struct device *tcpp);
> +int tcpp_set_vbus(struct device *tcpp, bool on, bool charge);
> +int tcpp_set_vconn(struct device *dev, bool on, enum typec_cc_polarity polarity);
> +int tcpp_attach(struct device *tcpp);
> +int tcpp_detach(struct device *tcpp);
> +int tcpp_register_vbus_notifier(struct device *dev, tcpp_vbus_cb_t cb, void *data);
> +void tcpp_unregister_vbus_notifier(struct device *dev);
Model the TCPP as four GPIOs and you won't need any of this 
horribleness. Have a look at the UCPD driver I posted two days ago, 
"[PATCH 2/4] usb: typec: ucpd: Add ST UCPD driver", it operates TCPP 
exactly that way.

-- 
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy
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.