PCI: brcmstb: Add control of subdevice voltage regulators
authorJim Quinlan <jim2101024@gmail.com>
Thu, 6 Jan 2022 16:03:29 +0000 (11:03 -0500)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 12 Jan 2022 19:45:50 +0000 (13:45 -0600)
commit93e41f3fca3d4a0f927b784012338c37f80a8a80
tree281b775cb21c22012bea11dfdf2b84c7598a7332
parent67211aadcb4b968d0fdc57bc27240fa71500c2d4
PCI: brcmstb: Add control of subdevice voltage regulators

This Broadcom STB PCIe RC driver has one port and connects directly to one
device, be it a switch or an endpoint.  We want to be able to leverage the
recently added mechanism that allocates and turns on/off subdevice
regulators.

All that needs to be done is to put the regulator DT nodes in the bridge
below host and to set the pci_ops methods add_bus and remove_bus.

Note that the pci_subdev_regulators_add_bus() method is wrapped for two
reasons:

   1. To achieve link up after the voltage regulators are turned on.

   2. If, in the case of an unsuccessful link up, to redirect any PCIe
      accesses to subdevices, e.g. the scan for DEV/ID.  This redirection
      is needed because the Broadcom PCIe HW will issue a CPU abort if such
      an access is made when the link is down.

[bhelgaas: fold in
https://lore.kernel.org/r/20220112013100.48029-1-jim2101024@gmail.com]
Link: https://lore.kernel.org/r/20220106160332.2143-7-jim2101024@gmail.com
Signed-off-by: Jim Quinlan <jim2101024@gmail.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/controller/pcie-brcmstb.c