Skip to content

Commit 477ac7b

Browse files
Marc Zyngierbjorn-helgaas
authored andcommitted
PCI: host-generic: Allow {en,dis}able_device() to be provided via pci_ecam_ops
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>
1 parent ce4c430 commit 477ac7b

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

drivers/pci/controller/pci-host-common.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ int pci_host_common_probe(struct platform_device *pdev)
7575

7676
bridge->sysdata = cfg;
7777
bridge->ops = (struct pci_ops *)&ops->pci_ops;
78+
bridge->enable_device = ops->enable_device;
79+
bridge->disable_device = ops->disable_device;
7880
bridge->msi_domain = true;
7981

8082
return pci_host_probe(bridge);

include/linux/pci-ecam.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ struct pci_ecam_ops {
4545
unsigned int bus_shift;
4646
struct pci_ops pci_ops;
4747
int (*init)(struct pci_config_window *);
48+
int (*enable_device)(struct pci_host_bridge *,
49+
struct pci_dev *);
50+
void (*disable_device)(struct pci_host_bridge *,
51+
struct pci_dev *);
4852
};
4953

5054
/*

0 commit comments

Comments
 (0)