From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1BFF7CE8D6B for ; Mon, 17 Nov 2025 08:47:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=/VyBu/i0fSLSIZpB/cn2Lo04jmSlwZbXvvGuWwLCrig=; b=DqAzqfTtHykb7Y6D1ZdfyghJ5F 7V75MlSqkp2sh0uXHqDqlL0p+pngtPQY2WQJFn1gGZJbsT/m3BAshnxfR9n6Ru3MVeCZJX02TNdB9 O7wZ9JHtTnf8HwVWRhNk11MT7DEaSPTJeCcG/3GL6O69CC0M69R/KdolYbNs9BVcvjmAG+k0BDVBV izs/yMIiCYIDczo8z9GOkF8F4FvYZi++mcpsjqSTdNIGxOA/ClZR+23+DWsWaC82yetKBFtoGcmeE A6Kuojulr6ln92C43+z+u9b3KjjYCVobgqrvgQdJxsGHdmWbJK7nDTNSr4nLLFmXTuCuu+UpMyJRz FmY8Z2FA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vKutc-0000000FiIB-1STU; Mon, 17 Nov 2025 08:47:36 +0000 Received: from mail-m21470.qiye.163.com ([117.135.214.70]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vKutZ-0000000FiH0-2WUJ; Mon, 17 Nov 2025 08:47:35 +0000 Received: from [172.16.12.51] (unknown [58.22.7.114]) by smtp.qiye.163.com (Hmail) with ESMTP id 29d4759ae; Mon, 17 Nov 2025 16:47:26 +0800 (GMT+08:00) Message-ID: <140cd555-d512-4712-9d71-2d7f188a74fb@rock-chips.com> Date: Mon, 17 Nov 2025 16:47:25 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v9 03/10] drm/bridge: Implement generic USB Type-C DP HPD bridge To: Heikki Krogerus , Chaoyi Chen Cc: Greg Kroah-Hartman , Dmitry Baryshkov , Peter Chen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Vinod Koul , Kishon Vijay Abraham I , Heiko Stuebner , Sandy Huang , Andy Yan , Yubing Zhang , Frank Wang , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Amit Sunil Dhamne , Dragan Simic , Johan Jonker , Diederik de Haas , Peter Robinson , linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, dri-devel@lists.freedesktop.org References: <20251111105040.94-1-kernel@airkyi.com> <20251111105040.94-4-kernel@airkyi.com> Content-Language: en-US From: Chaoyi Chen In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-HM-Tid: 0a9a90ff5e3f03abkunm2a6b77ad8f27ca X-HM-MType: 1 X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFDSUNOT01LS0k3V1ktWUFJV1kPCRoVCBIfWUFZQkpPQ1ZCHR0ZSE4ZGEkaS0tWFRQJFh oXVRMBExYaEhckFA4PWVdZGBILWUFZTkNVSUlVTFVKSk9ZV1kWGg8SFR0UWUFZT0tIVUpLSEpPSE xVSktLVUpCS0tZBg++ DKIM-Signature: a=rsa-sha256; b=TxAbeCZFY7eqkjxpcivUMqwOH8QFtRL/B2e4tf+GteqsvSZy467ZXu17S6C/ZqVYLBEPPxecTuUo+uZ16WS5iY68xy9ealSCVZp0U6FKLSNqzRNh1vr58YTSeVBSum2ZFTjltiUSSyEJsWu6PKSkNbO0JitC3s7a642vFVxtj4U=; c=relaxed/relaxed; s=default; d=rock-chips.com; v=1; bh=/VyBu/i0fSLSIZpB/cn2Lo04jmSlwZbXvvGuWwLCrig=; h=date:mime-version:subject:message-id:from; X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20251117_004733_914801_23BFAC92 X-CRM114-Status: GOOD ( 24.30 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 11/17/2025 4:40 PM, Heikki Krogerus wrote: > Tue, Nov 11, 2025 at 06:50:33PM +0800, Chaoyi Chen kirjoitti: >> From: Chaoyi Chen >> >> The HPD function of Type-C DP is implemented through >> drm_connector_oob_hotplug_event(). For embedded DP, it is required >> that the DRM connector fwnode corresponds to the Type-C port fwnode. >> >> To describe the relationship between the DP controller and the Type-C >> port device, we usually using drm_bridge to build a bridge chain. >> >> Now several USB-C controller drivers have already implemented the DP >> HPD bridge function provided by aux-hpd-bridge.c, it will build a DP >> HPD bridge on USB-C connector port device. >> >> But this requires the USB-C controller driver to manually register the >> HPD bridge. If the driver does not implement this feature, the bridge >> will not be create. >> >> So this patch implements a generic DP HPD bridge based on >> aux-hpd-bridge.c. It will monitor Type-C bus events, and when a >> Type-C port device containing the DP svid is registered, it will >> create an HPD bridge for it without the need for the USB-C controller >> driver to implement it. >> >> Signed-off-by: Chaoyi Chen > Normally there is no "help" section for hidden config options. I > guess it can not cause any harm? It is a bit confusing, though. But > FWIW: The hidden options "DRM_AUX_BRIDGE" and "DRM_AUX_HPD_BRIDGE" also have a help section. I think this is just for comment purposes :) > > Reviewed-by: Heikki Krogerus > >> --- >> >> Changes in v9: >> - Remove the exposed DRM_AUX_HPD_BRIDGE option, and select >> DRM_AUX_HPD_TYPEC_BRIDGE when it is available. >> - Add more commit comment about problem background. >> >> Changes in v8: >> - Merge generic DP HPD bridge into one module. >> >> drivers/gpu/drm/bridge/Kconfig | 10 ++++ >> drivers/gpu/drm/bridge/Makefile | 1 + >> .../gpu/drm/bridge/aux-hpd-typec-dp-bridge.c | 50 +++++++++++++++++++ >> 3 files changed, 61 insertions(+) >> create mode 100644 drivers/gpu/drm/bridge/aux-hpd-typec-dp-bridge.c >> >> diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kconfig >> index a250afd8d662..559487aa09a9 100644 >> --- a/drivers/gpu/drm/bridge/Kconfig >> +++ b/drivers/gpu/drm/bridge/Kconfig >> @@ -30,6 +30,16 @@ config DRM_AUX_HPD_BRIDGE >> Simple bridge that terminates the bridge chain and provides HPD >> support. >> >> +if DRM_AUX_HPD_BRIDGE >> +config DRM_AUX_HPD_TYPEC_BRIDGE >> + tristate >> + depends on TYPEC || !TYPEC >> + default TYPEC >> + help >> + Simple bridge that terminates the bridge chain and provides HPD >> + support. It build bridge on each USB-C connector device node. >> +endif >> + >> menu "Display Interface Bridges" >> depends on DRM && DRM_BRIDGE >> >> diff --git a/drivers/gpu/drm/bridge/Makefile b/drivers/gpu/drm/bridge/Makefile >> index c7dc03182e59..a3a0393d2e72 100644 >> --- a/drivers/gpu/drm/bridge/Makefile >> +++ b/drivers/gpu/drm/bridge/Makefile >> @@ -1,6 +1,7 @@ >> # SPDX-License-Identifier: GPL-2.0 >> obj-$(CONFIG_DRM_AUX_BRIDGE) += aux-bridge.o >> obj-$(CONFIG_DRM_AUX_HPD_BRIDGE) += aux-hpd-bridge.o >> +obj-$(CONFIG_DRM_AUX_HPD_TYPEC_BRIDGE) += aux-hpd-typec-dp-bridge.o >> obj-$(CONFIG_DRM_CHIPONE_ICN6211) += chipone-icn6211.o >> obj-$(CONFIG_DRM_CHRONTEL_CH7033) += chrontel-ch7033.o >> obj-$(CONFIG_DRM_CROS_EC_ANX7688) += cros-ec-anx7688.o >> diff --git a/drivers/gpu/drm/bridge/aux-hpd-typec-dp-bridge.c b/drivers/gpu/drm/bridge/aux-hpd-typec-dp-bridge.c >> new file mode 100644 >> index 000000000000..9cb6a0cb0f0a >> --- /dev/null >> +++ b/drivers/gpu/drm/bridge/aux-hpd-typec-dp-bridge.c >> @@ -0,0 +1,50 @@ >> +// SPDX-License-Identifier: GPL-2.0+ >> +#include >> +#include >> +#include >> + >> +#include >> + >> +static int drm_typec_bus_event(struct notifier_block *nb, >> + unsigned long action, void *data) >> +{ >> + struct typec_altmode *alt = (struct typec_altmode *)data; >> + >> + if (action != TYPEC_ALTMODE_REGISTERED) >> + goto done; >> + >> + if (is_typec_partner(&alt->dev) || alt->svid != USB_TYPEC_DP_SID) >> + goto done; >> + >> + /* >> + * alt->dev.parent->parent : USB-C controller device >> + * alt->dev.parent : USB-C connector device >> + */ >> + drm_dp_hpd_bridge_register(alt->dev.parent->parent, >> + to_of_node(alt->dev.parent->fwnode)); >> + >> +done: >> + return NOTIFY_OK; >> +} >> + >> +static struct notifier_block drm_typec_event_nb = { >> + .notifier_call = drm_typec_bus_event, >> +}; >> + >> +static void drm_aux_hpd_typec_dp_bridge_module_exit(void) >> +{ >> + typec_altmode_unregister_notify(&drm_typec_event_nb); >> +} >> + >> +static int __init drm_aux_hpd_typec_dp_bridge_module_init(void) >> +{ >> + typec_altmode_register_notify(&drm_typec_event_nb); >> + >> + return 0; >> +} >> + >> +module_init(drm_aux_hpd_typec_dp_bridge_module_init); >> +module_exit(drm_aux_hpd_typec_dp_bridge_module_exit); >> + >> +MODULE_DESCRIPTION("DRM TYPEC DP HPD BRIDGE"); >> +MODULE_LICENSE("GPL"); >> -- >> 2.51.1 -- Best, Chaoyi From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3C9EACEACEF for ; Mon, 17 Nov 2025 08:47:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=JyoPtp3rXm3O4oY+lP1jr2r2Qr0x/n1/+5mAWe8YNVI=; b=DWTr09rACpiye/ 4jV1CsXkYJbkghXFqPKz9lcRHaJ906WSJX5mu0AWyVZBAuqh3Nb325nA0cPylJ2iuIiRU1ZZQNPPJ R/jM9hXPRDXP1+m48DS5A3PfA3a6x/T6FLx0//3otjc2fY0CTZWnkh88QqX9iuOTQ6UjoxmtqhMLp HfobZfR6Ycuw1HZNx+y6mBOq1IqqdgFJQGUCmP7DK9+prL3djp2+ra1UWNX6+jmryj+ULYFaUj7Zr JAhtLZEQ9TQM4w70R0HPtoB4oH1pAGMx1HKKXAA5n2YRkFu13iXY2cDUVlGwCZS9y2DritfQnrHG7 T0wPWv4Xu081q6PT8I5w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vKutb-0000000FiHx-3ZUX; Mon, 17 Nov 2025 08:47:35 +0000 Received: from mail-m21470.qiye.163.com ([117.135.214.70]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vKutZ-0000000FiH0-2WUJ; Mon, 17 Nov 2025 08:47:35 +0000 Received: from [172.16.12.51] (unknown [58.22.7.114]) by smtp.qiye.163.com (Hmail) with ESMTP id 29d4759ae; Mon, 17 Nov 2025 16:47:26 +0800 (GMT+08:00) Message-ID: <140cd555-d512-4712-9d71-2d7f188a74fb@rock-chips.com> Date: Mon, 17 Nov 2025 16:47:25 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v9 03/10] drm/bridge: Implement generic USB Type-C DP HPD bridge To: Heikki Krogerus , Chaoyi Chen Cc: Greg Kroah-Hartman , Dmitry Baryshkov , Peter Chen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Vinod Koul , Kishon Vijay Abraham I , Heiko Stuebner , Sandy Huang , Andy Yan , Yubing Zhang , Frank Wang , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Amit Sunil Dhamne , Dragan Simic , Johan Jonker , Diederik de Haas , Peter Robinson , linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, dri-devel@lists.freedesktop.org References: <20251111105040.94-1-kernel@airkyi.com> <20251111105040.94-4-kernel@airkyi.com> Content-Language: en-US From: Chaoyi Chen In-Reply-To: X-HM-Tid: 0a9a90ff5e3f03abkunm2a6b77ad8f27ca X-HM-MType: 1 X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFDSUNOT01LS0k3V1ktWUFJV1kPCRoVCBIfWUFZQkpPQ1ZCHR0ZSE4ZGEkaS0tWFRQJFh oXVRMBExYaEhckFA4PWVdZGBILWUFZTkNVSUlVTFVKSk9ZV1kWGg8SFR0UWUFZT0tIVUpLSEpPSE xVSktLVUpCS0tZBg++ DKIM-Signature: a=rsa-sha256; b=TxAbeCZFY7eqkjxpcivUMqwOH8QFtRL/B2e4tf+GteqsvSZy467ZXu17S6C/ZqVYLBEPPxecTuUo+uZ16WS5iY68xy9ealSCVZp0U6FKLSNqzRNh1vr58YTSeVBSum2ZFTjltiUSSyEJsWu6PKSkNbO0JitC3s7a642vFVxtj4U=; c=relaxed/relaxed; s=default; d=rock-chips.com; v=1; bh=/VyBu/i0fSLSIZpB/cn2Lo04jmSlwZbXvvGuWwLCrig=; h=date:mime-version:subject:message-id:from; X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20251117_004733_914801_23BFAC92 X-CRM114-Status: GOOD ( 24.30 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org On 11/17/2025 4:40 PM, Heikki Krogerus wrote: > Tue, Nov 11, 2025 at 06:50:33PM +0800, Chaoyi Chen kirjoitti: >> From: Chaoyi Chen >> >> The HPD function of Type-C DP is implemented through >> drm_connector_oob_hotplug_event(). For embedded DP, it is required >> that the DRM connector fwnode corresponds to the Type-C port fwnode. >> >> To describe the relationship between the DP controller and the Type-C >> port device, we usually using drm_bridge to build a bridge chain. >> >> Now several USB-C controller drivers have already implemented the DP >> HPD bridge function provided by aux-hpd-bridge.c, it will build a DP >> HPD bridge on USB-C connector port device. >> >> But this requires the USB-C controller driver to manually register the >> HPD bridge. If the driver does not implement this feature, the bridge >> will not be create. >> >> So this patch implements a generic DP HPD bridge based on >> aux-hpd-bridge.c. It will monitor Type-C bus events, and when a >> Type-C port device containing the DP svid is registered, it will >> create an HPD bridge for it without the need for the USB-C controller >> driver to implement it. >> >> Signed-off-by: Chaoyi Chen > Normally there is no "help" section for hidden config options. I > guess it can not cause any harm? It is a bit confusing, though. But > FWIW: The hidden options "DRM_AUX_BRIDGE" and "DRM_AUX_HPD_BRIDGE" also have a help section. I think this is just for comment purposes :) > > Reviewed-by: Heikki Krogerus > >> --- >> >> Changes in v9: >> - Remove the exposed DRM_AUX_HPD_BRIDGE option, and select >> DRM_AUX_HPD_TYPEC_BRIDGE when it is available. >> - Add more commit comment about problem background. >> >> Changes in v8: >> - Merge generic DP HPD bridge into one module. >> >> drivers/gpu/drm/bridge/Kconfig | 10 ++++ >> drivers/gpu/drm/bridge/Makefile | 1 + >> .../gpu/drm/bridge/aux-hpd-typec-dp-bridge.c | 50 +++++++++++++++++++ >> 3 files changed, 61 insertions(+) >> create mode 100644 drivers/gpu/drm/bridge/aux-hpd-typec-dp-bridge.c >> >> diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kconfig >> index a250afd8d662..559487aa09a9 100644 >> --- a/drivers/gpu/drm/bridge/Kconfig >> +++ b/drivers/gpu/drm/bridge/Kconfig >> @@ -30,6 +30,16 @@ config DRM_AUX_HPD_BRIDGE >> Simple bridge that terminates the bridge chain and provides HPD >> support. >> >> +if DRM_AUX_HPD_BRIDGE >> +config DRM_AUX_HPD_TYPEC_BRIDGE >> + tristate >> + depends on TYPEC || !TYPEC >> + default TYPEC >> + help >> + Simple bridge that terminates the bridge chain and provides HPD >> + support. It build bridge on each USB-C connector device node. >> +endif >> + >> menu "Display Interface Bridges" >> depends on DRM && DRM_BRIDGE >> >> diff --git a/drivers/gpu/drm/bridge/Makefile b/drivers/gpu/drm/bridge/Makefile >> index c7dc03182e59..a3a0393d2e72 100644 >> --- a/drivers/gpu/drm/bridge/Makefile >> +++ b/drivers/gpu/drm/bridge/Makefile >> @@ -1,6 +1,7 @@ >> # SPDX-License-Identifier: GPL-2.0 >> obj-$(CONFIG_DRM_AUX_BRIDGE) += aux-bridge.o >> obj-$(CONFIG_DRM_AUX_HPD_BRIDGE) += aux-hpd-bridge.o >> +obj-$(CONFIG_DRM_AUX_HPD_TYPEC_BRIDGE) += aux-hpd-typec-dp-bridge.o >> obj-$(CONFIG_DRM_CHIPONE_ICN6211) += chipone-icn6211.o >> obj-$(CONFIG_DRM_CHRONTEL_CH7033) += chrontel-ch7033.o >> obj-$(CONFIG_DRM_CROS_EC_ANX7688) += cros-ec-anx7688.o >> diff --git a/drivers/gpu/drm/bridge/aux-hpd-typec-dp-bridge.c b/drivers/gpu/drm/bridge/aux-hpd-typec-dp-bridge.c >> new file mode 100644 >> index 000000000000..9cb6a0cb0f0a >> --- /dev/null >> +++ b/drivers/gpu/drm/bridge/aux-hpd-typec-dp-bridge.c >> @@ -0,0 +1,50 @@ >> +// SPDX-License-Identifier: GPL-2.0+ >> +#include >> +#include >> +#include >> + >> +#include >> + >> +static int drm_typec_bus_event(struct notifier_block *nb, >> + unsigned long action, void *data) >> +{ >> + struct typec_altmode *alt = (struct typec_altmode *)data; >> + >> + if (action != TYPEC_ALTMODE_REGISTERED) >> + goto done; >> + >> + if (is_typec_partner(&alt->dev) || alt->svid != USB_TYPEC_DP_SID) >> + goto done; >> + >> + /* >> + * alt->dev.parent->parent : USB-C controller device >> + * alt->dev.parent : USB-C connector device >> + */ >> + drm_dp_hpd_bridge_register(alt->dev.parent->parent, >> + to_of_node(alt->dev.parent->fwnode)); >> + >> +done: >> + return NOTIFY_OK; >> +} >> + >> +static struct notifier_block drm_typec_event_nb = { >> + .notifier_call = drm_typec_bus_event, >> +}; >> + >> +static void drm_aux_hpd_typec_dp_bridge_module_exit(void) >> +{ >> + typec_altmode_unregister_notify(&drm_typec_event_nb); >> +} >> + >> +static int __init drm_aux_hpd_typec_dp_bridge_module_init(void) >> +{ >> + typec_altmode_register_notify(&drm_typec_event_nb); >> + >> + return 0; >> +} >> + >> +module_init(drm_aux_hpd_typec_dp_bridge_module_init); >> +module_exit(drm_aux_hpd_typec_dp_bridge_module_exit); >> + >> +MODULE_DESCRIPTION("DRM TYPEC DP HPD BRIDGE"); >> +MODULE_LICENSE("GPL"); >> -- >> 2.51.1 -- Best, Chaoyi -- linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 12D53CEBF61 for ; Mon, 17 Nov 2025 08:47:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zv/B14B+LvUFHK1bwTdbvDFxgGzlMCinbTadduATYh8=; b=YB9J4M9V2ZZ+iT OIyVAn/dv+AbgCOjWSUrmdyolFSQOArm4NTobpYMmV04GEcGsaZT2tiRh4iqQm/ALpyiyg5vb38t1 bs6CIVp1HxrYbQOAs0LAaXKhKljhwg8Io3fX2huS7gxYNQON299ai4eHq5UZKjLoDGQA/57XpJNsp vr5Llx6GTKP2MTh7EdwuqKgKhRlPYfDri+0ywnNTfujxMobz5DnoQsPUlQLnFXEG+ZcvnSFzf8An5 Uxa2tOQ2jnlfA4NYdpbOrinOrsqnhao7PGfkpzWQpzf2WafGjhtz0at/nKWf3QHxSvk0zIJx2LvMs h5KwjVIBiws/49Q/j+dw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vKutc-0000000FiI7-0Nvu; Mon, 17 Nov 2025 08:47:36 +0000 Received: from mail-m21470.qiye.163.com ([117.135.214.70]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vKutZ-0000000FiH0-2WUJ; Mon, 17 Nov 2025 08:47:35 +0000 Received: from [172.16.12.51] (unknown [58.22.7.114]) by smtp.qiye.163.com (Hmail) with ESMTP id 29d4759ae; Mon, 17 Nov 2025 16:47:26 +0800 (GMT+08:00) Message-ID: <140cd555-d512-4712-9d71-2d7f188a74fb@rock-chips.com> Date: Mon, 17 Nov 2025 16:47:25 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v9 03/10] drm/bridge: Implement generic USB Type-C DP HPD bridge To: Heikki Krogerus , Chaoyi Chen Cc: Greg Kroah-Hartman , Dmitry Baryshkov , Peter Chen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Vinod Koul , Kishon Vijay Abraham I , Heiko Stuebner , Sandy Huang , Andy Yan , Yubing Zhang , Frank Wang , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Amit Sunil Dhamne , Dragan Simic , Johan Jonker , Diederik de Haas , Peter Robinson , linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, dri-devel@lists.freedesktop.org References: <20251111105040.94-1-kernel@airkyi.com> <20251111105040.94-4-kernel@airkyi.com> Content-Language: en-US From: Chaoyi Chen In-Reply-To: X-HM-Tid: 0a9a90ff5e3f03abkunm2a6b77ad8f27ca X-HM-MType: 1 X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFDSUNOT01LS0k3V1ktWUFJV1kPCRoVCBIfWUFZQkpPQ1ZCHR0ZSE4ZGEkaS0tWFRQJFh oXVRMBExYaEhckFA4PWVdZGBILWUFZTkNVSUlVTFVKSk9ZV1kWGg8SFR0UWUFZT0tIVUpLSEpPSE xVSktLVUpCS0tZBg++ DKIM-Signature: a=rsa-sha256; b=TxAbeCZFY7eqkjxpcivUMqwOH8QFtRL/B2e4tf+GteqsvSZy467ZXu17S6C/ZqVYLBEPPxecTuUo+uZ16WS5iY68xy9ealSCVZp0U6FKLSNqzRNh1vr58YTSeVBSum2ZFTjltiUSSyEJsWu6PKSkNbO0JitC3s7a642vFVxtj4U=; c=relaxed/relaxed; s=default; d=rock-chips.com; v=1; bh=/VyBu/i0fSLSIZpB/cn2Lo04jmSlwZbXvvGuWwLCrig=; h=date:mime-version:subject:message-id:from; X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20251117_004733_914801_23BFAC92 X-CRM114-Status: GOOD ( 24.30 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org On 11/17/2025 4:40 PM, Heikki Krogerus wrote: > Tue, Nov 11, 2025 at 06:50:33PM +0800, Chaoyi Chen kirjoitti: >> From: Chaoyi Chen >> >> The HPD function of Type-C DP is implemented through >> drm_connector_oob_hotplug_event(). For embedded DP, it is required >> that the DRM connector fwnode corresponds to the Type-C port fwnode. >> >> To describe the relationship between the DP controller and the Type-C >> port device, we usually using drm_bridge to build a bridge chain. >> >> Now several USB-C controller drivers have already implemented the DP >> HPD bridge function provided by aux-hpd-bridge.c, it will build a DP >> HPD bridge on USB-C connector port device. >> >> But this requires the USB-C controller driver to manually register the >> HPD bridge. If the driver does not implement this feature, the bridge >> will not be create. >> >> So this patch implements a generic DP HPD bridge based on >> aux-hpd-bridge.c. It will monitor Type-C bus events, and when a >> Type-C port device containing the DP svid is registered, it will >> create an HPD bridge for it without the need for the USB-C controller >> driver to implement it. >> >> Signed-off-by: Chaoyi Chen > Normally there is no "help" section for hidden config options. I > guess it can not cause any harm? It is a bit confusing, though. But > FWIW: The hidden options "DRM_AUX_BRIDGE" and "DRM_AUX_HPD_BRIDGE" also have a help section. I think this is just for comment purposes :) > > Reviewed-by: Heikki Krogerus > >> --- >> >> Changes in v9: >> - Remove the exposed DRM_AUX_HPD_BRIDGE option, and select >> DRM_AUX_HPD_TYPEC_BRIDGE when it is available. >> - Add more commit comment about problem background. >> >> Changes in v8: >> - Merge generic DP HPD bridge into one module. >> >> drivers/gpu/drm/bridge/Kconfig | 10 ++++ >> drivers/gpu/drm/bridge/Makefile | 1 + >> .../gpu/drm/bridge/aux-hpd-typec-dp-bridge.c | 50 +++++++++++++++++++ >> 3 files changed, 61 insertions(+) >> create mode 100644 drivers/gpu/drm/bridge/aux-hpd-typec-dp-bridge.c >> >> diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kconfig >> index a250afd8d662..559487aa09a9 100644 >> --- a/drivers/gpu/drm/bridge/Kconfig >> +++ b/drivers/gpu/drm/bridge/Kconfig >> @@ -30,6 +30,16 @@ config DRM_AUX_HPD_BRIDGE >> Simple bridge that terminates the bridge chain and provides HPD >> support. >> >> +if DRM_AUX_HPD_BRIDGE >> +config DRM_AUX_HPD_TYPEC_BRIDGE >> + tristate >> + depends on TYPEC || !TYPEC >> + default TYPEC >> + help >> + Simple bridge that terminates the bridge chain and provides HPD >> + support. It build bridge on each USB-C connector device node. >> +endif >> + >> menu "Display Interface Bridges" >> depends on DRM && DRM_BRIDGE >> >> diff --git a/drivers/gpu/drm/bridge/Makefile b/drivers/gpu/drm/bridge/Makefile >> index c7dc03182e59..a3a0393d2e72 100644 >> --- a/drivers/gpu/drm/bridge/Makefile >> +++ b/drivers/gpu/drm/bridge/Makefile >> @@ -1,6 +1,7 @@ >> # SPDX-License-Identifier: GPL-2.0 >> obj-$(CONFIG_DRM_AUX_BRIDGE) += aux-bridge.o >> obj-$(CONFIG_DRM_AUX_HPD_BRIDGE) += aux-hpd-bridge.o >> +obj-$(CONFIG_DRM_AUX_HPD_TYPEC_BRIDGE) += aux-hpd-typec-dp-bridge.o >> obj-$(CONFIG_DRM_CHIPONE_ICN6211) += chipone-icn6211.o >> obj-$(CONFIG_DRM_CHRONTEL_CH7033) += chrontel-ch7033.o >> obj-$(CONFIG_DRM_CROS_EC_ANX7688) += cros-ec-anx7688.o >> diff --git a/drivers/gpu/drm/bridge/aux-hpd-typec-dp-bridge.c b/drivers/gpu/drm/bridge/aux-hpd-typec-dp-bridge.c >> new file mode 100644 >> index 000000000000..9cb6a0cb0f0a >> --- /dev/null >> +++ b/drivers/gpu/drm/bridge/aux-hpd-typec-dp-bridge.c >> @@ -0,0 +1,50 @@ >> +// SPDX-License-Identifier: GPL-2.0+ >> +#include >> +#include >> +#include >> + >> +#include >> + >> +static int drm_typec_bus_event(struct notifier_block *nb, >> + unsigned long action, void *data) >> +{ >> + struct typec_altmode *alt = (struct typec_altmode *)data; >> + >> + if (action != TYPEC_ALTMODE_REGISTERED) >> + goto done; >> + >> + if (is_typec_partner(&alt->dev) || alt->svid != USB_TYPEC_DP_SID) >> + goto done; >> + >> + /* >> + * alt->dev.parent->parent : USB-C controller device >> + * alt->dev.parent : USB-C connector device >> + */ >> + drm_dp_hpd_bridge_register(alt->dev.parent->parent, >> + to_of_node(alt->dev.parent->fwnode)); >> + >> +done: >> + return NOTIFY_OK; >> +} >> + >> +static struct notifier_block drm_typec_event_nb = { >> + .notifier_call = drm_typec_bus_event, >> +}; >> + >> +static void drm_aux_hpd_typec_dp_bridge_module_exit(void) >> +{ >> + typec_altmode_unregister_notify(&drm_typec_event_nb); >> +} >> + >> +static int __init drm_aux_hpd_typec_dp_bridge_module_init(void) >> +{ >> + typec_altmode_register_notify(&drm_typec_event_nb); >> + >> + return 0; >> +} >> + >> +module_init(drm_aux_hpd_typec_dp_bridge_module_init); >> +module_exit(drm_aux_hpd_typec_dp_bridge_module_exit); >> + >> +MODULE_DESCRIPTION("DRM TYPEC DP HPD BRIDGE"); >> +MODULE_LICENSE("GPL"); >> -- >> 2.51.1 -- Best, Chaoyi _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip