]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
PCI: host-generic: Allow {en,dis}able_device() to be provided via pci_ecam_ops
authorMarc Zyngier <maz@kernel.org>
Wed, 4 Dec 2024 15:01:44 +0000 (15:01 +0000)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 15 Jan 2025 20:52:12 +0000 (14:52 -0600)
In order to let host controller drivers using the host-generic
infrastructure use the {en,dis}able_device() callbacks that can be used to
configure sideband RID mapping hardware, provide these two callbacks as
part of the pci_ecam_ops structure.

Link: https://lore.kernel.org/r/20241204150145.800408-2-maz@kernel.org
Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
drivers/pci/controller/pci-host-common.c
include/linux/pci-ecam.h

index cf5f59a745b37a33e9537645f25351f7930c11c7..f441bfd6f96a8bde1c07fcf97d43d0693c424a27 100644 (file)
@@ -75,6 +75,8 @@ int pci_host_common_probe(struct platform_device *pdev)
 
        bridge->sysdata = cfg;
        bridge->ops = (struct pci_ops *)&ops->pci_ops;
+       bridge->enable_device = ops->enable_device;
+       bridge->disable_device = ops->disable_device;
        bridge->msi_domain = true;
 
        return pci_host_probe(bridge);
index 3a4860bd27586587cb23e7d6f84f63efcf6f2fc6..3a10f8cfc3ad5c90585a8fc971be714011ed18fe 100644 (file)
@@ -45,6 +45,10 @@ struct pci_ecam_ops {
        unsigned int                    bus_shift;
        struct pci_ops                  pci_ops;
        int                             (*init)(struct pci_config_window *);
+       int                             (*enable_device)(struct pci_host_bridge *,
+                                                        struct pci_dev *);
+       void                            (*disable_device)(struct pci_host_bridge *,
+                                                         struct pci_dev *);
 };
 
 /*