Re: [PATCH 02/16] usb: typec: tcpm: Add STM32 tcpp driver
From: Marek Vasut
Date: Sat Aug 22 2026 - 03:57:07 EST
On 8/21/26 6:23 PM, Fabrice Gasnier wrote:
From: Christian Bruel <christian.bruel@xxxxxxxxxxx>
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.hModel 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.
@@ -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);