* [PATCH] usb: typec: fusb302: add DRM DP HPD bridge support
@ 2026-03-10 17:17 Sebastian Reichel
2026-03-11 13:43 ` Heikki Krogerus
2026-03-13 8:15 ` Alexey Charkov
0 siblings, 2 replies; 5+ messages in thread
From: Sebastian Reichel @ 2026-03-10 17:17 UTC (permalink / raw)
To: Heikki Krogerus, Greg Kroah-Hartman
Cc: Dmitry Baryshkov, Alexey Charkov, linux-usb, linux-kernel, kernel,
Sebastian Reichel
Add support to use fusb302 based USB-C connectors with the DP altmode
helper code on devicetree based platforms. To get this working there
must be a DRM bridge chain from the DisplayPort controller to the USB-C
connector. E.g. on Rockchip RK3576:
root@rk3576 # cat /sys/kernel/debug/dri/0/encoder-0/bridges
bridge[0]: dw_dp_bridge_funcs
refcount: 7
type: [10] DP
OF: /soc/dp@27e40000:rockchip,rk3576-dp
ops: [0x47] detect edid hpd
bridge[1]: drm_aux_bridge_funcs
refcount: 4
type: [0] Unknown
OF: /soc/phy@2b010000:rockchip,rk3576-usbdp-phy
ops: [0x0]
bridge[2]: drm_aux_hpd_bridge_funcs
refcount: 5
type: [10] DP
OF: /soc/i2c@2ac50000/typec-portc@22/connector:usb-c-connector
ops: [0x4] hpd
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
---
To make this usable on Rockchip RK3588 and RK3576 platforms as shown in
the commit message, the Designware DP driver and the USBDP PHY driver
also need changes. Those are being send separately as the fusb302 patch
can be merged completley independently.
---
drivers/usb/typec/tcpm/Kconfig | 2 ++
drivers/usb/typec/tcpm/fusb302.c | 13 +++++++++++++
2 files changed, 15 insertions(+)
diff --git a/drivers/usb/typec/tcpm/Kconfig b/drivers/usb/typec/tcpm/Kconfig
index 8cdd84ca5d6f..00baa7503d45 100644
--- a/drivers/usb/typec/tcpm/Kconfig
+++ b/drivers/usb/typec/tcpm/Kconfig
@@ -58,6 +58,8 @@ config TYPEC_FUSB302
tristate "Fairchild FUSB302 Type-C chip driver"
depends on I2C
depends on EXTCON || !EXTCON
+ depends on DRM || DRM=n
+ select DRM_AUX_HPD_BRIDGE if DRM_BRIDGE && OF
help
The Fairchild FUSB302 Type-C chip driver that works with
Type-C Port Controller Manager to provide USB PD and USB
diff --git a/drivers/usb/typec/tcpm/fusb302.c b/drivers/usb/typec/tcpm/fusb302.c
index 19ff8217818e..ce7069fb4be6 100644
--- a/drivers/usb/typec/tcpm/fusb302.c
+++ b/drivers/usb/typec/tcpm/fusb302.c
@@ -5,6 +5,7 @@
* Fairchild FUSB302 Type-C Chip Driver
*/
+#include <drm/bridge/aux-bridge.h>
#include <linux/debugfs.h>
#include <linux/delay.h>
#include <linux/errno.h>
@@ -1689,6 +1690,7 @@ static int fusb302_probe(struct i2c_client *client)
{
struct fusb302_chip *chip;
struct i2c_adapter *adapter = client->adapter;
+ struct auxiliary_device *bridge_dev;
struct device *dev = &client->dev;
const char *name;
int ret = 0;
@@ -1747,6 +1749,13 @@ static int fusb302_probe(struct i2c_client *client)
goto destroy_workqueue;
}
+ bridge_dev = devm_drm_dp_hpd_bridge_alloc(chip->dev, to_of_node(chip->tcpc_dev.fwnode));
+ if (IS_ERR(bridge_dev)) {
+ ret = PTR_ERR(bridge_dev);
+ dev_err_probe(chip->dev, ret, "failed to alloc bridge\n");
+ goto destroy_workqueue;
+ }
+
chip->tcpm_port = tcpm_register_port(&client->dev, &chip->tcpc_dev);
if (IS_ERR(chip->tcpm_port)) {
fwnode_handle_put(chip->tcpc_dev.fwnode);
@@ -1764,6 +1773,10 @@ static int fusb302_probe(struct i2c_client *client)
enable_irq_wake(chip->gpio_int_n_irq);
i2c_set_clientdata(client, chip);
+ ret = devm_drm_dp_hpd_bridge_add(chip->dev, bridge_dev);
+ if (ret)
+ return ret;
+
return ret;
tcpm_unregister_port:
---
base-commit: 6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f
change-id: 20260310-fusb302-drm-dp-hpd-bridge-00f6c9aec3ab
Best regards,
--
Sebastian Reichel <sebastian.reichel@collabora.com>
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] usb: typec: fusb302: add DRM DP HPD bridge support
2026-03-10 17:17 [PATCH] usb: typec: fusb302: add DRM DP HPD bridge support Sebastian Reichel
@ 2026-03-11 13:43 ` Heikki Krogerus
2026-03-13 8:15 ` Alexey Charkov
1 sibling, 0 replies; 5+ messages in thread
From: Heikki Krogerus @ 2026-03-11 13:43 UTC (permalink / raw)
To: Sebastian Reichel
Cc: Greg Kroah-Hartman, Dmitry Baryshkov, Alexey Charkov, linux-usb,
linux-kernel, kernel
Tue, Mar 10, 2026 at 06:17:34PM +0100, Sebastian Reichel kirjoitti:
> Add support to use fusb302 based USB-C connectors with the DP altmode
> helper code on devicetree based platforms. To get this working there
> must be a DRM bridge chain from the DisplayPort controller to the USB-C
> connector. E.g. on Rockchip RK3576:
>
> root@rk3576 # cat /sys/kernel/debug/dri/0/encoder-0/bridges
> bridge[0]: dw_dp_bridge_funcs
> refcount: 7
> type: [10] DP
> OF: /soc/dp@27e40000:rockchip,rk3576-dp
> ops: [0x47] detect edid hpd
> bridge[1]: drm_aux_bridge_funcs
> refcount: 4
> type: [0] Unknown
> OF: /soc/phy@2b010000:rockchip,rk3576-usbdp-phy
> ops: [0x0]
> bridge[2]: drm_aux_hpd_bridge_funcs
> refcount: 5
> type: [10] DP
> OF: /soc/i2c@2ac50000/typec-portc@22/connector:usb-c-connector
> ops: [0x4] hpd
>
> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> ---
> To make this usable on Rockchip RK3588 and RK3576 platforms as shown in
> the commit message, the Designware DP driver and the USBDP PHY driver
> also need changes. Those are being send separately as the fusb302 patch
> can be merged completley independently.
> ---
> drivers/usb/typec/tcpm/Kconfig | 2 ++
> drivers/usb/typec/tcpm/fusb302.c | 13 +++++++++++++
> 2 files changed, 15 insertions(+)
>
> diff --git a/drivers/usb/typec/tcpm/Kconfig b/drivers/usb/typec/tcpm/Kconfig
> index 8cdd84ca5d6f..00baa7503d45 100644
> --- a/drivers/usb/typec/tcpm/Kconfig
> +++ b/drivers/usb/typec/tcpm/Kconfig
> @@ -58,6 +58,8 @@ config TYPEC_FUSB302
> tristate "Fairchild FUSB302 Type-C chip driver"
> depends on I2C
> depends on EXTCON || !EXTCON
> + depends on DRM || DRM=n
> + select DRM_AUX_HPD_BRIDGE if DRM_BRIDGE && OF
> help
> The Fairchild FUSB302 Type-C chip driver that works with
> Type-C Port Controller Manager to provide USB PD and USB
> diff --git a/drivers/usb/typec/tcpm/fusb302.c b/drivers/usb/typec/tcpm/fusb302.c
> index 19ff8217818e..ce7069fb4be6 100644
> --- a/drivers/usb/typec/tcpm/fusb302.c
> +++ b/drivers/usb/typec/tcpm/fusb302.c
> @@ -5,6 +5,7 @@
> * Fairchild FUSB302 Type-C Chip Driver
> */
>
> +#include <drm/bridge/aux-bridge.h>
> #include <linux/debugfs.h>
> #include <linux/delay.h>
> #include <linux/errno.h>
> @@ -1689,6 +1690,7 @@ static int fusb302_probe(struct i2c_client *client)
> {
> struct fusb302_chip *chip;
> struct i2c_adapter *adapter = client->adapter;
> + struct auxiliary_device *bridge_dev;
> struct device *dev = &client->dev;
> const char *name;
> int ret = 0;
> @@ -1747,6 +1749,13 @@ static int fusb302_probe(struct i2c_client *client)
> goto destroy_workqueue;
> }
>
> + bridge_dev = devm_drm_dp_hpd_bridge_alloc(chip->dev, to_of_node(chip->tcpc_dev.fwnode));
> + if (IS_ERR(bridge_dev)) {
> + ret = PTR_ERR(bridge_dev);
> + dev_err_probe(chip->dev, ret, "failed to alloc bridge\n");
> + goto destroy_workqueue;
> + }
> +
> chip->tcpm_port = tcpm_register_port(&client->dev, &chip->tcpc_dev);
> if (IS_ERR(chip->tcpm_port)) {
> fwnode_handle_put(chip->tcpc_dev.fwnode);
> @@ -1764,6 +1773,10 @@ static int fusb302_probe(struct i2c_client *client)
> enable_irq_wake(chip->gpio_int_n_irq);
> i2c_set_clientdata(client, chip);
>
> + ret = devm_drm_dp_hpd_bridge_add(chip->dev, bridge_dev);
> + if (ret)
> + return ret;
> +
> return ret;
>
> tcpm_unregister_port:
>
> ---
> base-commit: 6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f
> change-id: 20260310-fusb302-drm-dp-hpd-bridge-00f6c9aec3ab
>
> Best regards,
> --
> Sebastian Reichel <sebastian.reichel@collabora.com>
--
heikki
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] usb: typec: fusb302: add DRM DP HPD bridge support
2026-03-10 17:17 [PATCH] usb: typec: fusb302: add DRM DP HPD bridge support Sebastian Reichel
2026-03-11 13:43 ` Heikki Krogerus
@ 2026-03-13 8:15 ` Alexey Charkov
2026-03-13 15:23 ` Sebastian Reichel
1 sibling, 1 reply; 5+ messages in thread
From: Alexey Charkov @ 2026-03-13 8:15 UTC (permalink / raw)
To: Sebastian Reichel
Cc: Heikki Krogerus, Greg Kroah-Hartman, Dmitry Baryshkov, linux-usb,
linux-kernel, kernel
Hi Sebastian,
On Tue, Mar 10, 2026 at 9:17 PM Sebastian Reichel
<sebastian.reichel@collabora.com> wrote:
>
> Add support to use fusb302 based USB-C connectors with the DP altmode
> helper code on devicetree based platforms. To get this working there
> must be a DRM bridge chain from the DisplayPort controller to the USB-C
> connector. E.g. on Rockchip RK3576:
>
> root@rk3576 # cat /sys/kernel/debug/dri/0/encoder-0/bridges
> bridge[0]: dw_dp_bridge_funcs
> refcount: 7
> type: [10] DP
> OF: /soc/dp@27e40000:rockchip,rk3576-dp
> ops: [0x47] detect edid hpd
> bridge[1]: drm_aux_bridge_funcs
> refcount: 4
> type: [0] Unknown
> OF: /soc/phy@2b010000:rockchip,rk3576-usbdp-phy
> ops: [0x0]
> bridge[2]: drm_aux_hpd_bridge_funcs
> refcount: 5
> type: [10] DP
> OF: /soc/i2c@2ac50000/typec-portc@22/connector:usb-c-connector
> ops: [0x4] hpd
>
> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
> ---
> To make this usable on Rockchip RK3588 and RK3576 platforms as shown in
> the commit message, the Designware DP driver and the USBDP PHY driver
> also need changes. Those are being send separately as the fusb302 patch
> can be merged completley independently.
> ---
> drivers/usb/typec/tcpm/Kconfig | 2 ++
> drivers/usb/typec/tcpm/fusb302.c | 13 +++++++++++++
> 2 files changed, 15 insertions(+)
>
> diff --git a/drivers/usb/typec/tcpm/Kconfig b/drivers/usb/typec/tcpm/Kconfig
> index 8cdd84ca5d6f..00baa7503d45 100644
> --- a/drivers/usb/typec/tcpm/Kconfig
> +++ b/drivers/usb/typec/tcpm/Kconfig
> @@ -58,6 +58,8 @@ config TYPEC_FUSB302
> tristate "Fairchild FUSB302 Type-C chip driver"
> depends on I2C
> depends on EXTCON || !EXTCON
> + depends on DRM || DRM=n
> + select DRM_AUX_HPD_BRIDGE if DRM_BRIDGE && OF
> help
> The Fairchild FUSB302 Type-C chip driver that works with
> Type-C Port Controller Manager to provide USB PD and USB
> diff --git a/drivers/usb/typec/tcpm/fusb302.c b/drivers/usb/typec/tcpm/fusb302.c
> index 19ff8217818e..ce7069fb4be6 100644
> --- a/drivers/usb/typec/tcpm/fusb302.c
> +++ b/drivers/usb/typec/tcpm/fusb302.c
> @@ -5,6 +5,7 @@
> * Fairchild FUSB302 Type-C Chip Driver
> */
>
> +#include <drm/bridge/aux-bridge.h>
> #include <linux/debugfs.h>
> #include <linux/delay.h>
> #include <linux/errno.h>
> @@ -1689,6 +1690,7 @@ static int fusb302_probe(struct i2c_client *client)
> {
> struct fusb302_chip *chip;
> struct i2c_adapter *adapter = client->adapter;
> + struct auxiliary_device *bridge_dev;
> struct device *dev = &client->dev;
> const char *name;
> int ret = 0;
> @@ -1747,6 +1749,13 @@ static int fusb302_probe(struct i2c_client *client)
> goto destroy_workqueue;
> }
>
> + bridge_dev = devm_drm_dp_hpd_bridge_alloc(chip->dev, to_of_node(chip->tcpc_dev.fwnode));
> + if (IS_ERR(bridge_dev)) {
> + ret = PTR_ERR(bridge_dev);
> + dev_err_probe(chip->dev, ret, "failed to alloc bridge\n");
> + goto destroy_workqueue;
> + }
> +
> chip->tcpm_port = tcpm_register_port(&client->dev, &chip->tcpc_dev);
> if (IS_ERR(chip->tcpm_port)) {
> fwnode_handle_put(chip->tcpc_dev.fwnode);
> @@ -1764,6 +1773,10 @@ static int fusb302_probe(struct i2c_client *client)
> enable_irq_wake(chip->gpio_int_n_irq);
> i2c_set_clientdata(client, chip);
>
> + ret = devm_drm_dp_hpd_bridge_add(chip->dev, bridge_dev);
> + if (ret)
> + return ret;
> +
> return ret;
Nit: how about
return devm_drm_dp_hpd_bridge_add(chip->dev, bridge_dev);
Saves three lines :)
Thanks a lot,
Alexey
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] usb: typec: fusb302: add DRM DP HPD bridge support
2026-03-13 8:15 ` Alexey Charkov
@ 2026-03-13 15:23 ` Sebastian Reichel
2026-03-13 18:09 ` Dmitry Baryshkov
0 siblings, 1 reply; 5+ messages in thread
From: Sebastian Reichel @ 2026-03-13 15:23 UTC (permalink / raw)
To: Alexey Charkov
Cc: Heikki Krogerus, Greg Kroah-Hartman, Dmitry Baryshkov, linux-usb,
linux-kernel, kernel
[-- Attachment #1: Type: text/plain, Size: 1125 bytes --]
Hi,
On Fri, Mar 13, 2026 at 12:15:08PM +0400, Alexey Charkov wrote:
> [...]
> > + ret = devm_drm_dp_hpd_bridge_add(chip->dev, bridge_dev);
> > + if (ret)
> > + return ret;
> > +
> > return ret;
>
> Nit: how about
>
> return devm_drm_dp_hpd_bridge_add(chip->dev, bridge_dev);
>
> Saves three lines :)
The patch got queued already. I can provide a follow-up patch if
that is something people want to see. Generally this is a style
decision handled differently between subsystems. Your suggestion
saves three lines and is more efficient (but compiler will optimize
to that anyways). Meanwhile the version I provided results in
smaller diff when more code is appended in the probe function or
the order has to be changed for some reason.
FWIW I would like to see this driver be more converted towards
device managed resource and then use drm_dp_hpd_bridge_register()
instead of doing the allocation and add step separetely. But I
would wait with the cleanup until the 7.2 cycle as
devm_alloc_ordered_workqueue() will land in 7.1.
Greetings,
-- Sebastian
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] usb: typec: fusb302: add DRM DP HPD bridge support
2026-03-13 15:23 ` Sebastian Reichel
@ 2026-03-13 18:09 ` Dmitry Baryshkov
0 siblings, 0 replies; 5+ messages in thread
From: Dmitry Baryshkov @ 2026-03-13 18:09 UTC (permalink / raw)
To: Sebastian Reichel
Cc: Alexey Charkov, Heikki Krogerus, Greg Kroah-Hartman,
Dmitry Baryshkov, linux-usb, linux-kernel, kernel
On Fri, 13 Mar 2026 at 17:23, Sebastian Reichel
<sebastian.reichel@collabora.com> wrote:
>
> Hi,
>
> On Fri, Mar 13, 2026 at 12:15:08PM +0400, Alexey Charkov wrote:
> > [...]
> > > + ret = devm_drm_dp_hpd_bridge_add(chip->dev, bridge_dev);
> > > + if (ret)
> > > + return ret;
> > > +
> > > return ret;
> >
> > Nit: how about
> >
> > return devm_drm_dp_hpd_bridge_add(chip->dev, bridge_dev);
> >
> > Saves three lines :)
>
> The patch got queued already. I can provide a follow-up patch if
> that is something people want to see. Generally this is a style
> decision handled differently between subsystems. Your suggestion
> saves three lines and is more efficient (but compiler will optimize
> to that anyways). Meanwhile the version I provided results in
> smaller diff when more code is appended in the probe function or
> the order has to be changed for some reason.
>
> FWIW I would like to see this driver be more converted towards
> device managed resource and then use drm_dp_hpd_bridge_register()
This API is more fragile. Using it can result in various side effects,
starting from EPROBE_DEFER loops if it is used in a wrong place.
Other bridges might also get the pointed to the bridge and then
witness its disappearance.
I think in the long term we should remove that API completely.
> instead of doing the allocation and add step separetely. But I
> would wait with the cleanup until the 7.2 cycle as
> devm_alloc_ordered_workqueue() will land in 7.1.
>
> Greetings,
>
> -- Sebastian
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-03-13 18:09 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-10 17:17 [PATCH] usb: typec: fusb302: add DRM DP HPD bridge support Sebastian Reichel
2026-03-11 13:43 ` Heikki Krogerus
2026-03-13 8:15 ` Alexey Charkov
2026-03-13 15:23 ` Sebastian Reichel
2026-03-13 18:09 ` Dmitry Baryshkov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox