@@ -70,6 +70,11 @@ int __weak arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
{
struct msi_desc *entry;
int ret;
+ struct msi_controller *ctrl;
+
+ ctrl = pci_msi_controller(dev->bus);
+ if (ctrl && ctrl->setup_irqs)
+ return ctrl->setup_irqs(ctrl, dev, nvec, type);
/*
* If an architecture wants to support multiple MSI, it needs to
@@ -112,6 +117,11 @@ void default_teardown_msi_irqs(struct pci_dev *dev)
void __weak arch_teardown_msi_irqs(struct pci_dev *dev)
{
+ struct msi_controller *ctrl = pci_msi_controller(dev->bus);
+
+ if (ctrl && ctrl->teardown_irqs)
+ return ctrl->teardown_irqs(ctrl, dev);
+
return default_teardown_msi_irqs(dev);
}
@@ -135,6 +145,11 @@ static void default_restore_msi_irq(struct pci_dev *dev, int irq)
void __weak arch_restore_msi_irqs(struct pci_dev *dev)
{
+ struct msi_controller *ctrl = pci_msi_controller(dev->bus);
+
+ if (ctrl && ctrl->restore_irqs)
+ return ctrl->restore_irqs(ctrl, dev);
+
return default_restore_msi_irqs(dev);
}
@@ -71,9 +71,13 @@ struct msi_controller {
struct device_node *of_node;
struct list_head list;
- int (*setup_irq)(struct msi_controller *chip, struct pci_dev *dev,
+ int (*setup_irq)(struct msi_controller *ctrl, struct pci_dev *dev,
struct msi_desc *desc);
- void (*teardown_irq)(struct msi_controller *chip, unsigned int irq);
+ int (*setup_irqs)(struct msi_controller *ctrl, struct pci_dev *dev,
+ int nvec, int type);
+ void (*teardown_irq)(struct msi_controller *ctrl, unsigned int irq);
+ void (*teardown_irqs)(struct msi_controller *ctrl, struct pci_dev *dev);
+ void (*restore_irqs)(struct msi_controller *ctrl, struct pci_dev *dev);
};
#endif /* LINUX_MSI_H */