• Jim Quinlan's avatar
    PCI: brcmstb: Enable child bus device regulators from DT · 9e6be018
    Jim Quinlan authored
    Some platforms have power regulators for slots or devices below Root Ports.
    On platforms like Raspberry Pi 4, these regulators are described in the
    Root Port device tree node, since they logically belong to the Root Port,
    not to the host bridge itself.
    
    Add an .add_bus() hook (called when pci_alloc_child_bus() allocates the
    secondary ("child") bus for a bridge), and look for such regulators.  If we
    find some, enable them before bringing up the link and enumerating devices
    on the child bus.
    
    Similarly, when pci_remove_bus() calls the ops->remove_bus() hook, disable
    the regulators.
    
    The regulators that may be described in a Root Port DT device are:
    
      vpcie3v3
      vpcie3v3aux
      vpcie12v
    
    These control power to the device downstream from the Root Port.
    
    [bhelgaas: commit log, name hooks brcm_pcie_add_bus(), etc, since we only
    support one set of subregulator info, save info in struct brcm_pcie instead
    of dev->driver_data, move brcm_pcie_start_link() from probe to .add_bus()
    (from subsequent patch)]
    Link: https://lore.kernel.org/r/20220725151258.42574-5-jim2101024@gmail.comSigned-off-by: default avatarJim Quinlan <jim2101024@gmail.com>
    Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
    Tested-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
    9e6be018
pcie-brcmstb.c 44.1 KB