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 938F9CCF9FE for ; Mon, 3 Nov 2025 13:48:32 +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-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Ze5+JnSH8NPqlQ4jz670TjSKkxO5p9wrJg9ec7aHAgk=; b=jkXP1mVplEkRv2 52K8RdJ4146QGrtbWiS7TDCJh2lHdPzt5zmo8Q5GSJNMmj3TQotRB9UbTY3mU8XCmBAEzt5cT2CTt VXbSpkI9BUtNAytbsY1C6UmblzV2ookgIwBAUyIUAr2db5aBx1Au1TjqE8858+VKcNu7TR9y5PaxF WoXGILMkZNHBeAaB3S+i7EBW7n25FA0RsHXC5xHEatuPp+DKRw0j73aghpnbzP9tTQhTztZQydyMT p3s3cI81b3iT5Fm26b1I64lu6PpNO++XzB9EHOqeWTT8G0K6ldO4K265S6ayI0LZYeaufPN5xbYL0 RezUmkJFm5dZoliujirA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vFuvA-00000009x5B-0fXZ; Mon, 03 Nov 2025 13:48:32 +0000 Received: from mgamail.intel.com ([198.175.65.21]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vFuv7-00000009x2g-0qdk; Mon, 03 Nov 2025 13:48:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1762177709; x=1793713709; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=/eMBTgNJH8/Xgm8LgLzir6GKHePQ75zTAgJlicmNsfQ=; b=WoEhzKYemBdcD8PsWNzNw5GpGsxipF4zNsvDD+kJ2q/ZJ1zCjXBRV9RO +kDYMo58SBbvdtNm3qvOkFRT4cLQKAIJL1k+cSiHArylAXKORuXJNPQUZ rk9nQDIQZ5fQwo6P8yAdJz+kxNS7OX0PROUXsQdNSqPttJWviXv2jUwP5 kbi0SaprYUKwk8m7Nvv9e/IJVxVvbZaDVJA0G5bEJRO0q7ZEauOL91BMq 5e+4mnRp/YEMA9bD9RnHI2/7Fg2o41yDlr+GJj3kHANHAoQ0wOC+c0rq+ UlanJs6L+8YuY8QsEp72pk1iZ4m45rcZjmIXYONRN13YSF/AiYa9b7WPI Q==; X-CSE-ConnectionGUID: ZCumIJWDSemHRqGUVoD/rQ== X-CSE-MsgGUID: KquS19ZySMiehBBYXz6Uuw== X-IronPort-AV: E=McAfee;i="6800,10657,11531"; a="64156335" X-IronPort-AV: E=Sophos;i="6.17,312,1747724400"; d="scan'208";a="64156335" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Nov 2025 05:48:28 -0800 X-CSE-ConnectionGUID: JFm5J5b9STC09kNJqEZ1eA== X-CSE-MsgGUID: J32ocSpgR2yn1eLsQx1Tpg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.19,276,1754982000"; d="scan'208";a="186110382" Received: from aschofie-mobl2.amr.corp.intel.com (HELO kuha.fi.intel.com) ([10.124.220.222]) by orviesa006.jf.intel.com with SMTP; 03 Nov 2025 05:48:11 -0800 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Mon, 03 Nov 2025 15:48:09 +0200 Date: Mon, 3 Nov 2025 15:48:09 +0200 From: Heikki Krogerus To: Chaoyi Chen Cc: Dmitry Baryshkov , Chaoyi Chen , Greg Kroah-Hartman , 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 Subject: Re: [PATCH v8 03/10] drm/bridge: Implement generic USB Type-C DP HPD bridge Message-ID: References: <20251029071435.88-1-kernel@airkyi.com> <20251029071435.88-4-kernel@airkyi.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20251103_054829_286153_AD1D7397 X-CRM114-Status: GOOD ( 31.49 ) 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org > > > diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kconfig > > > index a250afd8d662..17257b223a28 100644 > > > --- a/drivers/gpu/drm/bridge/Kconfig > > > +++ b/drivers/gpu/drm/bridge/Kconfig > > > @@ -23,13 +23,16 @@ config DRM_AUX_BRIDGE > > > build bridges chain. > > > config DRM_AUX_HPD_BRIDGE > > > - tristate > > > + tristate "AUX HPD bridge support" > > Why? No, this is supposed to be selected by other drivers. Users don't > > know an wouldn't know what is this. > > In v7, I implemented an additional module for selecting this option. But > Heikki believes that it would be better to merge the two modules into one. Like I said before, I was merely curious why not just squash the support into that AUX_PD_HPD_BRIDGE. If that does not make sense, then so be it - make it a "Display Interface Bridge" driver like you originally proposed. > > > depends on DRM_BRIDGE && OF > > > select AUXILIARY_BUS > > > help > > > Simple bridge that terminates the bridge chain and provides HPD > > > support. > > > + Specifically, if you want a default Type-C DisplayPort HPD bridge for > > > + each port of the Type-C controller, say Y here. > > > + > > > 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..2998937444bc 100644 > > > --- a/drivers/gpu/drm/bridge/Makefile > > > +++ b/drivers/gpu/drm/bridge/Makefile > > > @@ -1,6 +1,12 @@ > > > # SPDX-License-Identifier: GPL-2.0 > > > obj-$(CONFIG_DRM_AUX_BRIDGE) += aux-bridge.o > > > -obj-$(CONFIG_DRM_AUX_HPD_BRIDGE) += aux-hpd-bridge.o > > > + > > > +hpd-bridge-y := aux-hpd-bridge.o > > > +ifneq ($(CONFIG_TYPEC),) > > > +hpd-bridge-y += aux-hpd-typec-dp-bridge.o > > > +endif > > > +obj-$(CONFIG_DRM_AUX_HPD_BRIDGE) += hpd-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-bridge.c b/drivers/gpu/drm/bridge/aux-hpd-bridge.c > > > index 2e9c702c7087..11ad6dc776c7 100644 > > > --- a/drivers/gpu/drm/bridge/aux-hpd-bridge.c > > > +++ b/drivers/gpu/drm/bridge/aux-hpd-bridge.c > > > @@ -12,6 +12,8 @@ > > > #include > > > #include > > > +#include "aux-hpd-bridge.h" > > > + > > > static DEFINE_IDA(drm_aux_hpd_bridge_ida); > > > struct drm_aux_hpd_bridge_data { > > > @@ -204,7 +206,26 @@ static struct auxiliary_driver drm_aux_hpd_bridge_drv = { > > > .id_table = drm_aux_hpd_bridge_table, > > > .probe = drm_aux_hpd_bridge_probe, > > > }; > > > -module_auxiliary_driver(drm_aux_hpd_bridge_drv); > > > + > > > +static int drm_aux_hpd_bridge_mod_init(void) > > > +{ > > > + int ret; > > > + > > > + ret = auxiliary_driver_register(&drm_aux_hpd_bridge_drv); > > > + if (ret) > > > + return ret; > > > + > > > + return drm_aux_hpd_typec_dp_bridge_init(); > > > +} > > > + > > > +static void drm_aux_hpd_bridge_mod_exit(void) > > > +{ > > > + drm_aux_hpd_typec_dp_bridge_exit(); > > > + auxiliary_driver_unregister(&drm_aux_hpd_bridge_drv); > > > +} > > > + > > > +module_init(drm_aux_hpd_bridge_mod_init); > > > +module_exit(drm_aux_hpd_bridge_mod_exit); > > > MODULE_AUTHOR("Dmitry Baryshkov "); > > > MODULE_DESCRIPTION("DRM HPD bridge"); > > > diff --git a/drivers/gpu/drm/bridge/aux-hpd-bridge.h b/drivers/gpu/drm/bridge/aux-hpd-bridge.h > > > new file mode 100644 > > > index 000000000000..69364731c2f1 > > > --- /dev/null > > > +++ b/drivers/gpu/drm/bridge/aux-hpd-bridge.h > > > @@ -0,0 +1,13 @@ > > > +/* SPDX-License-Identifier: GPL-2.0-only */ > > > +#ifndef AUX_HPD_BRIDGE_H > > > +#define AUX_HPD_BRIDGE_H > > > + > > > +#if IS_REACHABLE(CONFIG_TYPEC) > > > +int drm_aux_hpd_typec_dp_bridge_init(void); > > > +void drm_aux_hpd_typec_dp_bridge_exit(void); > > > +#else > > > +static inline int drm_aux_hpd_typec_dp_bridge_init(void) { return 0; } > > > +static inline void drm_aux_hpd_typec_dp_bridge_exit(void) { } > > > +#endif /* IS_REACHABLE(CONFIG_TYPEC) */ > > > + > > > +#endif /* AUX_HPD_BRIDGE_H */ > > > 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..6f2a1fca0fc5 > > > --- /dev/null > > > +++ b/drivers/gpu/drm/bridge/aux-hpd-typec-dp-bridge.c > > > @@ -0,0 +1,47 @@ > > > +// SPDX-License-Identifier: GPL-2.0+ > > > +#include > > > +#include > > > +#include > > > +#include > > > + > > > +#include > > > + > > > +#include "aux-hpd-bridge.h" > > > + > > > +#if IS_REACHABLE(CONFIG_TYPEC) > > > +static int drm_typec_bus_event(struct notifier_block *nb, > > > + unsigned long action, void *data) > > > +{ > > This feels like this should be a part of the Type-C subsystem rather > > than DRM. > > In v7, this used to be a part of the Type-C subsystem. I'm not sure what > Heikki thinks about this. Your original proposal of making the entire TYPEC subsystem depend on DRM is _not_ going to happen. In general, if I've now understood this correctly, this thing probable should be a "display interface bridge driver", similar to what you proposed in the previous version. Note also that you could make it selected automatically, so there is no need for user selectable option if that's the preference. Kconfig and Makefile gives you options on how to do that. For example, maybe this Kconfig works (or does not, but something like it will): diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kconfig index a250afd8d662..7487024ba2ce 100644 --- a/drivers/gpu/drm/bridge/Kconfig +++ b/drivers/gpu/drm/bridge/Kconfig @@ -30,6 +30,15 @@ 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 + +endif /* DRM_AUX_HPD_BRIDGE */ + menu "Display Interface Bridges" depends on DRM && DRM_BRIDGE thanks, -- heikki -- linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy