From nobody Sat Feb 7 08:27:42 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 342A6306B12; Mon, 12 Jan 2026 16:28:33 +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=1768235313; cv=none; b=F8hVcokTJEAUK/f6jIHpq/Arsz6SEON0car4aAZ1N88GOsieVUGsyOcWoDeTMkBvGekAd3uIwqwYVOpj/YCAKzZ6cIF/uzBb4Rs7IuzWs4fMmJY1FUfBI3aL6PHsemLCCnhAnJb0gcQCbpV/LwNSeYojAON+6jY9exX+mHqAP3U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768235313; c=relaxed/simple; bh=GlJ71tujJcltgFnDfKrfK0RHu+muqUMEqgwXCraygEc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WPe0jGXBjEqXepV8yV59nLelKQPqUA97ya2SQ+hSXPF1Q1UvX03M3LFvd51SrZzII4C/pglEmjV7fJkQTBTIdIHTdQcXYRPOHh+GMmdH8HWe2ZbHH7HHjAs1T/7Wv2uXk5pSXv1O2YlqstUajXP/VVPjRTKN2nOOnmy7JZw/rwg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=PaUH/J9R; 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="PaUH/J9R" Received: by smtp.kernel.org (Postfix) with ESMTPS id 07FE9C16AAE; Mon, 12 Jan 2026 16:28:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1768235313; bh=GlJ71tujJcltgFnDfKrfK0RHu+muqUMEqgwXCraygEc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=PaUH/J9RPZmbIvHp2Fn+kT5AYtWmn23AwVRzXo0vhaxyzQifOAi0+znz4sLkMxQBa J6Pwj+gwDTJM5TxkiOEdSus301MZUeGZrvvS/joQgoGBPtPGmOBxTrGyspe+UCXmKf yXmFHxTXh1dRZWSfBcSvHeDvRkaewgB1o9hWxuI7SJTFfMkj2Mv87QBVPAKgosUJGR wVt2XxGpd/twxXNR51uvuqK9/kUYRwVlocXpd7IAtq1/t0BkJI0K/GdzBf8l5b0oRE fBLp1A9+rjuVWxEsbB7mi3G8yXVMLDXO3ah01prMR0DpYlJA1BTFQZq9UR7XwBFesV nirHgWt74kmgA== 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 E3306D25041; Mon, 12 Jan 2026 16:28:32 +0000 (UTC) From: Manivannan Sadhasivam via B4 Relay Date: Mon, 12 Jan 2026 21:56:00 +0530 Subject: [PATCH v4 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: <20260112-pci-m2-e-v4-1-eff84d2c6d26@oss.qualcomm.com> References: <20260112-pci-m2-e-v4-0-eff84d2c6d26@oss.qualcomm.com> In-Reply-To: <20260112-pci-m2-e-v4-0-eff84d2c6d26@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 , Bartosz Golaszewski X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=2192; i=manivannan.sadhasivam@oss.qualcomm.com; h=from:subject:message-id; bh=07vK9ciXXRPSn3N/nNhnkZAEN4PO5YKuZEczKGyjzQ4=; b=owEBbQGS/pANAwAKAVWfEeb+kc71AcsmYgBpZSEtLU1+T/SQ8muTj88PMLYAc1JIDUMVESqYm PJvutm3t5WJATMEAAEKAB0WIQRnpUMqgUjL2KRYJ5dVnxHm/pHO9QUCaWUhLQAKCRBVnxHm/pHO 9ZvgCACOa5aYDJDQeVpU6yq+fCGtKV9Xz1BGEatNRuENRILo7sSUAPtGbyGfxzQ/0vcy4Gb+3tW jcnVrjZLjEZ+dCXlNXAFyy6VwIckMC8ZO8GOlS67JL5iOmWHfQ/aFzmBY9Uz79eiPwI6BCQTliK 1hhKWLBCLzlvHxyooeqQs1gksE36iewETbO1uczvYdH5m2JtG9K6jY89FC7YE756kTcdmskU6B4 CKcv2Zojofh08iFJ1rz0zid+PoQTNbqCffd6F7xPEkCRAl31mzXhHRzRKNItT5fgOdkhPKgCVC7 YRafq06sSCerUESzjyX7I3cqm12BXILp3NiBAcA8WQ3w/Pxo 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 d= iscards '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. Reviewed-by: Bartosz Golaszewski Signed-off-by: Manivannan Sadhasivam Tested-by: Hans de Goede # ThinkPad T14s = gen6 (arm64) --- 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 34562eb99931..ecde0ad3e248 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 @@ -67,10 +64,7 @@ struct serdev_device_driver { void (*remove)(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, @@ -111,10 +105,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.48.1 From nobody Sat Feb 7 08:27:42 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 65C6C365A08; Mon, 12 Jan 2026 16:28:33 +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=1768235313; cv=none; b=CS5Q9rnh5j+23ReRfGY2DQ3p32KdNwgJoygxW7in2xckCL6pqpJRZ1Qq22jwV8lslo0o2kfHzjTOwCHVL0oqrRmPpVBdkAxxpKwuui1j98Vbx+FdXDEtXRTR22oajjKkBHUUJBwwQUqf9LiSftX0v54m6wDDdPfbDV2xp9z8HKs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768235313; c=relaxed/simple; bh=VwpIUgJ7TQ6NyHLOeJDcf/38Dl2NWNEcsZHgAexS5KQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=rszeTCG8rNTUTv3k74TFsOZKEv9jqQtfG/Gr4KTN18wrn47w4mlCaIymcMk9N11EykfkjebGAj6lUE6IMBlcyQYj3mPjSVCR0J2C0GfZbq8QOQSFMjlJDkdncWaBiOFQaFKc6M9k1RMNHhWAlDgWG4+X5wsyOXnelYTUqao+dUo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=l1jlFzrW; 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="l1jlFzrW" Received: by smtp.kernel.org (Postfix) with ESMTPS id 1ED2DC2BC86; Mon, 12 Jan 2026 16:28:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1768235313; bh=VwpIUgJ7TQ6NyHLOeJDcf/38Dl2NWNEcsZHgAexS5KQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=l1jlFzrWXiR+bPz/tAoas97NLT3Sb/mzv/cNexBpkyN935yKgZXrwyX5hcKRvRWjW /7jdusQk9J3KQGxEtdTLD5ZSske7arq9+Iu5Ch8DZj9lY8up+xxNq1rIUNlri/FgCn 3vOXtBLeIfa3f4t8wxrsioZZcaZekECdmbd9t5rJ1/20S/t7yEmc1wtG3xnPqgLKor 4y57st7Z9mpvOpEGeY57j6kcJpyP2SRV5sPfInfvcbU/XQPCatGtwMUBAwXKGa7kPm AOSZzGf0ziGPBDfNzg9l346zshWCwOqdx4ULtHAja92RflyzlMgfhNeu7gcUjVvC48 OZouoGi8Vld1A== 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 11230C9EC9D; Mon, 12 Jan 2026 16:28:33 +0000 (UTC) From: Manivannan Sadhasivam via B4 Relay Date: Mon, 12 Jan 2026 21:56:01 +0530 Subject: [PATCH v4 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: <20260112-pci-m2-e-v4-2-eff84d2c6d26@oss.qualcomm.com> References: <20260112-pci-m2-e-v4-0-eff84d2c6d26@oss.qualcomm.com> In-Reply-To: <20260112-pci-m2-e-v4-0-eff84d2c6d26@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 X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1955; i=manivannan.sadhasivam@oss.qualcomm.com; h=from:subject:message-id; bh=J1VmrZOJOQw4R6fDrVVe/0GgAe/UzN5xgoimqww9n5Q=; b=owEBbQGS/pANAwAKAVWfEeb+kc71AcsmYgBpZSEtqgiwm1mkQDaD/Wb8/ZXVgx6a+CPfmCw+6 HFABhElf66JATMEAAEKAB0WIQRnpUMqgUjL2KRYJ5dVnxHm/pHO9QUCaWUhLQAKCRBVnxHm/pHO 9eMPCACobFxxteG5pdzS0luxGgzCXNtDCi5oiEXMX32Vb8bWtrZ6t6eXEP/LLe4esV0w1AiTKKk 6s5b9O2HMWDmQgjJOMSQl1ee7bmPg9QkbGIJnbs4Bhz+jCEGUAt4x3aNRE2Oi9CGeN37cG4HsB8 UK+Wd4Y2JHpUYg/Pyt85++38RT6kG0/RTLg0apGiKZf0jCGUbAu9+1aw2yReUTLJ5H1HKNYjxHI HPuc55LD9SuUMtuAbvxzkxj9XNeO+KgY5yLfxprgHSmvlGkNxbTWmxOPCZ4hMQ9sipJvTCu5yWd 04yiZzfEKcRICb2XsaVVDdU/yohakOQ8Bjl6pY2KGzqw6lxD 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. Signed-off-by: Manivannan Sadhasivam Tested-by: Hans de Goede # ThinkPad T14s = gen6 (arm64) --- drivers/tty/serdev/core.c | 16 ++++++++++++++++ include/linux/serdev.h | 9 +++++++++ 2 files changed, 25 insertions(+) diff --git a/drivers/tty/serdev/core.c b/drivers/tty/serdev/core.c index b33e708cb245..25382c2d63e6 100644 --- a/drivers/tty/serdev/core.c +++ b/drivers/tty/serdev/core.c @@ -504,6 +504,22 @@ struct serdev_controller *serdev_controller_alloc(stru= ct device *host, } EXPORT_SYMBOL_GPL(serdev_controller_alloc); =20 +/** + * 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. + */ +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); + 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 ecde0ad3e248..db9bfaba0662 100644 --- a/include/linux/serdev.h +++ b/include/linux/serdev.h @@ -333,4 +333,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 +struct serdev_controller *of_find_serdev_controller_by_node(struct device_= node *node) +{ + return NULL; +} +#endif /* CONFIG_OF */ + #endif /*_LINUX_SERDEV_H */ --=20 2.48.1 From nobody Sat Feb 7 08:27:42 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 75492365A0C; Mon, 12 Jan 2026 16:28:33 +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=1768235313; cv=none; b=JWcSMDpuaM8AaFa233P7up1Ov1dUkkdNB0RHmMHVE96QXQwakeTHp0OdgFx1cwEdmECsLUp/Ecde5rTmi4KYA/Qk7zw6T9dRw0DmnoMLvGmeYm6wxoj1frJX9oYIh7Zuu8LIJu7WNL9NEdkCNb0jPjuszsA7O/pj7yZNNQf0t7E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768235313; c=relaxed/simple; bh=phbllhBeNk7oBieBbdMZ19g98Tr+ZxNyuZaevxor5S0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=q5PHELz/CYG+KFhiBzxNjyNtMIlfvWst3ovq6CpSuwu6AhO05/99YN5WKhbl0hC4WmNIfphc421ZrTZJsowfs0mcmYLBFjIET2YenetvojVgswwY4vupWsV36Sv3ZqfGoic9+9FRUhlQ82QeugTwxcUvrFY8Np0v/v/vTN//aas= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=F4nQZ1S7; 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="F4nQZ1S7" Received: by smtp.kernel.org (Postfix) with ESMTPS id 3B553C2BCB2; Mon, 12 Jan 2026 16:28:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1768235313; bh=phbllhBeNk7oBieBbdMZ19g98Tr+ZxNyuZaevxor5S0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=F4nQZ1S78CcMZWdW1XgLQGl1teVUKpAnABs9/uUWl8FS/su+2V/Un2fforQvWfTmp YIjDhF79H+ThwzIu4IzuDcLu+9eLlKM76n4HYP5Uh6LCwawyfVFfIPbBrgDuOJMQds fbPBdlytTcyrOWBfesgw2LBrxa+qQoWQbmYqBf2S1mAzxmB3Rd9+le6ITiyXHE+N8V 9tb7YVVp5LrUSobxjIi/vDulZAQtTSOOi/XumU/eHmdt2kWd++646HMidlojuF0C4q lf/dALibwLNezGpjo5Cl9gORvSb0zEWUBHOu/xC/3LHIkfFYoOEfWao7mFMxs5hhOL 0PNDYYB3IN7Vg== 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 31B88D26D97; Mon, 12 Jan 2026 16:28:33 +0000 (UTC) From: Manivannan Sadhasivam via B4 Relay Date: Mon, 12 Jan 2026 21:56:02 +0530 Subject: [PATCH v4 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: <20260112-pci-m2-e-v4-3-eff84d2c6d26@oss.qualcomm.com> References: <20260112-pci-m2-e-v4-0-eff84d2c6d26@oss.qualcomm.com> In-Reply-To: <20260112-pci-m2-e-v4-0-eff84d2c6d26@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 , Bartosz Golaszewski X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1366; i=manivannan.sadhasivam@oss.qualcomm.com; h=from:subject:message-id; bh=70A6WG9+LyiVcQGDZXLPxALHM/UGaFUvvsHfTehdZzg=; b=owEBbQGS/pANAwAKAVWfEeb+kc71AcsmYgBpZSEtRw78QNqqJdo870z1l/BYbYj/u0Xo8r9YZ n37jmcGrM+JATMEAAEKAB0WIQRnpUMqgUjL2KRYJ5dVnxHm/pHO9QUCaWUhLQAKCRBVnxHm/pHO 9XR+B/0VHC0628+hDHpd19trCYGlXPgy6Z8cGBNjn01kj0yUXk6jb/+LeCFJ2G9lQb/kax+79eM AXWKVqINoOT5dQbYrlX+VTPS9X6V6SDDJ8txyXwch2RDN01oFF9zNYRj2XFiweXK4TLvcTeEBoj lvvN0KMMMNvn2na1hauUv9k6EJhLjvY0R8OMW5h1fElKq7CbQkWWYppz6RjOV+PCcEI0dk/Bf/q JY0Gyn0ro6S7fq+GL39z27cRhl7DlIjVZBLMlj76Fdue8Apoh7ZUpZd0gU6rqRJNDrNcrm1izz6 MrZl4F4astYmm88mZceGrs9P9ar2MV8krQPH3LbL7pvBZLCp 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. Reviewed-by: Bartosz Golaszewski Signed-off-by: Manivannan Sadhasivam Tested-by: Hans de Goede # ThinkPad T14s = gen6 (arm64) --- 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 25382c2d63e6..f8093b606dda 100644 --- a/drivers/tty/serdev/core.c +++ b/drivers/tty/serdev/core.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -548,7 +549,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(ctrl->dev.of_node)) return -ENODEV; =20 return 0; --=20 2.48.1 From nobody Sat Feb 7 08:27:42 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 87094365A1E; Mon, 12 Jan 2026 16:28:33 +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=1768235313; cv=none; b=aUnBVEFlSuhB2xPZV378DUZh+XJNWCrtH65ixEgYqVhPOo94g5EfPnxLkEAQpuQfecm5EYUnhQXGv5eJWN953pTjdZKnLG8B4V7aFzoSnCPd+XDVK9RoFLCE9oa3uPiW44Z1v/gwoREIaFoz9eL96mvr6yY7uA1KdnFQrlyDD1w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768235313; c=relaxed/simple; bh=/73Is6LSiZFdQQ1Wgzmm55BHcfPO7Tzrd+XL5DP+qdM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qVwBndBcfk5LdJASpCRSpp/FH39WbZQ2YyenplUiQtzkKOgvKraeOuU9SApRODcUpo2nEYY6KAaAYjY7dLGMY4bg1p+XUD64c6TgHt3ucBzyXz9WZr5/nt473ErZ2GOKmaFUjbM2bEESRUqF5onOMJCcwjBgBazvXv0O/KfRN+A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=oMe+8sdX; 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="oMe+8sdX" Received: by smtp.kernel.org (Postfix) with ESMTPS id 5DA57C2BCB8; Mon, 12 Jan 2026 16:28:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1768235313; bh=/73Is6LSiZFdQQ1Wgzmm55BHcfPO7Tzrd+XL5DP+qdM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=oMe+8sdXJ4ErkQTsKSkCatE8iBDpSCkVKY+QhsKXX1AH3wcSbBNVotQ5WRgMcbz4u xNAgCvzAwPwcBftpRn91YE3gIUVJiiVzpV+CfH67yKUSD9eXL5rFcmHHnNSookf8B0 AJSydeRqREZbpVeWrvvxovPgJQdxdayQ61pblCeRVDV0Q4tOovPpe04LGHWIAP1d3S IhZHCyvxeY7z2Ymr+WHJo1vcjZlX56LwSrD6X/ap2U+uXvI6Oai9LMqqgiJtDTPj4r nUWock9soL8mGz6VQyGam3IcxnPCZaPEPQe7oUTYm5eV0ZwYoyE9V0OyD+Ul6RipAC d9/3iz8uGKKVw== 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 4F31FD25041; Mon, 12 Jan 2026 16:28:33 +0000 (UTC) From: Manivannan Sadhasivam via B4 Relay Date: Mon, 12 Jan 2026 21:56:03 +0530 Subject: [PATCH v4 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: <20260112-pci-m2-e-v4-4-eff84d2c6d26@oss.qualcomm.com> References: <20260112-pci-m2-e-v4-0-eff84d2c6d26@oss.qualcomm.com> In-Reply-To: <20260112-pci-m2-e-v4-0-eff84d2c6d26@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 X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=924; i=manivannan.sadhasivam@oss.qualcomm.com; h=from:subject:message-id; bh=T/idG4KQSOfNt30dCJ08aa+KY4iI2ktYxKaU/4zNwXM=; b=owEBbQGS/pANAwAKAVWfEeb+kc71AcsmYgBpZSEtv8Q38gSKx/zNAHHW7JSU4HH2xJDb10pel u2A0qNlaNCJATMEAAEKAB0WIQRnpUMqgUjL2KRYJ5dVnxHm/pHO9QUCaWUhLQAKCRBVnxHm/pHO 9bT/B/9fDJ+ncITWLZ7gbtwtnZXl1zMoVoh8Hz7vv0ap4NmdB+Y62hMvzahw9/Cp/gArGNqsVUm aB8HbCqZ0SpN5GwHK1wPtrxX0UultBtJVOZ4zn4aumBU/pPw7y23t+hfdeQWXLHCYLF/tA1XvKi ynC2ZQtlQvQO1ke1AhFKx3SLstFbm3Ny881k4UW40h7VOpxWJ9gFL8J9cH/xNHKy30kx4ptj7Yc oBPprPfyQIckHJJumSUYnOWjO3h2iqHA8JRhJQNOgOQ2J5oWZxm2v0NmBNzv9V6GWBVM4i6YEPs FyvdMhstqMEyGkn3jy7QI3tT2Q/ucwPhdvQJ1Dkm/fDhxAiK 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. Signed-off-by: Manivannan Sadhasivam Reviewed-by: Bartosz Golaszewski Reviewed-by: Rob Herring (Arm) Tested-by: Hans de Goede # ThinkPad T14s = gen6 (arm64) --- 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.48.1 From nobody Sat Feb 7 08:27:42 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 A3FCB36656A; Mon, 12 Jan 2026 16:28:33 +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=1768235313; cv=none; b=h3rkoW+AFjXWtzeyWr+mFx5ty5mq0ShacyG3oh0Jyx9SGsGdqHofEVY7Lv1OPgD1N39MWaUcefuhhCb6up4Uk8qyv7390PrdOgD6nonxaE1cAEaZobzmWXZSuLBeq1JHr5mp0jZnUVMtPe45RMp+8gSV/4jS8KwyrJwj5Kp8wiU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768235313; c=relaxed/simple; bh=dk4mLqGB8HV/CRsqSjV+YvmEuqYCijETIhOorvXYALk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=A7eAu5wm3cbEC1iwiMubenNTJoU8C8FHCcdc4B96OLeCzADKa5u/hAp8eeRH9ivmVb/byOl61hZwegOlwGN6IF2+9nV45uVYUN1kTkre0fPx14+NSAB0TdSApkZQINza9cyhs6A/+UY+jWdMLm1GGobm2tCp9iHs5HVCoRuXGc4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=uMBdNXdC; 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="uMBdNXdC" Received: by smtp.kernel.org (Postfix) with ESMTPS id 78ECAC19422; Mon, 12 Jan 2026 16:28:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1768235313; bh=dk4mLqGB8HV/CRsqSjV+YvmEuqYCijETIhOorvXYALk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=uMBdNXdC2udhZv1Km1kpI8noWQQGQczFPNGoELzZ6RVtV8ZqncFTdfMLnjh3a28eW YKblJ9zenujxwwEkQDgJ2Qq13oROLosr20/+OzPFY3NWAdIbs0/bw/rnK9VnmhQSN1 IPR0B0dPG38MlSS8c8WXvJFK9R4psLtlqQkpwImkOMmZL31J0Fb3vZcHpW/rlQxrLc H7MwVxoZq/ZKb1mQ4SAvvG31eqTsxKyiI7D8f6WAe27LGxNRLTupvCw0rM8h9kM5IW VLXVejfb+s5PJozbq6/EyYlrwkDumSSOFWmzegZNDnRYV+0h3iY9A3OoH6hUfDZcRe nz+GoKfsyUgEw== 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 6E571C9EC7A; Mon, 12 Jan 2026 16:28:33 +0000 (UTC) From: Manivannan Sadhasivam via B4 Relay Date: Mon, 12 Jan 2026 21:56:04 +0530 Subject: [PATCH v4 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: <20260112-pci-m2-e-v4-5-eff84d2c6d26@oss.qualcomm.com> References: <20260112-pci-m2-e-v4-0-eff84d2c6d26@oss.qualcomm.com> In-Reply-To: <20260112-pci-m2-e-v4-0-eff84d2c6d26@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 X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=6614; i=manivannan.sadhasivam@oss.qualcomm.com; h=from:subject:message-id; bh=XIar5qWWuuTCWWImKyuSAf8zg9fVNlxonQh07PPLrYk=; b=owEBbQGS/pANAwAKAVWfEeb+kc71AcsmYgBpZSEtI+N5yAGS8NFBbCK+49S6Jd6/q1Fr+L6AM yL5mbWHci+JATMEAAEKAB0WIQRnpUMqgUjL2KRYJ5dVnxHm/pHO9QUCaWUhLQAKCRBVnxHm/pHO 9QL6B/4u5cfFebS4gsyqSm4c7wM0kc7PVl/RQ7clr/x/roKHYGtl0lmFzBd1bbHQfNbI13VQAPy SzqWiJ8Uxf66U2NweE8lQ1j18Pl/fUcgkyn7fVabjJ26jkGmDy5i5Js0Y8AVVdnvKprk6dWC7tA 10YyLynB8cLUSw7uG5Fm9CymdrrCXSn6ykDO0qIspJpwo4zEEO85XfweSlSwB9tZdfvDvs2byWa S1XyWtl0bqZ68a4nSdQ4XDOwDxKqOsLazcizJt57D18Wksc2jRft1auSjL4kc42iEOit9IHe2Lz qMo4czTh3LEX0rU2ua3TtXrEP/i5eCHpqA7fwRHSF1AslqH7 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. Signed-off-by: Manivannan Sadhasivam Tested-by: Hans de Goede # ThinkPad T14s = gen6 (arm64) --- .../bindings/connector/pcie-m2-e-connector.yaml | 154 +++++++++++++++++= ++++ MAINTAINERS | 1 + 2 files changed, 155 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..b65b39ddfd19 --- /dev/null +++ b/Documentation/devicetree/bindings/connector/pcie-m2-e-connector.yaml @@ -0,0 +1,154 @@ +# 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. + + 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: Connector interfaces for Wi-Fi + + properties: + endpoint@0: + $ref: /schemas/graph.yaml#/properties/endpoint + description: PCIe interface + + endpoint@1: + $ref: /schemas/graph.yaml#/properties/endpoint + description: SDIO interface + + anyOf: + - required: + - endpoint@0 + - required: + - endpoint@1 + + port@1: + $ref: /schemas/graph.yaml#/properties/port + description: Connector interfaces for BT + + properties: + endpoint@0: + $ref: /schemas/graph.yaml#/properties/endpoint + description: USB 2.0 interface + + endpoint@1: + $ref: /schemas/graph.yaml#/properties/endpoint + description: UART interface + + anyOf: + - required: + - endpoint@0 + - required: + - endpoint@1 + + port@2: + $ref: /schemas/graph.yaml#/properties/port + description: PCM/I2S interface + + i2c-parent: + $ref: /schemas/types.yaml#/definitions/phandle + description: I2C interface + + oneOf: + - required: + - port@0 + + 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 input to W_DISABLE1# signal. This signal is used by = the + system to disable WiFi radio in the M.2 card. Refer, PCI Express M.2 + Specification r4.0, sec 3.1.12.3 for more details. + maxItems: 1 + + w-disable2-gpios: + description: GPIO input to W_DISABLE2# signal. This signal is used by = the + system to disable WiFi radio in the M.2 card. Refer, PCI Express M.2 + Specification r4.0, sec 3.1.12.3 for more details. + maxItems: 1 + + viocfg-gpios: + description: GPIO output to IO voltage configuration (VIO_CFG) signal.= This + signal is used by the M.2 card to indicate to the host system that t= he + card supports an independent IO voltage domain for the sideband sign= als. + Refer, PCI Express M.2 Specification r4.0, sec 3.1.15.1 for more det= ails. + maxItems: 1 + +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>; + w-disable1-gpios =3D <&tlmm 117 GPIO_ACTIVE_LOW>; + w-disable2-gpios =3D <&tlmm 116 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@1 { + reg =3D <1>; + #address-cells =3D <1>; + #size-cells =3D <0>; + + endpoint@1 { + reg =3D <1>; + remote-endpoint =3D <&uart14_ep>; + }; + }; + }; + }; diff --git a/MAINTAINERS b/MAINTAINERS index 2eb7b6d26573..451c54675b24 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -20795,6 +20795,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.48.1 From nobody Sat Feb 7 08:27:42 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 E5599368284; Mon, 12 Jan 2026 16:28:33 +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=1768235314; cv=none; b=s0H90Sk7MJNkux6ez38adERmO8djIzStzGp70DL+zF4iYT4dg2RviawJWHjU2/XaMWlG9MPqT1YIg80SAQMrJixVq6t0LHOhp1w1gNkgyxlD40bMe4FvW1NbLp5foe78VM1ueQkPRw/n5Kut9F8Dxr43joJOq1rEyqiFR/RdqFs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768235314; c=relaxed/simple; bh=uwW8257EhmouZpvkVKGgdUbE780fBLOlGG44AztWPJU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=iX96DTWNERE9/S3eZ0lTaLr7v3d2erQ1PxbbwPJSWH4TIF0w5HiMvepSpwFQnZijTP3Qtj8DeucSLBANaLPKN7+5FrF029eIJTLpHiR9uFzrCuPZklS5GZldFcRLEzhOWcer5JF9yM3twY8AzHELmK5wKDXVNsejIZq3nJJfDqg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=gj/dus4E; 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="gj/dus4E" Received: by smtp.kernel.org (Postfix) with ESMTPS id B54D3C19425; Mon, 12 Jan 2026 16:28:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1768235313; bh=uwW8257EhmouZpvkVKGgdUbE780fBLOlGG44AztWPJU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=gj/dus4Ebu3+bJ8B8ksFvNd7Pq4ujI6e5xavjiVu7Luwteu1x04s8vU1JYGNPBppD PleO1Esntak//tuz8tQ8itvcXUh080oK0/Y5NK5DHW6olM355DfDe+C9X789vD81Rc o9fP5p9ItCGQNpwFT5gjHIiOBYDP+pumGQIn2tXhL6gxluqMv7fwozFAm9teQCvZSD rb06Zk8dslHm8WVxk1L5AqtZPnd6pjf0ZuOH7mGrnxpj3UPna3CzF0cRsK9walxAmL T+YYWoF9aMXEDLDoO0rYm0eUGODjoI+G6Zu2XHFPvOf/PynTuWD3fzB1ajiY0/a1fo qk94m28y7Ms4Q== 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 A6F5AC9EC9D; Mon, 12 Jan 2026 16:28:33 +0000 (UTC) From: Manivannan Sadhasivam via B4 Relay Date: Mon, 12 Jan 2026 21:56:05 +0530 Subject: [PATCH v4 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: <20260112-pci-m2-e-v4-6-eff84d2c6d26@oss.qualcomm.com> References: <20260112-pci-m2-e-v4-0-eff84d2c6d26@oss.qualcomm.com> In-Reply-To: <20260112-pci-m2-e-v4-0-eff84d2c6d26@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 X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1302; i=manivannan.sadhasivam@oss.qualcomm.com; h=from:subject:message-id; bh=RWekJdEKdic9EZu4rQGv0fBKORumjbEDCuN8SBTLMc4=; b=owEBbQGS/pANAwAKAVWfEeb+kc71AcsmYgBpZSEu9lkU8zXSarTBauv+J55+9dDXCd86TV95R Hg4HFzhvpuJATMEAAEKAB0WIQRnpUMqgUjL2KRYJ5dVnxHm/pHO9QUCaWUhLgAKCRBVnxHm/pHO 9en8B/9QtFwvoPLK8ytd54e3XPvecnAHB4Saxp+aBXFoEq0MQ+d102DNUVZifS3N24eYRSDdC41 TPbnS0A0513Snh4EoY48GHNfeZPGv+hEXoK15gVK/ZNI5nK9O/MvRwKmj8r5zLxkrQ20RnV4hAn SoZbqUwgIVFYomtyQg9XoFNBvu0CK83/dyK9vANbA6eDaS/7rCf5TE3x4v4Brox9U+vj2WKRZ2P LudJmT+kr2Ut2Mg2sfdZHDz8lAUHyNcqPVCf7PPAn0U/9834LuvC1pA9TtQpYj+xDRPF1oLuiDV En/W/ccMkGvtcQTnTSuLjChp9+eiw3xds8HO+nU/Vt6vLFXt 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 M connector. So add the "pcie-m2-1620-lga-connector" compatible with "pcie-m2-e-connector" fallback to reuse the Key M binding. Signed-off-by: Manivannan Sadhasivam Tested-by: Hans de Goede # ThinkPad T14s = gen6 (arm64) --- .../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 b65b39ddfd19..9757fe92907b 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.48.1 From nobody Sat Feb 7 08:27:42 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 00E3536829E; Mon, 12 Jan 2026 16:28:33 +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=1768235314; cv=none; b=nh2HQ4uLWMY6H7PMn6WR/f7g67sKTZC6VtCIAff04GzQTM88mHZwj/eD/RXkANXQJy2K4xq2pYdT/WebHj4T7bT8xU5qQjPEG1QjgLkfr+U36BukGQysxOilS23fv/03k1ZE3yPksdWDbLaPrOqIZI0hJ3xcHNugemCCnvi0GsQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768235314; c=relaxed/simple; bh=grrBzUog12+WE5FP8RC1t7J6n4Xk4iWQti4S7q8UyIM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Da932bBoNQgqaYa5F6/9RIot34cHYz26rLIkzYgSOBQ12fMiXK70fRT/T5p7wyORfDvcWEfDGixqdhgUWKkg/KYp0e6+MTaXSKwl45v9cGmTK5QhHVIHQmXm16XJbmtfVO2U5zVTNA9LA74p5oypcek4/txkEGwFLcJBuDfhroU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=o0iD7YdF; 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="o0iD7YdF" Received: by smtp.kernel.org (Postfix) with ESMTPS id C86F4C19422; Mon, 12 Jan 2026 16:28:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1768235313; bh=grrBzUog12+WE5FP8RC1t7J6n4Xk4iWQti4S7q8UyIM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=o0iD7YdFw8q6ThQ29JHAro4ZvVy2rVBNTTRMICyoAKU4mV/CkxFRp4PcViVdcZF0g f+uKrxgMnTH9Ds0npL8+70FXhqh+9hbTPaa+u8Srz+GthSbN8F+rwvprC6yh5hOlVV YKp/5/ibeefHpW7rsFHDND6TTzOrLJak1XZzL8SvlAH7Xu62pRpZAaX32Ooge3g1al uVCeEGlc0FytsxRz7As5+dUUmkvb8E7mvNmC2rT62J+VczvtaP/ZUYKmL/llcSQlFQ OcVdTvuXTIS2+iEgZg1yK35dvZXbdjHfct1t/a9mloLTW1ynSqnXQTGv3jpg61Rpgc 0G+lZzezNWVJA== 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 BDB78D25041; Mon, 12 Jan 2026 16:28:33 +0000 (UTC) From: Manivannan Sadhasivam via B4 Relay Date: Mon, 12 Jan 2026 21:56:06 +0530 Subject: [PATCH v4 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: <20260112-pci-m2-e-v4-7-eff84d2c6d26@oss.qualcomm.com> References: <20260112-pci-m2-e-v4-0-eff84d2c6d26@oss.qualcomm.com> In-Reply-To: <20260112-pci-m2-e-v4-0-eff84d2c6d26@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 X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1456; i=manivannan.sadhasivam@oss.qualcomm.com; h=from:subject:message-id; bh=0KqheeXO4Oi8QyG11TDbNEO023eYG3+bTSLkuoPEKb8=; b=owEBbQGS/pANAwAKAVWfEeb+kc71AcsmYgBpZSEuKYIUhamgQf6AalMOWO7Rfl2Il8MaGaoj+ gm0X0978nWJATMEAAEKAB0WIQRnpUMqgUjL2KRYJ5dVnxHm/pHO9QUCaWUhLgAKCRBVnxHm/pHO 9YI/B/4so8DL0igNTt5laHHShN9QY9BShj9qsVmgCmZZizALVLOpQtpgvprKHQpF3hI4Xt6L2FJ FJbZryxF13pMx3goH+YdgkzPmFyfUAjqbXyhaeaii/ouFz9bey7NQL7oV1PjGrJRNBIqH7iwQ+C wQc69799eXgaoRJvvfu2Gg/zX2Y/JrmVlEdxdDT1Tk0LBE9jUw5+OClD/6jj24ovQFQSUcCiN2A 5WojYECWh4+gWPWcuH3TfnCwn4IYD432qmpihCDTqXkaNjit1v5i4rp9+6DxeWD8ZCGNBcnL8uy +Zz3zxBGrAWSjRVDzEzuK1UjzbqdV1v5hBVrQmHs/YhRJWCg 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. Signed-off-by: Manivannan Sadhasivam Reviewed-by: Bartosz Golaszewski Tested-by: Hans de Goede # ThinkPad T14s = gen6 (arm64) --- 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 888176b0faa9..4d562596ebf9 100644 --- a/drivers/bluetooth/hci_qca.c +++ b/drivers/bluetooth/hci_qca.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -2384,6 +2385,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.48.1 From nobody Sat Feb 7 08:27:42 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 2663D36922B; Mon, 12 Jan 2026 16:28:34 +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=1768235314; cv=none; b=rl3zd4j+asUUJjfheZR+MOCen3EDHauS8vQ7XGB5g/Mz29MJkDtnf3tCnfeI6KNv/9lGEF37qYD4YACowZrgCoBLS6NZZj61J0Jrj6NQ7FcREIYK3A6UgM8DIV7u7e9o0tk4tR3ThAaGxSoij265ZzE+VBE7iDWubC5lzI7oFyI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768235314; c=relaxed/simple; bh=TY7wS/PnEUr5RA2e8U4YV4dpDVuXbnCrxqd074doQm0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=JWEXoKgU8ZxeHYXjzP0M23ol5FqJYaErdJtwG2GAljd10k4tmuvYGe3gOantaH8VCxCqCSw1lIyIFC/afRlGH8T8W2dZKc9WsnsF+xq5Q6naWNURqjnpeeng3Cqj57BvSPuKU2fAJLxhc/ocrd+b6sD1fDOR0n3RQEGxZu4HYNo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=GmTfcckp; 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="GmTfcckp" Received: by smtp.kernel.org (Postfix) with ESMTPS id DA3B2C19424; Mon, 12 Jan 2026 16:28:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1768235313; bh=TY7wS/PnEUr5RA2e8U4YV4dpDVuXbnCrxqd074doQm0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=GmTfcckpXrM8mX2pvDgNEhldeTuFv2o20cP4iO3XE8HKvp3OEYJneKDwFfEGTBK5N knqzztygcbeMIZc2T1OzplcPPO3IUVlU13qlJ+fiU+tSLgOFY0vC/yr68N8SqgUEqw c4wY9bkAVUI1S4c6ke3itjmU1gmfv1NB5JAAr31KK61eVjXi6fBlkWFhffAkA/fRob sZ8R1WCQIL9XQ7slEKAiL0EVZ5K/IWy3Q6E1/vu4QqRLNQanuabwFx5///wA+NiIvt 9EFXzn2ASujXQYGr4sBmjoYlIjs225B7OtTQt/vyhEyvLcWPJrDItaTCpTApl2DMzh NZi5FItPgei/Q== 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 D0FB5D26D97; Mon, 12 Jan 2026 16:28:33 +0000 (UTC) From: Manivannan Sadhasivam via B4 Relay Date: Mon, 12 Jan 2026 21:56:07 +0530 Subject: [PATCH v4 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: <20260112-pci-m2-e-v4-8-eff84d2c6d26@oss.qualcomm.com> References: <20260112-pci-m2-e-v4-0-eff84d2c6d26@oss.qualcomm.com> In-Reply-To: <20260112-pci-m2-e-v4-0-eff84d2c6d26@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 X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=7599; i=manivannan.sadhasivam@oss.qualcomm.com; h=from:subject:message-id; bh=i6i8PHXC7zEwHnq+Aby8WFbHrLt0WziJAFUdslemlFU=; b=owEBbQGS/pANAwAKAVWfEeb+kc71AcsmYgBpZSEuwOS4ymgyUnylCHk62VuTbi8H9MV6j0FnB Gg+cAGN8mGJATMEAAEKAB0WIQRnpUMqgUjL2KRYJ5dVnxHm/pHO9QUCaWUhLgAKCRBVnxHm/pHO 9d09B/4xNCqjm74pleFKd7aqFZ4vZr5N4njk0LJnjssI5bPldYgbZrhhTWpPQ/ptuhm1UOFlafc ev7f3Kxn0BibYh7ob2zJWqrZcWyEKK3o1Lcy49gxLDQ5sIuWN1v30SOZkBCX7YphsZHkiHVRpk5 GfoBKNPvLm0DQlrXZrt5Mg+gJgCcruf0I3aeqUiCTuI/TW3bGDh10rX4lm57j9yn/BdjqXvo6JG CoSIASo4sUvYTbjUysYArUNakinzBnKMU8fnpY8j2pQdAN9ME7GLxdbV/7wilEO28xRmuDj/qv5 EqfQRMwhDvd5BxePCGfms/27fRs+848HkAWW1b4uCoCZoIIs 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. Signed-off-by: Manivannan Sadhasivam Tested-by: Hans de Goede # ThinkPad T14s = gen6 (arm64) --- drivers/power/sequencing/Kconfig | 1 + drivers/power/sequencing/pwrseq-pcie-m2.c | 110 ++++++++++++++++++++++++++= ++-- 2 files changed, 104 insertions(+), 7 deletions(-) diff --git a/drivers/power/sequencing/Kconfig b/drivers/power/sequencing/Kc= onfig index f5fff84566ba..29bd204319cc 100644 --- a/drivers/power/sequencing/Kconfig +++ b/drivers/power/sequencing/Kconfig @@ -38,6 +38,7 @@ config POWER_SEQUENCING_TH1520_GPU config POWER_SEQUENCING_PCIE_M2 tristate "PCIe M.2 connector power sequencing driver" depends on OF || COMPILE_TEST + depends on PCI 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 e01e19123415..4b85a40d7692 100644 --- a/drivers/power/sequencing/pwrseq-pcie-m2.c +++ b/drivers/power/sequencing/pwrseq-pcie-m2.c @@ -4,12 +4,16 @@ * Author: Manivannan Sadhasivam */ =20 +#include #include +#include +#include #include #include #include #include #include +#include #include #include #include @@ -25,17 +29,19 @@ struct pwrseq_pcie_m2_ctx { const struct pwrseq_pcie_m2_pdata *pdata; 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; + struct device *dev; }; =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 @@ -44,18 +50,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 { @@ -63,11 +135,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, }; @@ -126,6 +208,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_free_resources, ctx); @@ -151,6 +243,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.48.1 From nobody Sat Feb 7 08:27:42 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 1FF5A369221; Mon, 12 Jan 2026 16:28:34 +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=1768235314; cv=none; b=fLUmXBpW4MjyZHcaotVaRd5uTpWpYYdzSn/Abw6ON+IsuMZ03DZXUsYbR0f+qPOEaRLEARjQSpiUNz8cIlEnoAEx6kxw+1UgYFCTOOa6nPgM632tMbMhasRwYJ5NQRrUheoXjWQtqonN6cWC4StiH32aqkwKnWSD7F9ZYG1YOBE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768235314; c=relaxed/simple; bh=d2H5sBrJRTO4HA6sU2uUwr3AlBk/zSm4I8aNNexb7WY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ilxhByxx+PmCaCxPQElaNhvfUxJMcZC5yaw7K8dc9wW7YGBk2bjTQUpMzsndYPV2CmZzesaQ1CDihZC35sCYhkDKzD2FzJck7KYzi7NdOEpQknzMRjxnal0rVg2BV6uAWZW1wKQwUSXR/sgrrQKH7W4XadrusMLvcoITLENFRNs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=TvmRlbvt; 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="TvmRlbvt" Received: by smtp.kernel.org (Postfix) with ESMTPS id F1591C2BC86; Mon, 12 Jan 2026 16:28:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1768235314; bh=d2H5sBrJRTO4HA6sU2uUwr3AlBk/zSm4I8aNNexb7WY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=TvmRlbvt0RQo+fssc/Rnqm+8U20zD1ywJxpb2pnK6d7dLbv7zk4/3EPEEGprU9t56 BYN/UPNI1gidv8FFCbSWGImeOMsaZ3eNDpCi3Ol5xY1wzQxbcb0lJpWC0zzO7lztmZ ey3+cCaMkijvmAvRdrHyHYTfYQrydGD5lbT7k0e4lRGHSMe6eKq6+tEBxw/84rlExR WbzL2SJbh19NnePP+X30bY9GorWeTxzY1LGFON2KNLrlR/RvlMir5cFnFI5/hmWWiw hi+PcaO4v1ewgR8UrkOrBw4GxLXLep8Ovt91Ggygy0Mv1EVCLHP9+5BkY/qDsg228z ynWjgq1nQCXxA== 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 E4016C9EC7A; Mon, 12 Jan 2026 16:28:33 +0000 (UTC) From: Manivannan Sadhasivam via B4 Relay Date: Mon, 12 Jan 2026 21:56:08 +0530 Subject: [PATCH v4 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: <20260112-pci-m2-e-v4-9-eff84d2c6d26@oss.qualcomm.com> References: <20260112-pci-m2-e-v4-0-eff84d2c6d26@oss.qualcomm.com> In-Reply-To: <20260112-pci-m2-e-v4-0-eff84d2c6d26@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 X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=7013; i=manivannan.sadhasivam@oss.qualcomm.com; h=from:subject:message-id; bh=w70p+2y0uc4RozfccwCnGDOzlXy/s1rG4evBeDzOF7s=; b=owEBbQGS/pANAwAKAVWfEeb+kc71AcsmYgBpZSEu/jW+ekB0sG2rj3DHVjC+wWL19GBThP91L t+WkapNF7yJATMEAAEKAB0WIQRnpUMqgUjL2KRYJ5dVnxHm/pHO9QUCaWUhLgAKCRBVnxHm/pHO 9TqdB/9UGcoyjANWfKo2B0nSFR7lejpUuKWLr4FwtVwIf2g6ku9SxxLhDfoBUykgwFaGqzIKSKF U9Jyv709W8UQLa/9NmHfuMC+5G/bBu48G/StSb17NYJY5YddWWZRlTnUc6Z3cdKQF1M0D+FG+qE ehIlX5EjnfGDnq+tHg6YcXI/UsaHzDM+4PIsDNQT1G572LE3TzP5NLrGacGGyr+4FP6DVoe6Rn9 dRFmrLHCedt+ErlahcQ7YgwTjQfUw4FT0U/AGf5TQ3p8bkKkaoI8Rg05CNAgVuKqx+pV/xsyq8R 5Vv79dKRPqFAQeGucS3FoG8XTOpgNunXJJKQHD3Hek+fgoV2 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. Signed-off-by: Manivannan Sadhasivam Tested-by: Hans de Goede # ThinkPad T14s = gen6 (arm64) --- drivers/power/sequencing/pwrseq-pcie-m2.c | 170 ++++++++++++++++++++++++++= +++- 1 file changed, 169 insertions(+), 1 deletion(-) diff --git a/drivers/power/sequencing/pwrseq-pcie-m2.c b/drivers/power/sequ= encing/pwrseq-pcie-m2.c index 4b85a40d7692..5f9232e6c700 100644 --- a/drivers/power/sequencing/pwrseq-pcie-m2.c +++ b/drivers/power/sequencing/pwrseq-pcie-m2.c @@ -17,6 +17,7 @@ #include #include #include +#include #include =20 struct pwrseq_pcie_m2_pdata { @@ -32,6 +33,9 @@ struct pwrseq_pcie_m2_ctx { struct gpio_desc *w_disable1_gpio; struct gpio_desc *w_disable2_gpio; struct device *dev; + struct serdev_device *serdev; + struct notifier_block nb; + struct of_changeset *ocs; }; =20 static int pwrseq_pcie_m2_vregs_enable(struct pwrseq_device *pwrseq) @@ -178,9 +182,169 @@ static void pwrseq_pcie_free_resources(void *data) { struct pwrseq_pcie_m2_ctx *ctx =3D data; =20 + serdev_device_remove(ctx->serdev); + of_changeset_revert(ctx->ocs); + of_changeset_destroy(ctx->ocs); + bus_unregister_notifier(&pci_bus_type, &ctx->nb); 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; + struct device_node *pci_parent; + 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. + */ + pci_parent =3D of_graph_get_remote_node(dev_of_node(ctx->dev), 0, 0); + if (!pci_parent || (pci_parent !=3D pdev->dev.parent->of_node)) { + of_node_put(pci_parent); + return NOTIFY_DONE; + } + of_node_put(pci_parent); + + 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 1/Endpoint 1 interface. + */ + if (pwrseq_pcie_m2_check_remote_node(dev, 1, 1, "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) { + dev_err_probe(dev, ret, "Failed to register notifier for serdev\n"); + return ret; + } + } + } + + return 0; +} + static int pwrseq_pcie_m2_probe(struct platform_device *pdev) { struct device *dev =3D &pdev->dev; @@ -235,7 +399,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.48.1