drivers/usb/typec/tcpm/Kconfig | 2 ++ drivers/usb/typec/tcpm/tcpci.c | 13 +++++++++++++ 2 files changed, 15 insertions(+)
Add support to use TCPCI based USB-C connectors with the DP AltMode
helper code on devicetree based platforms.
Signed-off-by: Alexey Charkov <alchark@flipper.net>
---
drivers/usb/typec/tcpm/Kconfig | 2 ++
drivers/usb/typec/tcpm/tcpci.c | 13 +++++++++++++
2 files changed, 15 insertions(+)
diff --git a/drivers/usb/typec/tcpm/Kconfig b/drivers/usb/typec/tcpm/Kconfig
index 00baa7503d45..53abde8ebef9 100644
--- a/drivers/usb/typec/tcpm/Kconfig
+++ b/drivers/usb/typec/tcpm/Kconfig
@@ -13,7 +13,9 @@ if TYPEC_TCPM
config TYPEC_TCPCI
tristate "Type-C Port Controller Interface driver"
+ depends on DRM || DRM=n
depends on I2C
+ select DRM_AUX_HPD_BRIDGE if DRM_BRIDGE && OF
select REGMAP_I2C
help
Type-C Port Controller driver for TCPCI-compliant controller.
diff --git a/drivers/usb/typec/tcpm/tcpci.c b/drivers/usb/typec/tcpm/tcpci.c
index 0148b8f50412..e6cccbd377f7 100644
--- a/drivers/usb/typec/tcpm/tcpci.c
+++ b/drivers/usb/typec/tcpm/tcpci.c
@@ -5,6 +5,7 @@
* USB Type-C Port Controller Interface.
*/
+#include <drm/bridge/aux-bridge.h>
#include <linux/bitfield.h>
#include <linux/delay.h>
#include <linux/gpio/consumer.h>
@@ -837,6 +838,7 @@ static int tcpci_parse_config(struct tcpci *tcpci)
struct tcpci *tcpci_register_port(struct device *dev, struct tcpci_data *data)
{
+ struct auxiliary_device *bridge_dev;
struct tcpci *tcpci;
int err;
@@ -889,12 +891,23 @@ struct tcpci *tcpci_register_port(struct device *dev, struct tcpci_data *data)
if (err < 0)
return ERR_PTR(err);
+ bridge_dev = devm_drm_dp_hpd_bridge_alloc(tcpci->dev, to_of_node(tcpci->tcpc.fwnode));
+ if (IS_ERR(bridge_dev))
+ return ERR_CAST(bridge_dev);
+
tcpci->port = tcpm_register_port(tcpci->dev, &tcpci->tcpc);
if (IS_ERR(tcpci->port)) {
fwnode_handle_put(tcpci->tcpc.fwnode);
return ERR_CAST(tcpci->port);
}
+ err = devm_drm_dp_hpd_bridge_add(tcpci->dev, bridge_dev);
+ if (err < 0) {
+ tcpm_unregister_port(tcpci->port);
+ fwnode_handle_put(tcpci->tcpc.fwnode);
+ return ERR_PTR(err);
+ }
+
return tcpci;
}
EXPORT_SYMBOL_GPL(tcpci_register_port);
---
base-commit: e98d21c170b01ddef366f023bbfcf6b31509fa83
change-id: 20260513-tcpci-drm-bridge-d8dc384d71ee
Best regards,
--
Alexey Charkov <alchark@flipper.net>
Hi Alexey,
On Wed, May 13, 2026 at 05:43:16PM +0400, Alexey Charkov wrote:
> Add support to use TCPCI based USB-C connectors with the DP AltMode
> helper code on devicetree based platforms.
We should be getting a generic HPD bridge, I think that should work
in this case as well:
https://lore.kernel.org/lkml/20260304094152.92-2-kernel@airkyi.com/
Can you please check that?
thanks,
> Signed-off-by: Alexey Charkov <alchark@flipper.net>
> ---
> drivers/usb/typec/tcpm/Kconfig | 2 ++
> drivers/usb/typec/tcpm/tcpci.c | 13 +++++++++++++
> 2 files changed, 15 insertions(+)
>
> diff --git a/drivers/usb/typec/tcpm/Kconfig b/drivers/usb/typec/tcpm/Kconfig
> index 00baa7503d45..53abde8ebef9 100644
> --- a/drivers/usb/typec/tcpm/Kconfig
> +++ b/drivers/usb/typec/tcpm/Kconfig
> @@ -13,7 +13,9 @@ if TYPEC_TCPM
>
> config TYPEC_TCPCI
> tristate "Type-C Port Controller Interface driver"
> + depends on DRM || DRM=n
> depends on I2C
> + select DRM_AUX_HPD_BRIDGE if DRM_BRIDGE && OF
> select REGMAP_I2C
> help
> Type-C Port Controller driver for TCPCI-compliant controller.
> diff --git a/drivers/usb/typec/tcpm/tcpci.c b/drivers/usb/typec/tcpm/tcpci.c
> index 0148b8f50412..e6cccbd377f7 100644
> --- a/drivers/usb/typec/tcpm/tcpci.c
> +++ b/drivers/usb/typec/tcpm/tcpci.c
> @@ -5,6 +5,7 @@
> * USB Type-C Port Controller Interface.
> */
>
> +#include <drm/bridge/aux-bridge.h>
> #include <linux/bitfield.h>
> #include <linux/delay.h>
> #include <linux/gpio/consumer.h>
> @@ -837,6 +838,7 @@ static int tcpci_parse_config(struct tcpci *tcpci)
>
> struct tcpci *tcpci_register_port(struct device *dev, struct tcpci_data *data)
> {
> + struct auxiliary_device *bridge_dev;
> struct tcpci *tcpci;
> int err;
>
> @@ -889,12 +891,23 @@ struct tcpci *tcpci_register_port(struct device *dev, struct tcpci_data *data)
> if (err < 0)
> return ERR_PTR(err);
>
> + bridge_dev = devm_drm_dp_hpd_bridge_alloc(tcpci->dev, to_of_node(tcpci->tcpc.fwnode));
> + if (IS_ERR(bridge_dev))
> + return ERR_CAST(bridge_dev);
> +
> tcpci->port = tcpm_register_port(tcpci->dev, &tcpci->tcpc);
> if (IS_ERR(tcpci->port)) {
> fwnode_handle_put(tcpci->tcpc.fwnode);
> return ERR_CAST(tcpci->port);
> }
>
> + err = devm_drm_dp_hpd_bridge_add(tcpci->dev, bridge_dev);
> + if (err < 0) {
> + tcpm_unregister_port(tcpci->port);
> + fwnode_handle_put(tcpci->tcpc.fwnode);
> + return ERR_PTR(err);
> + }
> +
> return tcpci;
> }
> EXPORT_SYMBOL_GPL(tcpci_register_port);
>
> ---
> base-commit: e98d21c170b01ddef366f023bbfcf6b31509fa83
> change-id: 20260513-tcpci-drm-bridge-d8dc384d71ee
>
> Best regards,
> --
> Alexey Charkov <alchark@flipper.net>
--
heikki
© 2016 - 2026 Red Hat, Inc.