devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
To: Bjorn Helgaas <bhelgaas@google.com>,
	Manivannan Sadhasivam <mani@kernel.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Bartosz Golaszewski <brgl@bgdev.pl>
Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
	devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	Stephan Gerhold <stephan.gerhold@linaro.org>,
	Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>,
	linux-pm@vger.kernel.org,
	Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Subject: [PATCH v2 3/4] PCI/pwrctrl: Create pwrctrl device if the graph port is found
Date: Sat, 08 Nov 2025 08:53:21 +0530	[thread overview]
Message-ID: <20251108-pci-m2-v2-3-e8bc4d7bf42d@oss.qualcomm.com> (raw)
In-Reply-To: <20251108-pci-m2-v2-0-e8bc4d7bf42d@oss.qualcomm.com>

The devicetree node of the PCIe Root Port/Slot could have the graph port
to link the PCIe M.2 connector node. Since the M.2 connectors are modelled
as Power Sequencing devices, they need to be controlled by the pwrctrl
driver as like the Root Port/Slot supplies.

Hence, create the pwrctrl device if the graph port is found in the node.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
---
 drivers/pci/probe.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index c83e75a0ec1263298aeac7f84bcf5513b003496c..9c8669e2fe72d7edbc2898d60ffdda5fc769d6f5 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -9,6 +9,7 @@
 #include <linux/init.h>
 #include <linux/pci.h>
 #include <linux/msi.h>
+#include <linux/of_graph.h>
 #include <linux/of_pci.h>
 #include <linux/of_platform.h>
 #include <linux/platform_device.h>
@@ -2555,7 +2556,7 @@ static struct platform_device *pci_pwrctrl_create_device(struct pci_bus *bus, in
 	 * not. This is decided based on at least one of the power supplies
 	 * being defined in the devicetree node of the device.
 	 */
-	if (!of_pci_supply_present(np)) {
+	if (!of_pci_supply_present(np) && !of_graph_is_present(np)) {
 		pr_debug("PCI/pwrctrl: Skipping OF node: %s\n", np->name);
 		goto err_put_of_node;
 	}

-- 
2.48.1


  parent reply	other threads:[~2025-11-08  3:23 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-08  3:23 [PATCH v2 0/4] PCI: Add initial support for handling PCIe M.2 connectors in devicetree Manivannan Sadhasivam
2025-11-08  3:23 ` [PATCH v2 1/4] dt-bindings: connector: Add PCIe M.2 Mechanical Key M connector Manivannan Sadhasivam
2025-11-08 18:10   ` Dmitry Baryshkov
2025-11-09 16:18     ` Manivannan Sadhasivam
2025-11-09 20:13       ` Dmitry Baryshkov
2025-11-11 13:49         ` Manivannan Sadhasivam
2025-11-12 20:12           ` Dmitry Baryshkov
2025-11-13  4:57             ` Manivannan Sadhasivam
2025-11-09 18:34   ` Sebastian Reichel
2025-11-11 13:54     ` Manivannan Sadhasivam
2025-11-12  3:57   ` Chen-Yu Tsai
2025-11-12 14:33     ` Manivannan Sadhasivam
2025-11-12 16:54   ` Frank Li
2025-11-08  3:23 ` [PATCH v2 2/4] PCI/pwrctrl: Add support for handling PCIe M.2 connectors Manivannan Sadhasivam
2025-11-12 14:59   ` Bartosz Golaszewski
2025-11-08  3:23 ` Manivannan Sadhasivam [this message]
2025-11-12 15:00   ` [PATCH v2 3/4] PCI/pwrctrl: Create pwrctrl device if the graph port is found Bartosz Golaszewski
2025-11-08  3:23 ` [PATCH v2 4/4] power: sequencing: Add the Power Sequencing driver for the PCIe M.2 connectors Manivannan Sadhasivam
2025-11-12 15:04   ` Bartosz Golaszewski
2025-11-12 15:51     ` Manivannan Sadhasivam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251108-pci-m2-v2-3-e8bc4d7bf42d@oss.qualcomm.com \
    --to=manivannan.sadhasivam@oss.qualcomm.com \
    --cc=bhelgaas@google.com \
    --cc=brgl@bgdev.pl \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mani@kernel.org \
    --cc=robh@kernel.org \
    --cc=stephan.gerhold@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).