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 6E30ED20695 for ; Thu, 4 Dec 2025 13:42:24 +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=TkwOrKiylX3z0mmoa8F5GFgXarLS0kj8E6Bv1TpGMXs=; b=mK7Uvo3Y8Lb66W /Owiv0k8rL3Kg/r5b6LpnpBWdnqwCa0bsDBWfDxUrNxQvEuo+aHTWct2Nk+Y1xKIFnJYUvRYEGTrG vEP2MZpMG7/VPopfE+Ou3Dlx2ZJtiS9oRvgUY+kbK2NAp82OUyC7CpsLcAz0+G/ppJgl2OQVOtfmU E2QKHx+9rJAJbCfWAQ4yD3tUcfW9XsiKBRPi50s2dUHVFoV9LrVUQqRPE+q4miG7vZH7AzVT/3JZC Iq3sr9K6wdnK/2wjlJdgm27ymCAjpw3JteixrHlyXrLCUHPBFi/vu4axjISTLPR8wIwd0Q6xLiV/k jVCv1aS5u/NwymgioHrw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vR9bE-000000084Ow-0Z0Y; Thu, 04 Dec 2025 13:42:24 +0000 Received: from mgamail.intel.com ([192.198.163.14]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vR9b9-000000084Nw-2hAj; Thu, 04 Dec 2025 13:42:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1764855739; x=1796391739; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=30wP0TX1VK3UbNCz19GHE9bCOLKLD8pr5Gzk2VuxvGw=; b=J7OdXf88VyB6clJ4hxA884AlVbem4J/36zELpUTUsx2ijzaaLFdQ76Aq Y79iBGYKWX7fMJkm9Mke+XENN8f1GzDZrqXeJoYI4I0jnK49FhvwW5iQp 3aJfqeOhaNFbbSWHViBXRxP3Nl9umH6EApoKeuICF1r/RKU5tfCwz0azw C6XrxAxqrlUOfT4pXb62Ls1SND/XqGHcnbDfaBDUQ7qhq+nU0zyHi5gtV Sdxzu215tt3yUwzC/h+hp9yHPDpjz2YFKpASLBUxgbNATh7b/a6HGCgKZ jhPcbt59Zd1N7eNRiNPFovFZneaWsFJJIkw71M8Rq1nbJK/SDr0fdv3vY g==; X-CSE-ConnectionGUID: NwMioDJ2SEW5Q/KTl+h45g== X-CSE-MsgGUID: 5l76NYeUTuO+er16hLYgtg== X-IronPort-AV: E=McAfee;i="6800,10657,11632"; a="66911018" X-IronPort-AV: E=Sophos;i="6.20,248,1758610800"; d="scan'208";a="66911018" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2025 05:42:18 -0800 X-CSE-ConnectionGUID: DxyftxzaSmuGPOccXE4iKQ== X-CSE-MsgGUID: kBWCfuAfTk6HBNfipdewYA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.20,248,1758610800"; d="scan'208";a="199164378" Received: from rfrazer-mobl3.amr.corp.intel.com (HELO kuha) ([10.124.220.149]) by orviesa003.jf.intel.com with SMTP; 04 Dec 2025 05:42:05 -0800 Received: by kuha (sSMTP sendmail emulation); Thu, 04 Dec 2025 15:41:56 +0200 Date: Thu, 4 Dec 2025 15:41:56 +0200 From: Heikki Krogerus To: Chaoyi Chen Cc: Greg Kroah-Hartman , Dmitry Baryshkov , Peter Chen , Luca Ceresoli , 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 , Chaoyi Chen , 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: [RESEND PATCH v11 02/11] usb: typec: Export typec bus and typec altmode device type Message-ID: References: <20251204063109.104-1-kernel@airkyi.com> <20251204063109.104-3-kernel@airkyi.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20251204063109.104-3-kernel@airkyi.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20251204_054219_697065_0FF367DA X-CRM114-Status: GOOD ( 20.54 ) 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 Thu, Dec 04, 2025 at 02:31:00PM +0800, Chaoyi Chen kirjoitti: > From: Chaoyi Chen > > The DRM may want to register a notifier on the typec bus to know when > a typec altmode device is added, and distinguish between different > types of typec altmode device. > > Export these things. > > Signed-off-by: Chaoyi Chen Reviewed-by: Heikki Krogerus > --- > > Changes in v11: > - Also export typec bus. > - Add more detailed comments. > > (no changes since v9) > > drivers/usb/typec/bus.c | 1 + > drivers/usb/typec/bus.h | 10 ---------- > drivers/usb/typec/class.c | 3 +++ > include/linux/usb/typec.h | 3 +++ > include/linux/usb/typec_altmode.h | 8 ++++++++ > 5 files changed, 15 insertions(+), 10 deletions(-) > > diff --git a/drivers/usb/typec/bus.c b/drivers/usb/typec/bus.c > index a33da7f458a5..e84b134a3381 100644 > --- a/drivers/usb/typec/bus.c > +++ b/drivers/usb/typec/bus.c > @@ -569,3 +569,4 @@ const struct bus_type typec_bus = { > .probe = typec_probe, > .remove = typec_remove, > }; > +EXPORT_SYMBOL_GPL(typec_bus); > diff --git a/drivers/usb/typec/bus.h b/drivers/usb/typec/bus.h > index b58e131450d1..7df5deb1dd3a 100644 > --- a/drivers/usb/typec/bus.h > +++ b/drivers/usb/typec/bus.h > @@ -5,7 +5,6 @@ > > #include > > -struct bus_type; > struct typec_mux; > struct typec_retimer; > > @@ -28,13 +27,4 @@ struct altmode { > > #define to_altmode(d) container_of(d, struct altmode, adev) > > -extern const struct bus_type typec_bus; > -extern const struct device_type typec_port_altmode_dev_type; > -extern const struct device_type typec_plug_altmode_dev_type; > -extern const struct device_type typec_partner_altmode_dev_type; > - > -#define is_typec_port_altmode(dev) ((dev)->type == &typec_port_altmode_dev_type) > -#define is_typec_plug_altmode(dev) ((dev)->type == &typec_plug_altmode_dev_type) > -#define is_typec_partner_altmode(dev) ((dev)->type == &typec_partner_altmode_dev_type) > - > #endif /* __USB_TYPEC_ALTMODE_H__ */ > diff --git a/drivers/usb/typec/class.c b/drivers/usb/typec/class.c > index d6b88317f8a4..c4ff4310ff58 100644 > --- a/drivers/usb/typec/class.c > +++ b/drivers/usb/typec/class.c > @@ -537,18 +537,21 @@ const struct device_type typec_port_altmode_dev_type = { > .groups = typec_altmode_groups, > .release = typec_altmode_release, > }; > +EXPORT_SYMBOL_GPL(typec_port_altmode_dev_type); > > const struct device_type typec_plug_altmode_dev_type = { > .name = "typec_plug_alternate_mode", > .groups = typec_altmode_groups, > .release = typec_altmode_release, > }; > +EXPORT_SYMBOL_GPL(typec_plug_altmode_dev_type); > > const struct device_type typec_partner_altmode_dev_type = { > .name = "typec_partner_alternate_mode", > .groups = typec_altmode_groups, > .release = typec_altmode_release, > }; > +EXPORT_SYMBOL_GPL(typec_partner_altmode_dev_type); > > static struct typec_altmode * > typec_register_altmode(struct device *parent, > diff --git a/include/linux/usb/typec.h b/include/linux/usb/typec.h > index 309251572e2e..c6fd46902fce 100644 > --- a/include/linux/usb/typec.h > +++ b/include/linux/usb/typec.h > @@ -20,12 +20,15 @@ struct typec_port; > struct typec_altmode_ops; > struct typec_cable_ops; > > +struct bus_type; > struct fwnode_handle; > struct device; > > struct usb_power_delivery; > struct usb_power_delivery_desc; > > +extern const struct bus_type typec_bus; > + > enum typec_port_type { > TYPEC_PORT_SRC, > TYPEC_PORT_SNK, > diff --git a/include/linux/usb/typec_altmode.h b/include/linux/usb/typec_altmode.h > index f7db3bd4c90e..9197a4637a93 100644 > --- a/include/linux/usb/typec_altmode.h > +++ b/include/linux/usb/typec_altmode.h > @@ -9,6 +9,14 @@ > > #define MODE_DISCOVERY_MAX 6 > > +extern const struct device_type typec_port_altmode_dev_type; > +extern const struct device_type typec_plug_altmode_dev_type; > +extern const struct device_type typec_partner_altmode_dev_type; > + > +#define is_typec_port_altmode(dev) ((dev)->type == &typec_port_altmode_dev_type) > +#define is_typec_plug_altmode(dev) ((dev)->type == &typec_plug_altmode_dev_type) > +#define is_typec_partner_altmode(dev) ((dev)->type == &typec_partner_altmode_dev_type) > + > struct typec_altmode_ops; > > /** > -- > 2.51.1 -- heikki -- linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy