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 670DDCCF9FE for ; Fri, 31 Oct 2025 13:49:25 +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=2cnwSuzstuDZWZ+xE6t5VzkP6v2zGFFL85Ew+aQVQPo=; b=Eyy1SfMiHPx/Xu UHcxk5+Ec1MPGFi9E75sY+waOJ+ebT10iC0d4tOMXN+6qsd5pc/hpyriWGY58UMNnogDAAS0OAYNB luwdLuDnHikHaMW4pz7wth5bL4LUptuLrm6f9YQ6kaZKY4OXG3aaeNLxJTLA47MC47apLJAbZ1hby xLL3H28Ktm832tCRG34Qe/tMP8COy4c14uFLNj9YAl2kLG1IKu7hucnn/k1pvfagkNL8NyyBC39wB bHTHGDDP60ordrVlcqxX8xUQ2qpXJOj41lWLMlPTPu/cJNVUrUs3kDKAmPcw3VGM0MKYh6bZhbDB+ sdGppK3jt3zt7ihihGqQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vEpVM-00000006Ask-4AHm; Fri, 31 Oct 2025 13:49:25 +0000 Received: from mgamail.intel.com ([192.198.163.7]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vEpVI-00000006ArK-2T6U; Fri, 31 Oct 2025 13:49:21 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1761918561; x=1793454561; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=HYOEnKzDkgpEufqlLglR4PKxYUcxwU5/7H2j5fZg/Vg=; b=BHxRYXWi6DdJ6V3N/WFilCSbHb3k3qr2cJKwETlgkxAH+m2cp4TgaPxZ OiKuWIcDEEf0adbW+XbLh2GsSsu63tNRztRPuDnlNHHipMlCGmOAlGW8V O0vniVjJtshO/NZr42y82vvO+f0v0E6ToT6vKWZrLU1bzqVMqRd9WhtmT W9LihST9jhJoTWtPvHNEz9mU2zmZgdE0ByLtsYEsXRA/vZIM7vZROd3k8 fFHfR7Jm7kZJb9ZBIH92J4wFEqRwa3pvppKNKGjhhBJT6LIcAM73eXwWR 2fWFTQ/oU+FyFtzx/qEN/99sJLL8QMzO15VN11qSqHiwOlZDHwNBGKeoa w==; X-CSE-ConnectionGUID: p8kHvefEQA6mmvZHpibY+w== X-CSE-MsgGUID: gNhBZ71DSRevvPmN6krw9A== X-IronPort-AV: E=McAfee;i="6800,10657,11598"; a="89542978" X-IronPort-AV: E=Sophos;i="6.19,269,1754982000"; d="scan'208";a="89542978" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Oct 2025 06:49:19 -0700 X-CSE-ConnectionGUID: 7+2Rt3wtTpGrCunfhDOadg== X-CSE-MsgGUID: THGSvAIfTTaI5GaWq7/fJA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.19,269,1754982000"; d="scan'208";a="185512675" Received: from jjgreens-desk20.amr.corp.intel.com (HELO kuha.fi.intel.com) ([10.124.220.81]) by orviesa010.jf.intel.com with SMTP; 31 Oct 2025 06:49:08 -0700 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Fri, 31 Oct 2025 15:49:06 +0200 Date: Fri, 31 Oct 2025 15:49:06 +0200 From: Heikki Krogerus To: Chaoyi Chen Cc: Greg Kroah-Hartman , Dmitry Baryshkov , 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: [PATCH v8 02/10] usb: typec: Export all typec device types Message-ID: References: <20251029071435.88-1-kernel@airkyi.com> <20251029071435.88-3-kernel@airkyi.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20251029071435.88-3-kernel@airkyi.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20251031_064920_662739_085CF1C2 X-CRM114-Status: GOOD ( 16.69 ) 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 Wed, Oct 29, 2025 at 03:14:27PM +0800, Chaoyi Chen kirjoitti: > From: Chaoyi Chen > > Export all typec device types for identification. > > Signed-off-by: Chaoyi Chen Reviewed-by: Heikki Krogerus > --- > drivers/usb/typec/class.c | 4 ++++ > drivers/usb/typec/class.h | 10 ---------- > include/linux/usb/typec.h | 10 ++++++++++ > 3 files changed, 14 insertions(+), 10 deletions(-) > > diff --git a/drivers/usb/typec/class.c b/drivers/usb/typec/class.c > index 51e971bc68d1..04b55f066b06 100644 > --- a/drivers/usb/typec/class.c > +++ b/drivers/usb/typec/class.c > @@ -793,6 +793,7 @@ const struct device_type typec_partner_dev_type = { > .groups = typec_partner_groups, > .release = typec_partner_release, > }; > +EXPORT_SYMBOL_GPL(typec_partner_dev_type); > > static void typec_partner_link_device(struct typec_partner *partner, struct device *dev) > { > @@ -1147,6 +1148,7 @@ const struct device_type typec_plug_dev_type = { > .groups = typec_plug_groups, > .release = typec_plug_release, > }; > +EXPORT_SYMBOL_GPL(typec_plug_dev_type); > > /** > * typec_plug_set_num_altmodes - Set the number of available plug altmodes > @@ -1295,6 +1297,7 @@ const struct device_type typec_cable_dev_type = { > .groups = typec_cable_groups, > .release = typec_cable_release, > }; > +EXPORT_SYMBOL_GPL(typec_cable_dev_type); > > /** > * typec_cable_get - Get a reference to the USB Type-C cable > @@ -2034,6 +2037,7 @@ const struct device_type typec_port_dev_type = { > .uevent = typec_uevent, > .release = typec_release, > }; > +EXPORT_SYMBOL_GPL(typec_port_dev_type); > > /* --------------------------------------- */ > /* Driver callbacks to report role updates */ > diff --git a/drivers/usb/typec/class.h b/drivers/usb/typec/class.h > index db2fe96c48ff..f04f6987bed8 100644 > --- a/drivers/usb/typec/class.h > +++ b/drivers/usb/typec/class.h > @@ -87,16 +87,6 @@ struct typec_port { > #define to_typec_cable(_dev_) container_of(_dev_, struct typec_cable, dev) > #define to_typec_partner(_dev_) container_of(_dev_, struct typec_partner, dev) > > -extern const struct device_type typec_partner_dev_type; > -extern const struct device_type typec_cable_dev_type; > -extern const struct device_type typec_plug_dev_type; > -extern const struct device_type typec_port_dev_type; > - > -#define is_typec_partner(dev) ((dev)->type == &typec_partner_dev_type) > -#define is_typec_cable(dev) ((dev)->type == &typec_cable_dev_type) > -#define is_typec_plug(dev) ((dev)->type == &typec_plug_dev_type) > -#define is_typec_port(dev) ((dev)->type == &typec_port_dev_type) > - > extern const struct class typec_mux_class; > extern const struct class retimer_class; > extern const struct class typec_class; > diff --git a/include/linux/usb/typec.h b/include/linux/usb/typec.h > index 309251572e2e..02fed8293415 100644 > --- a/include/linux/usb/typec.h > +++ b/include/linux/usb/typec.h > @@ -56,6 +56,16 @@ enum typec_role { > TYPEC_SOURCE, > }; > > +extern const struct device_type typec_partner_dev_type; > +extern const struct device_type typec_cable_dev_type; > +extern const struct device_type typec_plug_dev_type; > +extern const struct device_type typec_port_dev_type; > + > +#define is_typec_partner(dev) ((dev)->type == &typec_partner_dev_type) > +#define is_typec_cable(dev) ((dev)->type == &typec_cable_dev_type) > +#define is_typec_plug(dev) ((dev)->type == &typec_plug_dev_type) > +#define is_typec_port(dev) ((dev)->type == &typec_port_dev_type) > + > static inline int is_sink(enum typec_role role) > { > return role == TYPEC_SINK; > -- > 2.49.0 -- heikki -- linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy