From nobody Fri Apr 17 07:14:08 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C47FD19D074; Tue, 24 Feb 2026 05:30:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771911052; cv=none; b=Tv08qGeIHxDUqD4/piFq+qm9gBSJmAQN4zOPGYqgo2oaPVVPjoFpZEfx3znPWDj54ciyBu+0UJrjaf90EXWaY5YLsq+et2OIYs4zuqe4J+xUh0fu/E5ps5AevHHymjLs200M4GT5xfFGuyt+6ETirjJrPqFvxFveW0jfIn2UWGE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771911052; c=relaxed/simple; bh=ul9pqll2OSaIKRropAAhp3YOqELMgU3KZnuLR8PCb0A=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=A7TLUZGMxhovKzzHn9IwMV7LGvWqHrxymSu5Q1py6iO6e9r273nKCVZODR5eXnCNcsK9g6K/piSBqs6/3PBsRp9qTo+paRmhtGsCmm9MOF7+DnRyjqdx1wWF+136+6HjKFcRv6Eoyf814MXX3OTljsvHlq92jAIKhrpvlecQzVk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YdWzl9KP; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="YdWzl9KP" Received: by smtp.kernel.org (Postfix) with ESMTPS id 721ACC19425; Tue, 24 Feb 2026 05:30:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771911052; bh=ul9pqll2OSaIKRropAAhp3YOqELMgU3KZnuLR8PCb0A=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=YdWzl9KPmacS8e/maSekJ9XaWlO+lR0uvKwx/6PMQLrIuf0fIMi4PLpIYjeXpdPIy QWklOd7Tcazy6l4See/1tXRXYWCIWiAQek4MEr/+1MuC6JVp5+6wVDqxg6Z7DL0T0q fy+YbTS6gxE+fM7EH/ghe9xVP76g1IEZ+dKAMMd+RTUfB24WjdvBe5b28Q8swr0jiW PLK57O+fal4/xEtYZuU+r9A3p+orw5zKogK9DyDnwX75dFEUn6Zsvb3d3EgNckXRAj Iwx+hptqobYKB8LDK27rIkSxBPKiWExbJq1799Gnp0H/wZmWziG513PHE7cyygvH0z yAsw0xRnnvaiQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59A65EFB7FA; Tue, 24 Feb 2026 05:30:52 +0000 (UTC) From: Manivannan Sadhasivam via B4 Relay Date: Tue, 24 Feb 2026 11:00:47 +0530 Subject: [PATCH v5 1/9] serdev: Convert to_serdev_*() helpers to macros and use container_of_const() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260224-pci-m2-e-v5-1-dd9b9501d33c@oss.qualcomm.com> References: <20260224-pci-m2-e-v5-0-dd9b9501d33c@oss.qualcomm.com> In-Reply-To: <20260224-pci-m2-e-v5-0-dd9b9501d33c@oss.qualcomm.com> To: Rob Herring , Greg Kroah-Hartman , Jiri Slaby , Nathan Chancellor , Nicolas Schier , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Mark Pearson , "Derek J. Clark" , Manivannan Sadhasivam , Krzysztof Kozlowski , Conor Dooley , Marcel Holtmann , Luiz Augusto von Dentz , Bartosz Golaszewski , Andy Shevchenko , Bartosz Golaszewski Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-bluetooth@vger.kernel.org, linux-pm@vger.kernel.org, Stephan Gerhold , Dmitry Baryshkov , linux-acpi@vger.kernel.org, Manivannan Sadhasivam , Hans de Goede , Bartosz Golaszewski X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=2281; i=manivannan.sadhasivam@oss.qualcomm.com; h=from:subject:message-id; bh=jiQzAn5Z8SWByOSZJxw8qqvki+Y9WdMaik55wmM6Ke4=; b=owEBbQGS/pANAwAKAVWfEeb+kc71AcsmYgBpnTeI93TH6+tEvd+0lGzz/KDbf1ZKAlaOgT7rQ 3XGIWgMl22JATMEAAEKAB0WIQRnpUMqgUjL2KRYJ5dVnxHm/pHO9QUCaZ03iAAKCRBVnxHm/pHO 9YlMB/sEV0/LChCElmZYkCcPOtVzX8Wx2gptYWufJFu9OUug4vW/7P80tz940dvDpX4W1k7IFyT dLP/IGHq5McgvmHyRHluS/LXsthANOmdnfYZ5Rs6PKusmP8ohPvKmTpCydTI07tJWv6ihg2ZfXr AA63zTmV9xKXQlizS5XC4U1szfT89Zl1iXbeRf7HnBL208OMfoD495Xs033jMgJhRzjE0sT0U+t 0Aoflb2UKLSzvg8TepTI4LJ6+SVAe+0A/57ZMOv649s3rhEq8jQFFZfEs0ZpikoObxkjMgHfdWo VeeUEHn00jou/ZeF4YdJZjNUMXucbQq5s6O5sxN0nryjf7fb X-Developer-Key: i=manivannan.sadhasivam@oss.qualcomm.com; a=openpgp; fpr=C668AEC3C3188E4C611465E7488550E901166008 X-Endpoint-Received: by B4 Relay for manivannan.sadhasivam@oss.qualcomm.com/default with auth_id=461 X-Original-From: Manivannan Sadhasivam Reply-To: manivannan.sadhasivam@oss.qualcomm.com From: Manivannan Sadhasivam If these helpers receive the 'const struct device' pointer, then the const qualifier will get dropped, leading to below warning: warning: passing argument 1 of =E2=80=98to_serdev_device_driver=E2=80=99 di= scards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] This is not an issue as of now, but with the future commits adding serdev device based driver matching, this warning will get triggered. Hence, convert these helpers to macros so that the qualifier get preserved and also use container_of_const() as container_of() is deprecated. Tested-by: Hans de Goede # ThinkPad T14s = gen6 (arm64) Reviewed-by: Bartosz Golaszewski Signed-off-by: Manivannan Sadhasivam --- include/linux/serdev.h | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/include/linux/serdev.h b/include/linux/serdev.h index 5654c58eb73c..0c7d3c27d1f8 100644 --- a/include/linux/serdev.h +++ b/include/linux/serdev.h @@ -49,10 +49,7 @@ struct serdev_device { struct mutex write_lock; }; =20 -static inline struct serdev_device *to_serdev_device(struct device *d) -{ - return container_of(d, struct serdev_device, dev); -} +#define to_serdev_device(d) container_of_const(d, struct serdev_device, de= v) =20 /** * struct serdev_device_driver - serdev slave device driver @@ -68,10 +65,7 @@ struct serdev_device_driver { void (*shutdown)(struct serdev_device *); }; =20 -static inline struct serdev_device_driver *to_serdev_device_driver(struct = device_driver *d) -{ - return container_of(d, struct serdev_device_driver, driver); -} +#define to_serdev_device_driver(d) container_of_const(d, struct serdev_dev= ice_driver, driver) =20 enum serdev_parity { SERDEV_PARITY_NONE, @@ -112,10 +106,7 @@ struct serdev_controller { const struct serdev_controller_ops *ops; }; =20 -static inline struct serdev_controller *to_serdev_controller(struct device= *d) -{ - return container_of(d, struct serdev_controller, dev); -} +#define to_serdev_controller(d) container_of_const(d, struct serdev_contro= ller, dev) =20 static inline void *serdev_device_get_drvdata(const struct serdev_device *= serdev) { --=20 2.51.0 From nobody Fri Apr 17 07:14:08 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C47961917F1; Tue, 24 Feb 2026 05:30:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771911052; cv=none; b=EB/7iTdUvY7RqC1sOXHw3wF2JNiIZFgKMlA3YFI+0mH8EOqVYQS94b1ZDGs/rwDKQp06rLe484cEsVTnA/+7FiY47IgoEDpTf6UaJP2P2QeZ4CiS9ys4qKkP8q6hJVsovH+ojIa6vd/9DszCgSNjRmb/URh5dzGwnUZW/6U8i4g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771911052; c=relaxed/simple; bh=vHdj4hh+S9toSEoaqsyFG1+YlfiQ88QjpMwJdxwcVKw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=EHukVlOvLLYtVQJ3bpdmd3qZ8RqhrUeT0LwRyge9LEqlk9Aj/qOLxmVQps/OwABa2LQlGiUJtILMu+cOe3VNGFxiwipnzSPp4jkvVbjwbojnFzhL5yOPCDCAnYRD+L+Oh3LLarYDRLJoPSLJnRR/JNE6kf7t5W3iWqNKHK3lMZk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=L+tKSlMM; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="L+tKSlMM" Received: by smtp.kernel.org (Postfix) with ESMTPS id 86FC2C2BCB0; Tue, 24 Feb 2026 05:30:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771911052; bh=vHdj4hh+S9toSEoaqsyFG1+YlfiQ88QjpMwJdxwcVKw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=L+tKSlMMT5r6dc2EMjgCGCq9a59fjbudd7g4l1yW3qtkpGcf01ND92z1k8iKKH7T9 mJWL9OD4gaDEJaTABJ0hI9KdKN2PDVkxpxoSS1q3KBNosXQkSrhJGjfyn/BQyFN7nk a3HR8WewK58BhSJGJqkvJsTTLyCFGHjZAE0dhLaNdZ2wAw1PGTt/RgKZ9gBlUbo3u+ bKnFROsYxjv2adEu8kalrWHmKyztOYBUxepBo1q/1d2LdQ22nxGckgB7WXKakxf9oS 87C0iVnS62nNRJ/WvgFSOfIwzgamQhFkPuHZr29NfESE/yZZrP6I9YDai8LSoRcBl7 hSCT4UhtMxcqQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 78160EFB7FF; Tue, 24 Feb 2026 05:30:52 +0000 (UTC) From: Manivannan Sadhasivam via B4 Relay Date: Tue, 24 Feb 2026 11:00:48 +0530 Subject: [PATCH v5 2/9] serdev: Add an API to find the serdev controller associated with the devicetree node Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260224-pci-m2-e-v5-2-dd9b9501d33c@oss.qualcomm.com> References: <20260224-pci-m2-e-v5-0-dd9b9501d33c@oss.qualcomm.com> In-Reply-To: <20260224-pci-m2-e-v5-0-dd9b9501d33c@oss.qualcomm.com> To: Rob Herring , Greg Kroah-Hartman , Jiri Slaby , Nathan Chancellor , Nicolas Schier , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Mark Pearson , "Derek J. Clark" , Manivannan Sadhasivam , Krzysztof Kozlowski , Conor Dooley , Marcel Holtmann , Luiz Augusto von Dentz , Bartosz Golaszewski , Andy Shevchenko , Bartosz Golaszewski Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-bluetooth@vger.kernel.org, linux-pm@vger.kernel.org, Stephan Gerhold , Dmitry Baryshkov , linux-acpi@vger.kernel.org, Manivannan Sadhasivam , Hans de Goede X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=2175; i=manivannan.sadhasivam@oss.qualcomm.com; h=from:subject:message-id; bh=ZvwvgoFlf4z/ag5/olaI5ILEIEPSFo6zg+vO7wuanOo=; b=owEBbQGS/pANAwAKAVWfEeb+kc71AcsmYgBpnTeIa56ffrPgmNucV18RPYqRHO94dF3VIWvvp Zp7yqucqEWJATMEAAEKAB0WIQRnpUMqgUjL2KRYJ5dVnxHm/pHO9QUCaZ03iAAKCRBVnxHm/pHO 9QihB/4pXR5cfUc1yznfMiQgbOZgzBXVtinCek2mr0WZVDia+3o/PbEyb03v5G1SyzX7+yxoOKA UNAe/ugQlDvJuSaXmmKeZ2dnbghjwiqQpVGdTH6He1icNr0ieEQLGk/kk0g2R8SsIiP6DfF6bdd aIF71gAd45wbJE5TTyrtEzID7oTSxBeBxBq45T1pSxXD+gATuUn8RC8BJ3i74DL4xg0Oz1dUkGi 5KHBd3mSW7rwzoBPSseevM7nCO4+l9fw/LN2hiVA17m9J1mA9gA4qxX4AMGPM0hogrrkE6GO9gw gwle1YNRoxaCtGCSnMvsfLTYLHl+pX58DEkQFkEnANIR9Kws X-Developer-Key: i=manivannan.sadhasivam@oss.qualcomm.com; a=openpgp; fpr=C668AEC3C3188E4C611465E7488550E901166008 X-Endpoint-Received: by B4 Relay for manivannan.sadhasivam@oss.qualcomm.com/default with auth_id=461 X-Original-From: Manivannan Sadhasivam Reply-To: manivannan.sadhasivam@oss.qualcomm.com From: Manivannan Sadhasivam Add of_find_serdev_controller_by_node() API to find the serdev controller device associated with the devicetree node. Tested-by: Hans de Goede # ThinkPad T14s = gen6 (arm64) Signed-off-by: Manivannan Sadhasivam Reviewed-by: Bartosz Golaszewski --- drivers/tty/serdev/core.c | 19 +++++++++++++++++++ include/linux/serdev.h | 9 +++++++++ 2 files changed, 28 insertions(+) diff --git a/drivers/tty/serdev/core.c b/drivers/tty/serdev/core.c index 8f25510f89b6..bf88b95f7458 100644 --- a/drivers/tty/serdev/core.c +++ b/drivers/tty/serdev/core.c @@ -514,6 +514,25 @@ struct serdev_controller *serdev_controller_alloc(stru= ct device *host, } EXPORT_SYMBOL_GPL(serdev_controller_alloc); =20 +#ifdef CONFIG_OF +/** + * of_find_serdev_controller_by_node() - Find the serdev controller associ= ated + * with the devicetree node + * @node: Devicetree node + * + * Return: Pointer to the serdev controller associated with the node. NULL= if + * the controller is not found. Caller is responsible for calling + * serdev_controller_put() to drop the reference. + */ +struct serdev_controller *of_find_serdev_controller_by_node(struct device_= node *node) +{ + struct device *dev =3D bus_find_device_by_of_node(&serdev_bus_type, node); + + return (dev && dev->type =3D=3D &serdev_ctrl_type) ? to_serdev_controller= (dev) : NULL; +} +EXPORT_SYMBOL_GPL(of_find_serdev_controller_by_node); +#endif + static int of_serdev_register_devices(struct serdev_controller *ctrl) { struct device_node *node; diff --git a/include/linux/serdev.h b/include/linux/serdev.h index 0c7d3c27d1f8..188c0ba62d50 100644 --- a/include/linux/serdev.h +++ b/include/linux/serdev.h @@ -334,4 +334,13 @@ static inline bool serdev_acpi_get_uart_resource(struc= t acpi_resource *ares, } #endif /* CONFIG_ACPI */ =20 +#ifdef CONFIG_OF +struct serdev_controller *of_find_serdev_controller_by_node(struct device_= node *node); +#else +static inline struct serdev_controller *of_find_serdev_controller_by_node(= struct device_node *node) +{ + return NULL; +} +#endif /* CONFIG_OF */ + #endif /*_LINUX_SERDEV_H */ --=20 2.51.0 From nobody Fri Apr 17 07:14:08 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D8445218AB9; Tue, 24 Feb 2026 05:30:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771911052; cv=none; b=AuxkLYsms1XRbJu4wNlWEtFPyjy2Vt8u+r/d7XhPKcprvPPm2I/3MIQywIGhE6agM6KR46Cf77Yhfu956eQdHRiyOauBXfJzLhfKnEDiGdk9YxPX9yg4szAaglsLpJOzpZfmZayksikRdlRzntjmy2XU4bTgwp162DmEJBLO7uE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771911052; c=relaxed/simple; bh=JoCqd4qTmhZAw9Ra/kUSAYchs5sr6tzJ0I7Nt266T1c=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ZETwmhL0GZA1kkr4Oq1qj9xYK79acNBhK4R3OFk+ySfHhKvXk7QEihA6zNTcv8+NT8kz/zH1rY2hRrqWa9etD5+h+p69qmpCypKzEYIx0Ig3SgsFNC9hxT63jwLsMV+18gyn4Ht+syIIi1lNkQAKl8CNosgr2aHY+qy1+omEb7E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=l712owvZ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="l712owvZ" Received: by smtp.kernel.org (Postfix) with ESMTPS id A3568C2BC86; Tue, 24 Feb 2026 05:30:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771911052; bh=JoCqd4qTmhZAw9Ra/kUSAYchs5sr6tzJ0I7Nt266T1c=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=l712owvZtBOLZNSZ8jVFkdyZ1s0SR6C8uijHIcEFtvLu+1rF3/RLeJ+j/N5dGW02R jjL/LJGDZ3tb4lEQiSd8xiJrpNykSM/lQUTPnDK+Ow9TRvV+RoCiyeF9tXaXhdutOE l5vgevn2Vt9DiOcL2pivOTvJNVV2ks2Axmage+ripyLGiPmI0CiZZdQOkOHHiHQg2J 7MfqYwdOmUIUsH6LJuPAWUD8oD5fyCAJ6eewu6b/lDkqxitXU/INr61sEYz1kIecD+ sqnciGqus0UECl2eF91R+xT20Z+Bb7SfQg5kLRv4Xxh2ygcnhKc9FKcb0vra9XwotY yt7Myk5h87KDg== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 939CCEFB800; Tue, 24 Feb 2026 05:30:52 +0000 (UTC) From: Manivannan Sadhasivam via B4 Relay Date: Tue, 24 Feb 2026 11:00:49 +0530 Subject: [PATCH v5 3/9] serdev: Do not return -ENODEV from of_serdev_register_devices() if external connector is used Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260224-pci-m2-e-v5-3-dd9b9501d33c@oss.qualcomm.com> References: <20260224-pci-m2-e-v5-0-dd9b9501d33c@oss.qualcomm.com> In-Reply-To: <20260224-pci-m2-e-v5-0-dd9b9501d33c@oss.qualcomm.com> To: Rob Herring , Greg Kroah-Hartman , Jiri Slaby , Nathan Chancellor , Nicolas Schier , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Mark Pearson , "Derek J. Clark" , Manivannan Sadhasivam , Krzysztof Kozlowski , Conor Dooley , Marcel Holtmann , Luiz Augusto von Dentz , Bartosz Golaszewski , Andy Shevchenko , Bartosz Golaszewski Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-bluetooth@vger.kernel.org, linux-pm@vger.kernel.org, Stephan Gerhold , Dmitry Baryshkov , linux-acpi@vger.kernel.org, Manivannan Sadhasivam , Hans de Goede , Bartosz Golaszewski X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1461; i=manivannan.sadhasivam@oss.qualcomm.com; h=from:subject:message-id; bh=9JYNk+DMPq2LlZQfTiexJ4EeAYXDboalcaCh+TYovs0=; b=owEBbQGS/pANAwAKAVWfEeb+kc71AcsmYgBpnTeIZPVB6TXs7qJCxZKnKwelNFrs4yCQW7stK n5l2YxnGqCJATMEAAEKAB0WIQRnpUMqgUjL2KRYJ5dVnxHm/pHO9QUCaZ03iAAKCRBVnxHm/pHO 9WeqB/4oeIaNaesPvXIPgrTC8c8dEL+ulzvpa7xXgn0f/n1iIZcd9Qvnor+uSHBIjnNX8YytZSU NIsWprNhRtUxTsmwu/NNQGg7R7AJbd4oHn6iQlDv7VLBN+H5wv7DoRHWXdIefCDpqsOMKLsWLi+ nBMntq4rZWhXVYbh3oKmMweIWcVMC1ABHIubxhIVf8W0SQUzlbu9UIThUVftK37wRFbS7GAkWXk YBaWTeSSp1nrKZL630unIuLiAyW/zW0ZrwfgilYI3oZD6RxCs0iZfe5EoHib+HCpnY9sqcKlq79 o0KO4smHOJfm+t7x0Fe6lXI+H7vupOMr/IjtMQh7G9ykqDb+ X-Developer-Key: i=manivannan.sadhasivam@oss.qualcomm.com; a=openpgp; fpr=C668AEC3C3188E4C611465E7488550E901166008 X-Endpoint-Received: by B4 Relay for manivannan.sadhasivam@oss.qualcomm.com/default with auth_id=461 X-Original-From: Manivannan Sadhasivam Reply-To: manivannan.sadhasivam@oss.qualcomm.com From: Manivannan Sadhasivam If an external connector like M.2 is connected to the serdev controller in DT, then the serdev devices may be created dynamically by the connector driver. So do not return -ENODEV from of_serdev_register_devices() if the static nodes are not found and the graph node is used. Tested-by: Hans de Goede # ThinkPad T14s = gen6 (arm64) Reviewed-by: Bartosz Golaszewski Signed-off-by: Manivannan Sadhasivam --- drivers/tty/serdev/core.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serdev/core.c b/drivers/tty/serdev/core.c index bf88b95f7458..e9d044a331b0 100644 --- a/drivers/tty/serdev/core.c +++ b/drivers/tty/serdev/core.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -561,7 +562,13 @@ static int of_serdev_register_devices(struct serdev_co= ntroller *ctrl) } else found =3D true; } - if (!found) + + /* + * When the serdev controller is connected to an external connector like + * M.2 in DT, then the serdev devices may be created dynamically by the + * connector driver. + */ + if (!found && !of_graph_is_present(dev_of_node(&ctrl->dev))) return -ENODEV; =20 return 0; --=20 2.51.0 From nobody Fri Apr 17 07:14:08 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EC81528B4FA; Tue, 24 Feb 2026 05:30:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771911053; cv=none; b=nJsW8AEOxxPpIJ6S2If29c1oyPg2rxJnwOp4XwXcsSSatGqHZZNgrCwEE3ysJm+IEp8wPkDYD4qBfeXUJAqcQ9wpz8laGmFY/7OyN1igrTvGTJSBxC6PCSo6l2z1n+G0JKATGoMeekow0mEpTTQQpesY3xi+xZ6aY3aOv57p0Sw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771911053; c=relaxed/simple; bh=HpGVKc0NY5imy2HoLh3gTZqlP+PKdsOsRjHmaFdWlwA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=eTvwiC+ozGK6bGuHZCe+A8rivjd7YE0NL2UP9HY5qWaRQb6B2BU+SXYt2ZHL96ps4FfCVDz4exhk9Vw7xGZM31Ac7hbM5sfS/y51+f/EBG/iiVjE2G2HMJYPkufccndjQGP4XK7wh65mqc55DDqMqwUi2xYqXr3qhsSqPLH2qU0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WpRhNN6w; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WpRhNN6w" Received: by smtp.kernel.org (Postfix) with ESMTPS id BC3B9C19424; Tue, 24 Feb 2026 05:30:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771911052; bh=HpGVKc0NY5imy2HoLh3gTZqlP+PKdsOsRjHmaFdWlwA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=WpRhNN6wmYYtMagYhYig5HGWe/MTOnHSg8Fq7vjHTzFBKj1UufsSHZBlMfj+MW7uB vYgaXwaXCYHr3TcsF1PEGwA34D+PF4d9azi4TPQwyyAC3c1w67pyRllmsbRKrHbIYP i1hoOiF0bAA6+OsmPmwSdYpNyG3yLByH7fcVS7Ny8N1z2Bzn+Rc3KhlqofWDJIPLDV Z4Vlws5oMMeMLX+O/0rv0adRYrdQfUaOrnzpHKstlg6OFU2IUaimLEx8R1+mZTG3wt 9ygX1yJk7FfUIFk5MRoql4vriBLfqnCv+m0Kh4JvuckNcjDhB9rW2/+Ba8cHWT2ksV 8yW1XsuwbTaVA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id AF03DEFB7F9; Tue, 24 Feb 2026 05:30:52 +0000 (UTC) From: Manivannan Sadhasivam via B4 Relay Date: Tue, 24 Feb 2026 11:00:50 +0530 Subject: [PATCH v5 4/9] dt-bindings: serial: Document the graph port Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260224-pci-m2-e-v5-4-dd9b9501d33c@oss.qualcomm.com> References: <20260224-pci-m2-e-v5-0-dd9b9501d33c@oss.qualcomm.com> In-Reply-To: <20260224-pci-m2-e-v5-0-dd9b9501d33c@oss.qualcomm.com> To: Rob Herring , Greg Kroah-Hartman , Jiri Slaby , Nathan Chancellor , Nicolas Schier , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Mark Pearson , "Derek J. Clark" , Manivannan Sadhasivam , Krzysztof Kozlowski , Conor Dooley , Marcel Holtmann , Luiz Augusto von Dentz , Bartosz Golaszewski , Andy Shevchenko , Bartosz Golaszewski Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-bluetooth@vger.kernel.org, linux-pm@vger.kernel.org, Stephan Gerhold , Dmitry Baryshkov , linux-acpi@vger.kernel.org, Manivannan Sadhasivam , Hans de Goede , Bartosz Golaszewski X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1136; i=manivannan.sadhasivam@oss.qualcomm.com; h=from:subject:message-id; bh=GL3e+NsnxRKZAnbhCXHzDHMKMZEirA8W+47KdhQACxY=; b=owGbwMvMwMUYOl/w2b+J574ynlZLYsica96h277e1mjKV56q0/LmB3awLD5x31z57eMMbc09s +cJXKgp7GQ0ZmFg5GKQFVNkSV/qrNXocfrGkgj16TCDWJlApjBwcQrARO5pcTA0eZTuv7x4Q2bn uqCt8enKuUzNLMv5LoWutl67SpRndqlnBrvSg7qeLvN+eQ6Vh+8+fNu+hyF/lpPATPUyluu+ZzV deabMr3vRf/Ful1XgnoYH936r7N6js910QZeVgFyGXVi3k2NYPu/35qLQkIcv5dR8FJXv/1aUNW BLeO9uImTs5BIdlDqt5buX7uEwLaE1uzhLJzyuDH4npOhxulcl9Zq9VP+NDHVT2cIJpSEdzUHTC g+LsduJmzK56xxNEZxfdoilPP5jesIGRvuvMcr7U6c/VFf+pPFz0ZGdxw5rbXfOZN91zv+2Y+ih I58qmg+6Cdic/5k8jVfP8YJWxtrsuR5qcz1/KjFLyP4AAA== X-Developer-Key: i=manivannan.sadhasivam@oss.qualcomm.com; a=openpgp; fpr=C668AEC3C3188E4C611465E7488550E901166008 X-Endpoint-Received: by B4 Relay for manivannan.sadhasivam@oss.qualcomm.com/default with auth_id=461 X-Original-From: Manivannan Sadhasivam Reply-To: manivannan.sadhasivam@oss.qualcomm.com From: Manivannan Sadhasivam A serial controller could be connected to an external connector like PCIe M.2 for controlling the serial interface of the card. Hence, document the OF graph port. Tested-by: Hans de Goede # ThinkPad T14s = gen6 (arm64) Reviewed-by: Rob Herring (Arm) Reviewed-by: Bartosz Golaszewski Signed-off-by: Manivannan Sadhasivam --- Documentation/devicetree/bindings/serial/serial.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/serial/serial.yaml b/Documen= tation/devicetree/bindings/serial/serial.yaml index 6aa9cfae417b..96eb1de8771e 100644 --- a/Documentation/devicetree/bindings/serial/serial.yaml +++ b/Documentation/devicetree/bindings/serial/serial.yaml @@ -87,6 +87,9 @@ properties: description: TX FIFO threshold configuration (in bytes). =20 + port: + $ref: /schemas/graph.yaml#/properties/port + patternProperties: "^(bluetooth|bluetooth-gnss|embedded-controller|gnss|gps|mcu|onewire)$": if: --=20 2.51.0 From nobody Fri Apr 17 07:14:08 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 33E1C29D288; Tue, 24 Feb 2026 05:30:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771911053; cv=none; b=tT7lUlG20YIaa/ea1Q3lBAG3lXrofeBRg/Wpfs5Jt4z/SInVgZw54kAwhaMwhmW852QwTOrz6XaGk2/IEKi32lCR2kqsjIB+d1QIaGCdYxOdAhAaWbQ4PfN8CiY6ZYfbwpucxPJVKbpxMUE2AyYv5FKNjD5TbgSIOGl4FDZU2pE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771911053; c=relaxed/simple; bh=bJdUOGhU660sciPYfD5tlNkRUZIlYy6w4phG6SGa/EI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ia7Ts4mcvWEfUWk2Wo2p/DkCGNjwCgofyk+Io0YCSfKax/Ne7SCMWwXmh+y4peW06GM4RLGlZwsF9iy3klHX3oiIMPaqHubG7dHxPbIIJyTzgiCPUKPczuuCbPfqhpgf8Ub4Rd7d9DGXTlY8neZ+R7Q3ww/qttmAIM9GQs4EQUk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=bIQkGpWS; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="bIQkGpWS" Received: by smtp.kernel.org (Postfix) with ESMTPS id DFE54C2BC87; Tue, 24 Feb 2026 05:30:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771911052; bh=bJdUOGhU660sciPYfD5tlNkRUZIlYy6w4phG6SGa/EI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=bIQkGpWSM8MSH2kN3+hgy/h9Z+d8Kkkf9bvegazZDB83wi589CB2G5VuI3+ATGAtT 6M4IamOUpTVJbIu2ebdghHlRRGH/uwSP4Ym98REDOgT7MWaXtyJCd0/kVljBjn0xHY F21yinZQ11KQxyAzqSLqIBUSiVkVQ0ATYPtoHz+n3F6+AlEEtL8tvwpllAcJ/f73Ih 3EbhbqHCMH61c77vI+Uns7pI5QPCLyi9wLGAzF0PRz4unqRtartiu2DhRZVyGVb5Ec GikFrGKzHspZOD2H3a1xbGDODk6En2dEBXrdFWTe5SzBgTZMqw+4AnAjvRSUPsggNn XA/YdzBkSu3/A== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id D290BEFB7FF; Tue, 24 Feb 2026 05:30:52 +0000 (UTC) From: Manivannan Sadhasivam via B4 Relay Date: Tue, 24 Feb 2026 11:00:51 +0530 Subject: [PATCH v5 5/9] dt-bindings: connector: Add PCIe M.2 Mechanical Key E connector Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260224-pci-m2-e-v5-5-dd9b9501d33c@oss.qualcomm.com> References: <20260224-pci-m2-e-v5-0-dd9b9501d33c@oss.qualcomm.com> In-Reply-To: <20260224-pci-m2-e-v5-0-dd9b9501d33c@oss.qualcomm.com> To: Rob Herring , Greg Kroah-Hartman , Jiri Slaby , Nathan Chancellor , Nicolas Schier , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Mark Pearson , "Derek J. Clark" , Manivannan Sadhasivam , Krzysztof Kozlowski , Conor Dooley , Marcel Holtmann , Luiz Augusto von Dentz , Bartosz Golaszewski , Andy Shevchenko , Bartosz Golaszewski Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-bluetooth@vger.kernel.org, linux-pm@vger.kernel.org, Stephan Gerhold , Dmitry Baryshkov , linux-acpi@vger.kernel.org, Manivannan Sadhasivam , Hans de Goede X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=8280; i=manivannan.sadhasivam@oss.qualcomm.com; h=from:subject:message-id; bh=UPIXQxg5yQZg/Nb/1C/QZjYZ3lvZ8kANbcyudC4LWz0=; b=owEBbQGS/pANAwAKAVWfEeb+kc71AcsmYgBpnTeIcZzEPYkUuKBISR5gRB3UL4Wvs7TViAp7o 7Mrrtia0H+JATMEAAEKAB0WIQRnpUMqgUjL2KRYJ5dVnxHm/pHO9QUCaZ03iAAKCRBVnxHm/pHO 9cdXCACj+5WDF01H7LqXtCI6RkegJfjCC0ItHskl3wrC6ohsY/gl5GtcG1qltKOiA3OjCGGApaQ QWafzkFTMoYG6tmqS1bEJp+rEQO5viNo+FtJwVxRcDHmkRuZQax8uMOHLimUUndox7aZ1gdeQae nXQOXSTRdgB/4Vx4+53P8m7MFSheoW2XAOxL/skUnuUixDXC3qRgZ2PQsPtqi3W63mMuCyRonX1 hG+JUpfENq5hQG8saBA09Fshh7Ufb5xiC6PNYHVFoAtVHAOmxScoOBfbD0XJivPffP/RwHwV0wW m0F407tCU0ivOZQZHuFAaKLD51hV5zl+uqmUMMZDo3EdYpUm X-Developer-Key: i=manivannan.sadhasivam@oss.qualcomm.com; a=openpgp; fpr=C668AEC3C3188E4C611465E7488550E901166008 X-Endpoint-Received: by B4 Relay for manivannan.sadhasivam@oss.qualcomm.com/default with auth_id=461 X-Original-From: Manivannan Sadhasivam Reply-To: manivannan.sadhasivam@oss.qualcomm.com From: Manivannan Sadhasivam Add the devicetree binding for PCIe M.2 Mechanical Key E connector defined in the PCI Express M.2 Specification, r4.0, sec 5.1.2. This connector provides interfaces like PCIe or SDIO to attach the WiFi devices to the host machine, USB or UART+PCM interfaces to attach the Bluetooth (BT) devices. Spec also provides an optional interface to connect the UIM card, but that is not covered in this binding. The connector provides a primary power supply of 3.3v, along with an optional 1.8v VIO supply for the Adapter I/O buffer circuitry operating at 1.8v sideband signaling. The connector also supplies optional signals in the form of GPIOs for fine grained power management. Tested-by: Hans de Goede # ThinkPad T14s = gen6 (arm64) Signed-off-by: Manivannan Sadhasivam Reviewed-by: Rob Herring (Arm) --- .../bindings/connector/pcie-m2-e-connector.yaml | 184 +++++++++++++++++= ++++ MAINTAINERS | 1 + 2 files changed, 185 insertions(+) diff --git a/Documentation/devicetree/bindings/connector/pcie-m2-e-connecto= r.yaml b/Documentation/devicetree/bindings/connector/pcie-m2-e-connector.ya= ml new file mode 100644 index 000000000000..82dfd776d480 --- /dev/null +++ b/Documentation/devicetree/bindings/connector/pcie-m2-e-connector.yaml @@ -0,0 +1,184 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/connector/pcie-m2-e-connector.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: PCIe M.2 Mechanical Key E Connector + +maintainers: + - Manivannan Sadhasivam + +description: + A PCIe M.2 E connector node represents a physical PCIe M.2 Mechanical Ke= y E + connector. Mechanical Key E connectors are used to connect Wireless + Connectivity devices including combinations of Wi-Fi, BT, NFC to the host + machine over interfaces like PCIe/SDIO, USB/UART+PCM, and I2C. + +properties: + compatible: + const: pcie-m2-e-connector + + vpcie3v3-supply: + description: A phandle to the regulator for 3.3v supply. + + vpcie1v8-supply: + description: A phandle to the regulator for VIO 1.8v supply. + + i2c-parent: + $ref: /schemas/types.yaml#/definitions/phandle + description: I2C interface + + clocks: + description: 32.768 KHz Suspend Clock (SUSCLK) input from the host sys= tem to + the M.2 card. Refer, PCI Express M.2 Specification r4.0, sec 3.1.12.= 1 for + more details. + maxItems: 1 + + w-disable1-gpios: + description: GPIO output to W_DISABLE1# signal. This signal is used by= the + host system to disable WiFi radio in the M.2 card. Refer, PCI Expres= s M.2 + Specification r4.0, sec 3.1.12.3 for more details. + maxItems: 1 + + w-disable2-gpios: + description: GPIO output to W_DISABLE2# signal. This signal is used by= the + host system to disable WiFi radio in the M.2 card. Refer, PCI Expres= s M.2 + Specification r4.0, sec 3.1.12.3 for more details. + maxItems: 1 + + viocfg-gpios: + description: GPIO input to IO voltage configuration (VIO_CFG) signal. = The + card drives this signal to indicate to the host system whether the c= ard + supports an independent IO voltage domain for sideband signals. Refe= r, + PCI Express M.2 Specification r4.0, sec 3.1.15.1 for more details. + maxItems: 1 + + uart-wake-gpios: + description: GPIO input to UART_WAKE# signal. The card asserts this si= gnal + to wake the host system and initiate UART interface communication. R= efer, + PCI Express M.2 Specification r4.0, sec 3.1.8.1 for more details. + maxItems: 1 + + sdio-wake-gpios: + description: GPIO input to SDIO_WAKE# signal. The card asserts this si= gnal + to wake the host system and initiate SDIO interface communication. R= efer, + PCI Express M.2 Specification r4.0, sec 3.1.7 for more details. + maxItems: 1 + + sdio-reset-gpios: + description: GPIO output to SDIO_RESET# signal. This signal is used by= the + host system to reset SDIO interface of the M.2 card. Refer, PCI Expr= ess + M.2 Specification r4.0, sec 3.1.7 for more details. + maxItems: 1 + + vendor-porta-gpios: + description: GPIO for the first vendor specific signal (VENDOR_PORTA).= This + signal's functionality is defined by the card manufacturer and may be + used for proprietary features. Refer the card vendor's documentation= for + details. + maxItems: 1 + + vendor-portb-gpios: + description: GPIO for the second vendor specific signal (VENDOR_PORTB)= . This + signal's functionality is defined by the card manufacturer and may be + used for proprietary features. Refer the card vendor's documentation= for + details. + maxItems: 1 + + vendor-portc-gpios: + description: GPIO for the third vendor specific signal (VENDOR_PORTC).= This + signal's functionality is defined by the card manufacturer and may be + used for proprietary features. Refer the card vendor's documentation= for + details. + maxItems: 1 + + ports: + $ref: /schemas/graph.yaml#/properties/ports + description: OF graph bindings modeling the interfaces exposed on the + connector. Since a single connector can have multiple interfaces, ev= ery + interface has an assigned OF graph port number as described below. + + properties: + port@0: + $ref: /schemas/graph.yaml#/properties/port + description: PCIe interface for Wi-Fi + + port@1: + $ref: /schemas/graph.yaml#/properties/port + description: SDIO interface for Wi-Fi + + port@2: + $ref: /schemas/graph.yaml#/properties/port + description: USB 2.0 interface for BT + + port@3: + $ref: /schemas/graph.yaml#/properties/port + description: UART interface for BT + + port@4: + $ref: /schemas/graph.yaml#/properties/port + description: PCM/I2S interface + + anyOf: + - anyOf: + - required: + - port@0 + - required: + - port@1 + - anyOf: + - required: + - port@2 + - required: + - port@3 + +required: + - compatible + - vpcie3v3-supply + +additionalProperties: false + +examples: + # PCI M.2 Key E connector for Wi-Fi/BT with PCIe/UART interfaces + - | + #include + + connector { + compatible =3D "pcie-m2-e-connector"; + vpcie3v3-supply =3D <&vreg_wcn_3p3>; + vpcie1v8-supply =3D <&vreg_l15b_1p8>; + i2c-parent =3D <&i2c0>; + w-disable1-gpios =3D <&tlmm 115 GPIO_ACTIVE_LOW>; + w-disable2-gpios =3D <&tlmm 116 GPIO_ACTIVE_LOW>; + viocfg-gpios =3D <&tlmm 117 GPIO_ACTIVE_HIGH>; + uart-wake-gpios =3D <&tlmm 118 GPIO_ACTIVE_LOW>; + sdio-wake-gpios =3D <&tlmm 119 GPIO_ACTIVE_LOW>; + sdio-reset-gpios =3D <&tlmm 120 GPIO_ACTIVE_LOW>; + + ports { + #address-cells =3D <1>; + #size-cells =3D <0>; + + port@0 { + reg =3D <0>; + #address-cells =3D <1>; + #size-cells =3D <0>; + + endpoint@0 { + reg =3D <0>; + remote-endpoint =3D <&pcie4_port0_ep>; + }; + }; + + port@3 { + reg =3D <3>; + #address-cells =3D <1>; + #size-cells =3D <0>; + + endpoint@0 { + reg =3D <0>; + remote-endpoint =3D <&uart14_ep>; + }; + }; + }; + }; diff --git a/MAINTAINERS b/MAINTAINERS index 55af015174a5..565198d3b500 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -21044,6 +21044,7 @@ PCIE M.2 POWER SEQUENCING M: Manivannan Sadhasivam L: linux-pci@vger.kernel.org S: Maintained +F: Documentation/devicetree/bindings/connector/pcie-m2-e-connector.yaml F: Documentation/devicetree/bindings/connector/pcie-m2-m-connector.yaml F: drivers/power/sequencing/pwrseq-pcie-m2.c =20 --=20 2.51.0 From nobody Fri Apr 17 07:14:09 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 418052BCF45; Tue, 24 Feb 2026 05:30:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771911053; cv=none; b=ialfuhZiIdemZP+pOxY9ZufUhQvbDsK2Z4aZO5iF1ZnWbYc+UvFzKWdkMywtniLZmh3MoaYkMIzVs33BUVeMuIJ9g6/8GTUvKNEXSHQcwuceqHw8Z65aYiYOOIRe/D8dCqCHyIiZ5ti2WaqdwuNb2VnLxSRqwVRHsPcBYPDBJI0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771911053; c=relaxed/simple; bh=WhTZq+K6TuaX44CN0DoROJYudpXusVMVY0rd0r/mYcM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=opyhFmq7J3chUnWboTJtzYX4zaGsGst8jkPT4oKelSiasDSNtLKaZnpOUjXvzA3rZ8L7gsw4jAj9KBQnLh3znlKfIDmzaC5iiTNUQqnD8wV8dePe5sd/pxE9AvTLqFwxuutdahJDYgGIN9Bw89H/HQsIdBEgbL9dCFzeuem21Mk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=DWpAg1qj; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="DWpAg1qj" Received: by smtp.kernel.org (Postfix) with ESMTPS id 04C17C116D0; Tue, 24 Feb 2026 05:30:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771911053; bh=WhTZq+K6TuaX44CN0DoROJYudpXusVMVY0rd0r/mYcM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=DWpAg1qjDmrDOOEZM0eDhhY1yAd1KTskPcNFpivpgkLK+JvMF78tNnkJfrTnPqXKA FIAsB1yh/hn3ei+uh7bVF2nSlvfgX/UbTQV3kY8qShtftCL5NwpMkAfV1eGHdJPKdl 9CfgBRAwcroZ88gaHEg3r/uENu8DSL9rnzyML4YOZvOh2GshcS/4HlxzkU2y40cwYi DkADAmGHp4P51tphxF7MQJGKyBgmo4DImVUvrhlIh15RyM7ifm7eKys9vkWf221fSU 8YTNDnS4JnEVUYGUpq8Ubmb76Agvw60pd8ItfC8yJtNL/PAJmFFLAtHHbddFcwGgVK 2Es2+QHPNo9Bw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id ECDB7EFB801; Tue, 24 Feb 2026 05:30:52 +0000 (UTC) From: Manivannan Sadhasivam via B4 Relay Date: Tue, 24 Feb 2026 11:00:52 +0530 Subject: [PATCH v5 6/9] dt-bindings: connector: m2: Add M.2 1620 LGA soldered down connector Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260224-pci-m2-e-v5-6-dd9b9501d33c@oss.qualcomm.com> References: <20260224-pci-m2-e-v5-0-dd9b9501d33c@oss.qualcomm.com> In-Reply-To: <20260224-pci-m2-e-v5-0-dd9b9501d33c@oss.qualcomm.com> To: Rob Herring , Greg Kroah-Hartman , Jiri Slaby , Nathan Chancellor , Nicolas Schier , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Mark Pearson , "Derek J. Clark" , Manivannan Sadhasivam , Krzysztof Kozlowski , Conor Dooley , Marcel Holtmann , Luiz Augusto von Dentz , Bartosz Golaszewski , Andy Shevchenko , Bartosz Golaszewski Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-bluetooth@vger.kernel.org, linux-pm@vger.kernel.org, Stephan Gerhold , Dmitry Baryshkov , linux-acpi@vger.kernel.org, Manivannan Sadhasivam , Hans de Goede X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1391; i=manivannan.sadhasivam@oss.qualcomm.com; h=from:subject:message-id; bh=M1p28ZrNyChHwQecpcVA6dKuJdcr6xMtVXucrfIuJ+o=; b=owGbwMvMwMUYOl/w2b+J574ynlZLYsica94xK55/R88r6fObC/8sc8mdt1FS+pBygkxIfctJu +1uTtysnYzGLAyMXAyyYoos6UudtRo9Tt9YEqE+HWYQKxPIFAYuTgGYyE8FDoaetCPW+zguiUfa z2pT28w+LXa7ePR8NZM/DXfFkg+bPDfusrHmc+SymO+67WuA6c9d7ZlHwnmUJJwXPeOLm707sYi p3eOQ8+4eVXO9D+vF3y6bf/3xxPrFk1c1mBiYx9dH3lNmfvuyZp2ln3T9rOfb5nZ7eu0/UfF704 H0v54/DWRsPnokFt0JeaHh4rPX/C+jpuzfj/8mzix438/CH5Xt8eiEoKXX7gI+bo0mmzBRnhsG5 2c979Bi/j5H06E+q+JiJMPlnjYOhruu01pNnrItUw6NfdZjVBCivrv9W1P2RCG3ktvv9317K86g WjUrdELbspvrS1exp54vVO9ijN65dWFtXGx5UabC5KzpAA== X-Developer-Key: i=manivannan.sadhasivam@oss.qualcomm.com; a=openpgp; fpr=C668AEC3C3188E4C611465E7488550E901166008 X-Endpoint-Received: by B4 Relay for manivannan.sadhasivam@oss.qualcomm.com/default with auth_id=461 X-Original-From: Manivannan Sadhasivam Reply-To: manivannan.sadhasivam@oss.qualcomm.com From: Manivannan Sadhasivam Lenovo Thinkpad T14s is found to have a soldered down version of M.2 1620 LGA connector. Though, there is no 1620 LGA form factor defined in the M.2 spec, it looks very similar to the M.2 Key E connector. So add the "pcie-m2-1620-lga-connector" compatible with "pcie-m2-e-connector" fallback to reuse the Key E binding. Tested-by: Hans de Goede # ThinkPad T14s = gen6 (arm64) Signed-off-by: Manivannan Sadhasivam --- .../devicetree/bindings/connector/pcie-m2-e-connector.yaml | 9 +++++= +++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/connector/pcie-m2-e-connecto= r.yaml b/Documentation/devicetree/bindings/connector/pcie-m2-e-connector.ya= ml index 82dfd776d480..48fe80846cb4 100644 --- a/Documentation/devicetree/bindings/connector/pcie-m2-e-connector.yaml +++ b/Documentation/devicetree/bindings/connector/pcie-m2-e-connector.yaml @@ -17,7 +17,14 @@ description: =20 properties: compatible: - const: pcie-m2-e-connector + oneOf: + - items: + - enum: + - pcie-m2-1620-lga-connector + - const: pcie-m2-e-connector + - items: + - enum: + - pcie-m2-e-connector =20 vpcie3v3-supply: description: A phandle to the regulator for 3.3v supply. --=20 2.51.0 From nobody Fri Apr 17 07:14:09 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 50E692BE621; Tue, 24 Feb 2026 05:30:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771911053; cv=none; b=Qv5BhCcS7NaWhY3lvmAKUCHi/AAfSl1iux8Lyh1XyNbnW03x6whXScZB7JELc3f8DHpNtBlBavm9uoYGpWGjrPQmrmBSLwgpqiFlrA3AYJdr2Ade//8Ou99deaCz3ng7HGauMcXNzVxZ5vr5+BPIwrdDbNvFgZkfMoKL5gSfdm0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771911053; c=relaxed/simple; bh=xvJdFB9vxMSBN+U1jZgkkmd/Zx+jTJimCm+f0cyrTkg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=OIJ9DH9y+lru890QndfDwnE/1+AG8hSfNAvaeyOLgE+VsdNJV7lF/sYCpWlcnvxt1CIMCkO01AH2AsEa5e28B4TbKEdecIWX8b2pSeotuld2TMnsnvupOD/2t8650575P7QY7NuutBtxrj6aEWdCsGop20hQLYXX/YpXSYcUf8E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=pc8ooo6W; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="pc8ooo6W" Received: by smtp.kernel.org (Postfix) with ESMTPS id 18D83C2BC86; Tue, 24 Feb 2026 05:30:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771911053; bh=xvJdFB9vxMSBN+U1jZgkkmd/Zx+jTJimCm+f0cyrTkg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=pc8ooo6Wx3CKQmkSJX7xF/k95HMyTe1KN8YJAEKHxYupxf9MYHbYKmSUatwlMeJJZ lmWCHNCOHeV65IQVpeSactuWaoQuhkZ+ds4lmWS1aYuHj6nYIXDcjDBf2oNuJPfNRL U2syCN6xX/5CsTNCWP0C6/HFeBNkjkSHhoW6Oou0TOY3kdWst9iXsjJpCSFApIj2ye zkr/5zrH9glj5jeH51VM2YEecFIfu6XgLcLMZH6CACdd5c4+B+CN7s4ZVD3Q5GHRrT iPcOCwbutPfrxFyMQHh5Jbu8+GsPbiuXqc9/djs5FLxfzs2BQQiRiUjZa1X2XlpbXm IU9meymBepdbg== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D8DAEFB7F9; Tue, 24 Feb 2026 05:30:53 +0000 (UTC) From: Manivannan Sadhasivam via B4 Relay Date: Tue, 24 Feb 2026 11:00:53 +0530 Subject: [PATCH v5 7/9] Bluetooth: hci_qca: Add M.2 Bluetooth device support using pwrseq Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260224-pci-m2-e-v5-7-dd9b9501d33c@oss.qualcomm.com> References: <20260224-pci-m2-e-v5-0-dd9b9501d33c@oss.qualcomm.com> In-Reply-To: <20260224-pci-m2-e-v5-0-dd9b9501d33c@oss.qualcomm.com> To: Rob Herring , Greg Kroah-Hartman , Jiri Slaby , Nathan Chancellor , Nicolas Schier , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Mark Pearson , "Derek J. Clark" , Manivannan Sadhasivam , Krzysztof Kozlowski , Conor Dooley , Marcel Holtmann , Luiz Augusto von Dentz , Bartosz Golaszewski , Andy Shevchenko , Bartosz Golaszewski Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-bluetooth@vger.kernel.org, linux-pm@vger.kernel.org, Stephan Gerhold , Dmitry Baryshkov , linux-acpi@vger.kernel.org, Manivannan Sadhasivam , Hans de Goede , Bartosz Golaszewski X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1618; i=manivannan.sadhasivam@oss.qualcomm.com; h=from:subject:message-id; bh=ufAjqbjVnkw5Wp64hBIBNRpJbSZpySlLbuaUxcUM4UA=; b=owEBbQGS/pANAwAKAVWfEeb+kc71AcsmYgBpnTeIOrSfXKDZNm2Hsenx3LBxiiDmoHJfRccc8 nS3AXdbEVWJATMEAAEKAB0WIQRnpUMqgUjL2KRYJ5dVnxHm/pHO9QUCaZ03iAAKCRBVnxHm/pHO 9ejfB/9vkVjNDMBin3BxrbVfMZ9p+ooG84OGnulSRlqxXjsPfe4bXcJCwM4McrlaLgcJktdtA6N 9kxM57T3t1ognMa2z6UV7NLxIgDxP/kWASvW1YYfXTC+RJyaCmEqEkKVMJNq4CrUuq0f3zgiDLx ci8l6d4VtkF2wq+lyaU2YnBO31Lg0xpps5jr5HMhS5DtjwDXN81QHwvZZAkt0OJpx/9m9GO7BP4 kotz/I4twxdRLlqjYzh4zp1jDJO0aGK6ow4RBbjITBJwj/489ILOTwkkIs44m6MXWjIfldQQS1k MheuT+0sHnNF3AVXKslu83JCWu5UOMlAQ1B3Xxflt7z8Zsz/ X-Developer-Key: i=manivannan.sadhasivam@oss.qualcomm.com; a=openpgp; fpr=C668AEC3C3188E4C611465E7488550E901166008 X-Endpoint-Received: by B4 Relay for manivannan.sadhasivam@oss.qualcomm.com/default with auth_id=461 X-Original-From: Manivannan Sadhasivam Reply-To: manivannan.sadhasivam@oss.qualcomm.com From: Manivannan Sadhasivam Power supply to the M.2 Bluetooth device attached to the host using M.2 connector is controlled using the 'uart' pwrseq device. So add support for getting the pwrseq device if the OF graph link is present. Once obtained, the existing pwrseq APIs can be used to control the power supplies of the M.2 card. Tested-by: Hans de Goede # ThinkPad T14s = gen6 (arm64) Reviewed-by: Bartosz Golaszewski Signed-off-by: Manivannan Sadhasivam --- drivers/bluetooth/hci_qca.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c index 5b02e7c3f56d..0454c2318461 100644 --- a/drivers/bluetooth/hci_qca.c +++ b/drivers/bluetooth/hci_qca.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -2421,6 +2422,14 @@ static int qca_serdev_probe(struct serdev_device *se= rdev) case QCA_WCN6855: case QCA_WCN7850: case QCA_WCN6750: + if (of_graph_is_present(dev_of_node(&serdev->ctrl->dev))) { + qcadev->bt_power->pwrseq =3D devm_pwrseq_get(&serdev->ctrl->dev, + "uart"); + if (IS_ERR(qcadev->bt_power->pwrseq)) + return PTR_ERR(qcadev->bt_power->pwrseq); + break; + } + if (!device_property_present(&serdev->dev, "enable-gpios")) { /* * Backward compatibility with old DT sources. If the --=20 2.51.0 From nobody Fri Apr 17 07:14:09 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 76AE22C11CD; Tue, 24 Feb 2026 05:30:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771911053; cv=none; b=LpnouZ5oovrg3m0zbkvot1QHuOuiDBdtfVIbo9fARFiTOiwco3ZcTnzEp9u8KIRKwSCIdUsEFMEBtMq8F9NzG5R89i6B4mdclx+6svUAt3tCxoVoIDrO20H8oWK6/gOdfQL2qmqeuuFyjjLwTJUnbNEhtg7jJkXtkJ2fKZrRSEs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771911053; c=relaxed/simple; bh=QPg5ucT2J9JR6E3rS7caTqzm372tAM2YlgwRdg7/hwg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=VAlPnk6mqqhy77o2lPtZnahn8Jr4qnQ9SPPPPnSqysSOWp3R3EPkYDvJbWQgOB7k4TQRUEPqyi8rK+kCJIaVEoB7jZVM9nr6YIdrBvaBIDzSxG5CjmgkWG7Lm9pySwr1oIfQCujU/l2l9DxJSTU2OtLk0cUN71gE+7+5vBXH3FI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=gGOSD87k; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="gGOSD87k" Received: by smtp.kernel.org (Postfix) with ESMTPS id 4018EC2BCB7; Tue, 24 Feb 2026 05:30:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771911053; bh=QPg5ucT2J9JR6E3rS7caTqzm372tAM2YlgwRdg7/hwg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=gGOSD87kmjgj/DMgg9IC79SFDxvfsMj6anIsTW3UTfT6yXg4NROB0yMZgrNwpB+rF LTnABVeyQxHm5jEow88K8FlUoL9owmQcb9d8T8jtcXXJUUoZqyRcs+Gtb7Qi+xzduf G79nrhFTJYc+h8DizDOVMx1V4u0ylTRERO0lRo3uJMxmy1A+g0r+0g8I67hnA0Itvk Ai+YMZ8fx13z2IgOWQOTKus6urQfreU+NaoIpZ/s21Mqk2P0TiclqMeR6ifSuoBge/ XXZp8MKFMEQ5guCUbKNzkh3J2CGhwXRQqMnA2PN8fK4RXyzxrspOyTFiENHt1sFWG7 Lj0eJgqglsGqA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2409EEFB800; Tue, 24 Feb 2026 05:30:53 +0000 (UTC) From: Manivannan Sadhasivam via B4 Relay Date: Tue, 24 Feb 2026 11:00:54 +0530 Subject: [PATCH v5 8/9] power: sequencing: pcie-m2: Add support for PCIe M.2 Key E connectors Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260224-pci-m2-e-v5-8-dd9b9501d33c@oss.qualcomm.com> References: <20260224-pci-m2-e-v5-0-dd9b9501d33c@oss.qualcomm.com> In-Reply-To: <20260224-pci-m2-e-v5-0-dd9b9501d33c@oss.qualcomm.com> To: Rob Herring , Greg Kroah-Hartman , Jiri Slaby , Nathan Chancellor , Nicolas Schier , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Mark Pearson , "Derek J. Clark" , Manivannan Sadhasivam , Krzysztof Kozlowski , Conor Dooley , Marcel Holtmann , Luiz Augusto von Dentz , Bartosz Golaszewski , Andy Shevchenko , Bartosz Golaszewski Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-bluetooth@vger.kernel.org, linux-pm@vger.kernel.org, Stephan Gerhold , Dmitry Baryshkov , linux-acpi@vger.kernel.org, Manivannan Sadhasivam , Hans de Goede X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=6901; i=manivannan.sadhasivam@oss.qualcomm.com; h=from:subject:message-id; bh=HRGptE1JIyA395dlxkM3raRO8gPG2oSfeqDUBhjL6YY=; b=owEBbAGT/pANAwAKAVWfEeb+kc71AcsmYgBpnTeItvqqUYlI77jr1d50XlgHPzuXBe67DzZVK P+f6NZxPmyJATIEAAEKAB0WIQRnpUMqgUjL2KRYJ5dVnxHm/pHO9QUCaZ03iAAKCRBVnxHm/pHO 9YDFB/iDOYQLM8wTzHJ09bYyH2+5hIcEt9ZXbw1+VABhHFVw0OhHOj4DSQEVkqudUucAEXfNOB1 H1tyiKxRFelDbG0MUQ597KkeErAh3uzenKEUYihryAuk+V2IKdfm4M0H3+bKT7EQSHeXm+YY/Wy vfji1zMNgsV9ls+Ozsms8YkuF46uWOU7To1nZWvXMw6ZPRSiYeIi+JwJnhhX3Ajr7nhvNuoBuus zSy6iHTcgDdYjmNU1u5G1MSZwtq5Qm2qy8Gbh1lgpsjRtwGUKDTdyQXaaTiHP2ilmWoB+PonejY BuWWz8X2JjoBEsFXMmSo/JhIAYMiulCadZ4Oap7EAE1yRnE= X-Developer-Key: i=manivannan.sadhasivam@oss.qualcomm.com; a=openpgp; fpr=C668AEC3C3188E4C611465E7488550E901166008 X-Endpoint-Received: by B4 Relay for manivannan.sadhasivam@oss.qualcomm.com/default with auth_id=461 X-Original-From: Manivannan Sadhasivam Reply-To: manivannan.sadhasivam@oss.qualcomm.com From: Manivannan Sadhasivam Add support for handling the power sequence of the PCIe M.2 Key E connectors. These connectors are used to attach the Wireless Connectivity devices to the host machine including combinations of WiFi, BT, NFC using interfaces such as PCIe/SDIO for WiFi, USB/UART for BT and I2C for NFC. Currently, this driver supports only the PCIe interface for WiFi and UART interface for BT. The driver also only supports driving the 3.3v/1.8v power supplies and W_DISABLE{1/2}# GPIOs. The optional signals of the Key E connectors are not currently supported. Tested-by: Hans de Goede # ThinkPad T14s = gen6 (arm64) Signed-off-by: Manivannan Sadhasivam --- drivers/power/sequencing/pwrseq-pcie-m2.c | 107 ++++++++++++++++++++++++++= ++-- 1 file changed, 101 insertions(+), 6 deletions(-) diff --git a/drivers/power/sequencing/pwrseq-pcie-m2.c b/drivers/power/sequ= encing/pwrseq-pcie-m2.c index d31a7dd8b35c..3507cdcb1e7b 100644 --- a/drivers/power/sequencing/pwrseq-pcie-m2.c +++ b/drivers/power/sequencing/pwrseq-pcie-m2.c @@ -5,10 +5,13 @@ */ =20 #include +#include +#include #include #include #include #include +#include #include #include #include @@ -25,16 +28,18 @@ struct pwrseq_pcie_m2_ctx { struct regulator_bulk_data *regs; size_t num_vregs; struct notifier_block nb; + struct gpio_desc *w_disable1_gpio; + struct gpio_desc *w_disable2_gpio; }; =20 -static int pwrseq_pcie_m2_m_vregs_enable(struct pwrseq_device *pwrseq) +static int pwrseq_pcie_m2_vregs_enable(struct pwrseq_device *pwrseq) { struct pwrseq_pcie_m2_ctx *ctx =3D pwrseq_device_get_drvdata(pwrseq); =20 return regulator_bulk_enable(ctx->num_vregs, ctx->regs); } =20 -static int pwrseq_pcie_m2_m_vregs_disable(struct pwrseq_device *pwrseq) +static int pwrseq_pcie_m2_vregs_disable(struct pwrseq_device *pwrseq) { struct pwrseq_pcie_m2_ctx *ctx =3D pwrseq_device_get_drvdata(pwrseq); =20 @@ -43,18 +48,84 @@ static int pwrseq_pcie_m2_m_vregs_disable(struct pwrseq= _device *pwrseq) =20 static const struct pwrseq_unit_data pwrseq_pcie_m2_vregs_unit_data =3D { .name =3D "regulators-enable", - .enable =3D pwrseq_pcie_m2_m_vregs_enable, - .disable =3D pwrseq_pcie_m2_m_vregs_disable, + .enable =3D pwrseq_pcie_m2_vregs_enable, + .disable =3D pwrseq_pcie_m2_vregs_disable, }; =20 -static const struct pwrseq_unit_data *pwrseq_pcie_m2_m_unit_deps[] =3D { +static const struct pwrseq_unit_data *pwrseq_pcie_m2_unit_deps[] =3D { &pwrseq_pcie_m2_vregs_unit_data, NULL }; =20 +static int pwrseq_pci_m2_e_uart_enable(struct pwrseq_device *pwrseq) +{ + struct pwrseq_pcie_m2_ctx *ctx =3D pwrseq_device_get_drvdata(pwrseq); + + return gpiod_set_value_cansleep(ctx->w_disable2_gpio, 0); +} + +static int pwrseq_pci_m2_e_uart_disable(struct pwrseq_device *pwrseq) +{ + struct pwrseq_pcie_m2_ctx *ctx =3D pwrseq_device_get_drvdata(pwrseq); + + return gpiod_set_value_cansleep(ctx->w_disable2_gpio, 1); +} + +static const struct pwrseq_unit_data pwrseq_pcie_m2_e_uart_unit_data =3D { + .name =3D "uart-enable", + .deps =3D pwrseq_pcie_m2_unit_deps, + .enable =3D pwrseq_pci_m2_e_uart_enable, + .disable =3D pwrseq_pci_m2_e_uart_disable, +}; + +static int pwrseq_pci_m2_e_pcie_enable(struct pwrseq_device *pwrseq) +{ + struct pwrseq_pcie_m2_ctx *ctx =3D pwrseq_device_get_drvdata(pwrseq); + + return gpiod_set_value_cansleep(ctx->w_disable1_gpio, 0); +} + +static int pwrseq_pci_m2_e_pcie_disable(struct pwrseq_device *pwrseq) +{ + struct pwrseq_pcie_m2_ctx *ctx =3D pwrseq_device_get_drvdata(pwrseq); + + return gpiod_set_value_cansleep(ctx->w_disable1_gpio, 1); +} + +static const struct pwrseq_unit_data pwrseq_pcie_m2_e_pcie_unit_data =3D { + .name =3D "pcie-enable", + .deps =3D pwrseq_pcie_m2_unit_deps, + .enable =3D pwrseq_pci_m2_e_pcie_enable, + .disable =3D pwrseq_pci_m2_e_pcie_disable, +}; + static const struct pwrseq_unit_data pwrseq_pcie_m2_m_pcie_unit_data =3D { .name =3D "pcie-enable", - .deps =3D pwrseq_pcie_m2_m_unit_deps, + .deps =3D pwrseq_pcie_m2_unit_deps, +}; + +static int pwrseq_pcie_m2_e_pwup_delay(struct pwrseq_device *pwrseq) +{ + /* + * FIXME: This delay is only required for some Qcom WLAN/BT cards like + * WCN7850 and not for all devices. But currently, there is no way to + * identify the device model before enumeration. + */ + msleep(50); + + return 0; +} + +static const struct pwrseq_target_data pwrseq_pcie_m2_e_uart_target_data = =3D { + .name =3D "uart", + .unit =3D &pwrseq_pcie_m2_e_uart_unit_data, + .post_enable =3D pwrseq_pcie_m2_e_pwup_delay, +}; + +static const struct pwrseq_target_data pwrseq_pcie_m2_e_pcie_target_data = =3D { + .name =3D "pcie", + .unit =3D &pwrseq_pcie_m2_e_pcie_unit_data, + .post_enable =3D pwrseq_pcie_m2_e_pwup_delay, }; =20 static const struct pwrseq_target_data pwrseq_pcie_m2_m_pcie_target_data = =3D { @@ -62,11 +133,21 @@ static const struct pwrseq_target_data pwrseq_pcie_m2_= m_pcie_target_data =3D { .unit =3D &pwrseq_pcie_m2_m_pcie_unit_data, }; =20 +static const struct pwrseq_target_data *pwrseq_pcie_m2_e_targets[] =3D { + &pwrseq_pcie_m2_e_pcie_target_data, + &pwrseq_pcie_m2_e_uart_target_data, + NULL +}; + static const struct pwrseq_target_data *pwrseq_pcie_m2_m_targets[] =3D { &pwrseq_pcie_m2_m_pcie_target_data, NULL }; =20 +static const struct pwrseq_pcie_m2_pdata pwrseq_pcie_m2_e_of_data =3D { + .targets =3D pwrseq_pcie_m2_e_targets, +}; + static const struct pwrseq_pcie_m2_pdata pwrseq_pcie_m2_m_of_data =3D { .targets =3D pwrseq_pcie_m2_m_targets, }; @@ -125,6 +206,16 @@ static int pwrseq_pcie_m2_probe(struct platform_device= *pdev) return dev_err_probe(dev, ret, "Failed to get all regulators\n"); =20 + ctx->w_disable1_gpio =3D devm_gpiod_get_optional(dev, "w-disable1", GPIOD= _OUT_HIGH); + if (IS_ERR(ctx->w_disable1_gpio)) + return dev_err_probe(dev, PTR_ERR(ctx->w_disable1_gpio), + "Failed to get the W_DISABLE_1# GPIO\n"); + + ctx->w_disable2_gpio =3D devm_gpiod_get_optional(dev, "w-disable2", GPIOD= _OUT_HIGH); + if (IS_ERR(ctx->w_disable2_gpio)) + return dev_err_probe(dev, PTR_ERR(ctx->w_disable2_gpio), + "Failed to get the W_DISABLE_2# GPIO\n"); + ctx->num_vregs =3D ret; =20 ret =3D devm_add_action_or_reset(dev, pwrseq_pcie_m2_free_regulators, ctx= ); @@ -150,6 +241,10 @@ static const struct of_device_id pwrseq_pcie_m2_of_mat= ch[] =3D { .compatible =3D "pcie-m2-m-connector", .data =3D &pwrseq_pcie_m2_m_of_data, }, + { + .compatible =3D "pcie-m2-e-connector", + .data =3D &pwrseq_pcie_m2_e_of_data, + }, { } }; MODULE_DEVICE_TABLE(of, pwrseq_pcie_m2_of_match); --=20 2.51.0 From nobody Fri Apr 17 07:14:09 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 733652C0F78; Tue, 24 Feb 2026 05:30:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771911053; cv=none; b=JKUk3SoeSWguXBtzpe9D2ivB6ooiGNHJpQWinqTd4r+cwF9hRzYMEZfyz83ZrTVxkIm+TV1wQwXBPW097UbSM304IWYgnK73aZ0J4SH5assob8j66SDt+nbqh5rV1RJolIs/tetshNiJrx6p83oFA5RzSUruG2o2PMjsDuqlnak= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771911053; c=relaxed/simple; bh=kyfTo/8USTG3OqpqST1Bs5VOfk+TjVTQurHs0EidrHM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=dmMjgK+ljlXDCMxpiY2r31aFUX/dJOt//BF+ZfnZiiWk0D4794qLC/Untx+tjhYhyJ9qbz+pLgUU6T88xfbPdhqmLJAQQ1SAfoCtwmnbZ8xzUMu1nI2LZyyh4aCHeMw3KWWBzsHAbWBFFZfjcQrNITGRHD4xUcWkWLCluDo3h18= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=HGuC/hn/; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="HGuC/hn/" Received: by smtp.kernel.org (Postfix) with ESMTPS id 4C192C19425; Tue, 24 Feb 2026 05:30:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771911053; bh=kyfTo/8USTG3OqpqST1Bs5VOfk+TjVTQurHs0EidrHM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=HGuC/hn/JTEBWLoZDOcKMx/JPP3r7RG2HtVzCtecia0kCqqKwZtPpKGeC49UgWL+F r4tWsXUsi43mob5l0JPc+6sYA5OTrfxY/BpfYVtVFg6TzNKX2txKIu+FIW0NeQQnMI 9EPLn18nFbN0zJfLedixnfdEtI6Ya0tEYYM/qYPwL43gLt7KskEARZ6wM8e6GoIBf8 y6QM96drBhVZl8vUUqkpbTcZlX56rLaqPAr+OPqUANx7IAaDU019jMl+k07wgJ2fHJ qvwHsDiaorYNvB4i05ky8yKI9sZRBpuGTzRh/oKFXbyLYS3vhs53d9VjrtSfrGBALQ x0xdNgmvZFufQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 405AAEFB805; Tue, 24 Feb 2026 05:30:53 +0000 (UTC) From: Manivannan Sadhasivam via B4 Relay Date: Tue, 24 Feb 2026 11:00:55 +0530 Subject: [PATCH v5 9/9] power: sequencing: pcie-m2: Create serdev device for WCN7850 bluetooth Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260224-pci-m2-e-v5-9-dd9b9501d33c@oss.qualcomm.com> References: <20260224-pci-m2-e-v5-0-dd9b9501d33c@oss.qualcomm.com> In-Reply-To: <20260224-pci-m2-e-v5-0-dd9b9501d33c@oss.qualcomm.com> To: Rob Herring , Greg Kroah-Hartman , Jiri Slaby , Nathan Chancellor , Nicolas Schier , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Mark Pearson , "Derek J. Clark" , Manivannan Sadhasivam , Krzysztof Kozlowski , Conor Dooley , Marcel Holtmann , Luiz Augusto von Dentz , Bartosz Golaszewski , Andy Shevchenko , Bartosz Golaszewski Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-bluetooth@vger.kernel.org, linux-pm@vger.kernel.org, Stephan Gerhold , Dmitry Baryshkov , linux-acpi@vger.kernel.org, Manivannan Sadhasivam , Hans de Goede X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=8258; i=manivannan.sadhasivam@oss.qualcomm.com; h=from:subject:message-id; bh=iMQanxh48zZesV0ri7QIXxOpLmhhR5jmc4pGrWrdKNQ=; b=owEBbQGS/pANAwAKAVWfEeb+kc71AcsmYgBpnTeJgOHTAKrA9ShrAtobh7vVQuIco5Nt9DE6W TP3QHBHA1CJATMEAAEKAB0WIQRnpUMqgUjL2KRYJ5dVnxHm/pHO9QUCaZ03iQAKCRBVnxHm/pHO 9QQJB/sHCvHF1GkYVzmexefEic1g8TrXjKgolHEmbRf9vgJz+6VvuVoozqhY3b7JVRxPWRPpErv wCuhlwPrZHPajZ6oQ+1v1irI0+pdc+3/YN9jjJGgWe8CmTKN0M4Mt5YR4mZZ6J1XZxa8H7Sm/0z a4hrsjm8nyAhdQ/ReoGf+3Keqg9vXLAU4qdHoG0X3Sku27BPoEo6Puut7cbJFQXZkulQmaX0DdN aUDls5p03OfGIIVRgLdkBevrWPS2XDd3qohe1uP5CWdTY398HsMix30L4BEeXs95pjG5KEvvx/q 2F2+rrkxpek7TsNvldiVbMTAx5jwbOB9OSuzyLM6d1dcwTPm X-Developer-Key: i=manivannan.sadhasivam@oss.qualcomm.com; a=openpgp; fpr=C668AEC3C3188E4C611465E7488550E901166008 X-Endpoint-Received: by B4 Relay for manivannan.sadhasivam@oss.qualcomm.com/default with auth_id=461 X-Original-From: Manivannan Sadhasivam Reply-To: manivannan.sadhasivam@oss.qualcomm.com From: Manivannan Sadhasivam For supporting bluetooth over the non-discoverable UART interface of WCN7850, create the serdev device after enumerating the PCIe interface. This is mandatory since the device ID is only known after the PCIe enumeration and the ID is used for creating the serdev device. Since by default there is no OF or ACPI node for the created serdev, create a dynamic OF 'bluetooth' node with the 'compatible' property and attach it to the serdev device. This will allow the serdev device to bind to the existing bluetooth driver. Tested-by: Hans de Goede # ThinkPad T14s = gen6 (arm64) Signed-off-by: Manivannan Sadhasivam --- drivers/power/sequencing/Kconfig | 3 +- drivers/power/sequencing/pwrseq-pcie-m2.c | 171 ++++++++++++++++++++++++++= +++- 2 files changed, 170 insertions(+), 4 deletions(-) diff --git a/drivers/power/sequencing/Kconfig b/drivers/power/sequencing/Kc= onfig index f5fff84566ba..55aeef125e6f 100644 --- a/drivers/power/sequencing/Kconfig +++ b/drivers/power/sequencing/Kconfig @@ -37,7 +37,8 @@ config POWER_SEQUENCING_TH1520_GPU =20 config POWER_SEQUENCING_PCIE_M2 tristate "PCIe M.2 connector power sequencing driver" - depends on OF || COMPILE_TEST + depends on (PCI && OF) || COMPILE_TEST + select OF_DYNAMIC help Say Y here to enable the power sequencing driver for PCIe M.2 connectors. This driver handles the power sequencing for the M.2 diff --git a/drivers/power/sequencing/pwrseq-pcie-m2.c b/drivers/power/sequ= encing/pwrseq-pcie-m2.c index 3507cdcb1e7b..d398487202b9 100644 --- a/drivers/power/sequencing/pwrseq-pcie-m2.c +++ b/drivers/power/sequencing/pwrseq-pcie-m2.c @@ -12,9 +12,11 @@ #include #include #include +#include #include #include #include +#include #include =20 struct pwrseq_pcie_m2_pdata { @@ -30,6 +32,9 @@ struct pwrseq_pcie_m2_ctx { struct notifier_block nb; struct gpio_desc *w_disable1_gpio; struct gpio_desc *w_disable2_gpio; + struct serdev_device *serdev; + struct of_changeset *ocs; + struct device *dev; }; =20 static int pwrseq_pcie_m2_vregs_enable(struct pwrseq_device *pwrseq) @@ -172,13 +177,169 @@ static int pwrseq_pcie_m2_match(struct pwrseq_device= *pwrseq, return PWRSEQ_NO_MATCH; } =20 -static void pwrseq_pcie_m2_free_regulators(void *data) +static void pwrseq_pcie_m2_free_resources(void *data) { struct pwrseq_pcie_m2_ctx *ctx =3D data; =20 + serdev_device_remove(ctx->serdev); + bus_unregister_notifier(&pci_bus_type, &ctx->nb); + of_changeset_revert(ctx->ocs); + of_changeset_destroy(ctx->ocs); regulator_bulk_free(ctx->num_vregs, ctx->regs); } =20 +static int pwrseq_m2_pcie_create_bt_node(struct pwrseq_pcie_m2_ctx *ctx, + struct device_node *parent) +{ + struct device *dev =3D ctx->dev; + struct device_node *np; + int ret; + + ctx->ocs =3D devm_kzalloc(dev, sizeof(*ctx->ocs), GFP_KERNEL); + if (!ctx->ocs) + return -ENOMEM; + + of_changeset_init(ctx->ocs); + + np =3D of_changeset_create_node(ctx->ocs, parent, "bluetooth"); + if (!np) { + dev_err(dev, "Failed to create bluetooth node\n"); + ret =3D -ENODEV; + goto err_destroy_changeset; + } + + ret =3D of_changeset_add_prop_string(ctx->ocs, np, "compatible", "qcom,wc= n7850-bt"); + if (ret) { + dev_err(dev, "Failed to add bluetooth compatible: %d\n", ret); + goto err_destroy_changeset; + } + + ret =3D of_changeset_apply(ctx->ocs); + if (ret) { + dev_err(dev, "Failed to apply changeset: %d\n", ret); + goto err_destroy_changeset; + } + + ret =3D device_add_of_node(&ctx->serdev->dev, np); + if (ret) { + dev_err(dev, "Failed to add OF node: %d\n", ret); + goto err_revert_changeset; + } + + return 0; + +err_revert_changeset: + of_changeset_revert(ctx->ocs); +err_destroy_changeset: + of_changeset_destroy(ctx->ocs); + + return ret; +} + +static int pwrseq_m2_pcie_notify(struct notifier_block *nb, unsigned long = action, + void *data) +{ + struct pwrseq_pcie_m2_ctx *ctx =3D container_of(nb, struct pwrseq_pcie_m2= _ctx, nb); + struct pci_dev *pdev =3D to_pci_dev(data); + struct serdev_controller *serdev_ctrl; + struct device *dev =3D ctx->dev; + int ret; + + /* + * Check whether the PCI device is associated with this M.2 connector or + * not, by comparing the OF node of the PCI device parent and the Port 0 + * (PCIe) remote node parent OF node. + */ + struct device_node *pci_parent __free(device_node) =3D + of_graph_get_remote_node(dev_of_node(ctx->dev), 0, 0); + if (!pci_parent || (pci_parent !=3D pdev->dev.parent->of_node)) + return NOTIFY_DONE; + + switch (action) { + case BUS_NOTIFY_ADD_DEVICE: + /* Create serdev device for WCN7850 */ + if (pdev->vendor =3D=3D PCI_VENDOR_ID_QCOM && pdev->device =3D=3D 0x1107= ) { + struct device_node *serdev_parent __free(device_node) =3D + of_graph_get_remote_node(dev_of_node(ctx->dev), 1, 1); + if (!serdev_parent) + return NOTIFY_DONE; + + serdev_ctrl =3D of_find_serdev_controller_by_node(serdev_parent); + if (!serdev_ctrl) + return NOTIFY_DONE; + + ctx->serdev =3D serdev_device_alloc(serdev_ctrl); + if (!ctx->serdev) + return NOTIFY_BAD; + + ret =3D pwrseq_m2_pcie_create_bt_node(ctx, serdev_parent); + if (ret) { + serdev_device_put(ctx->serdev); + return notifier_from_errno(ret); + } + + ret =3D serdev_device_add(ctx->serdev); + if (ret) { + dev_err(dev, "Failed to add serdev for WCN7850: %d\n", ret); + of_changeset_revert(ctx->ocs); + of_changeset_destroy(ctx->ocs); + serdev_device_put(ctx->serdev); + return notifier_from_errno(ret); + } + } + break; + case BUS_NOTIFY_REMOVED_DEVICE: + /* Destroy serdev device for WCN7850 */ + if (pdev->vendor =3D=3D PCI_VENDOR_ID_QCOM && pdev->device =3D=3D 0x1107= ) { + serdev_device_remove(ctx->serdev); + of_changeset_revert(ctx->ocs); + of_changeset_destroy(ctx->ocs); + } + break; + } + + return NOTIFY_OK; +} + +static bool pwrseq_pcie_m2_check_remote_node(struct device *dev, u8 port, = u8 endpoint, + const char *node) +{ + struct device_node *remote __free(device_node) =3D + of_graph_get_remote_node(dev_of_node(dev), port, endpoint); + + if (remote && of_node_name_eq(remote, node)) + return true; + + return false; +} + +/* + * If the connector exposes a non-discoverable bus like UART, the respecti= ve + * protocol device needs to be created manually with the help of the notif= ier + * of the discoverable bus like PCIe. + */ +static int pwrseq_pcie_m2_register_notifier(struct pwrseq_pcie_m2_ctx *ctx= , struct device *dev) +{ + int ret; + + /* + * Register a PCI notifier for Key E connector that has PCIe as Port + * 0/Endpoint 0 interface and Serial as Port 3/Endpoint 0 interface. + */ + if (pwrseq_pcie_m2_check_remote_node(dev, 3, 0, "serial")) { + if (pwrseq_pcie_m2_check_remote_node(dev, 0, 0, "pcie")) { + ctx->dev =3D dev; + ctx->nb.notifier_call =3D pwrseq_m2_pcie_notify; + ret =3D bus_register_notifier(&pci_bus_type, &ctx->nb); + if (ret) + return dev_err_probe(dev, ret, + "Failed to register notifier for serdev\n"); + } + } + + return 0; +} + static int pwrseq_pcie_m2_probe(struct platform_device *pdev) { struct device *dev =3D &pdev->dev; @@ -218,7 +379,7 @@ static int pwrseq_pcie_m2_probe(struct platform_device = *pdev) =20 ctx->num_vregs =3D ret; =20 - ret =3D devm_add_action_or_reset(dev, pwrseq_pcie_m2_free_regulators, ctx= ); + ret =3D devm_add_action_or_reset(dev, pwrseq_pcie_m2_free_resources, ctx); if (ret) return ret; =20 @@ -233,7 +394,11 @@ static int pwrseq_pcie_m2_probe(struct platform_device= *pdev) return dev_err_probe(dev, PTR_ERR(ctx->pwrseq), "Failed to register the power sequencer\n"); =20 - return 0; + /* + * Register a notifier for creating protocol devices for + * non-discoverable busses like UART. + */ + return pwrseq_pcie_m2_register_notifier(ctx, dev); } =20 static const struct of_device_id pwrseq_pcie_m2_of_match[] =3D { --=20 2.51.0