aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>2026-01-28 21:07:16 +0530
committerBjorn Helgaas <bhelgaas@google.com>2026-01-29 15:04:26 -0600
commit9db826206f9b7c3b5449848e79adea4756a1605a (patch)
tree779c06b1e6159326ef418d8e89c8b3e6bf7fbd24
parent9cb64f61ec7a9034299807b1e562413329ddac5b (diff)
PCI/pwrctrl: Create pwrctrl device if graph port is found
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 modeled as Power Sequencing devices, they need to be controlled by the pwrctrl driver 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> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Link: https://patch.msgid.link/20260128-pci-m2-v7-2-9b3a5fe3d244@oss.qualcomm.com
-rw-r--r--drivers/pci/pwrctrl/core.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/pci/pwrctrl/core.c b/drivers/pci/pwrctrl/core.c
index 1b91375738a0..6f7dea6746e0 100644
--- a/drivers/pci/pwrctrl/core.c
+++ b/drivers/pci/pwrctrl/core.c
@@ -9,6 +9,7 @@
#include <linux/export.h>
#include <linux/kernel.h>
#include <linux/of.h>
+#include <linux/of_graph.h>
#include <linux/of_platform.h>
#include <linux/pci.h>
#include <linux/pci-pwrctrl.h>
@@ -295,10 +296,10 @@ static int pci_pwrctrl_create_device(struct device_node *np,
/*
* Check whether the pwrctrl device really needs to be created or not.
- * This is decided based on at least one of the power supplies being
- * defined in the devicetree node of the device.
+ * This is decided based on at least one of the power supplies defined
+ * in the devicetree node of the device or the graph property.
*/
- if (!of_pci_supply_present(np)) {
+ if (!of_pci_supply_present(np) && !of_graph_is_present(np)) {
dev_dbg(parent, "Skipping OF node: %s\n", np->name);
return 0;
}