]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
PCI/pwrctrl: Switch to pwrctrl create, power on/off, destroy APIs
authorManivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Thu, 15 Jan 2026 07:29:04 +0000 (12:59 +0530)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 16 Jan 2026 19:23:38 +0000 (13:23 -0600)
commitb921aa3f8decae440009134d65399ee9b2425300
tree8ef7cff6d544f8a5eee96d8ea0b71e2ca0f08194
parentb35cf3b6aa1eb08909f58c2d1e2f8ef7d000809a
PCI/pwrctrl: Switch to pwrctrl create, power on/off, destroy APIs

Adopt pwrctrl APIs to create, power on/off, and destroy pwrctrl devices.

In qcom_pcie_host_init(), call pci_pwrctrl_create_devices() to create
devices, then pci_pwrctrl_power_on_devices() to power them on, both after
controller resource initialization. Once successful, deassert PERST# for
all devices.

In qcom_pcie_host_deinit(), call pci_pwrctrl_power_off_devices() after
asserting PERST#. Note that pci_pwrctrl_destroy_devices() is not called
here, as deinit is only invoked during system suspend where device
destruction is unnecessary. If the driver becomes removable in future,
pci_pwrctrl_destroy_devices() should be called in the remove() handler.

Remove the old pwrctrl framework code from the PCI core (including
devlinks) as the new APIs are now the sole consumer of pwrctrl
functionality. And also do not power on the pwrctrl drivers during probe()
as this is now handled by the APIs.

Co-developed-by: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
Signed-off-by: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Tested-by: Chen-Yu Tsai <wenst@chromium.org>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Link: https://patch.msgid.link/20260115-pci-pwrctrl-rework-v5-12-9d26da3ce903@oss.qualcomm.com
drivers/pci/bus.c
drivers/pci/controller/dwc/pcie-qcom.c
drivers/pci/probe.c
drivers/pci/pwrctrl/core.c
drivers/pci/pwrctrl/pci-pwrctrl-pwrseq.c
drivers/pci/pwrctrl/pci-pwrctrl-tc9563.c
drivers/pci/pwrctrl/slot.c
drivers/pci/remove.c