aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/iommu/amd_iommu.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index bcf48156868b..aeb890c35f7e 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -4200,4 +4200,30 @@ static int msi_setup_irq(struct pci_dev *pdev, unsigned int irq,
4200 return 0; 4200 return 0;
4201} 4201}
4202 4202
4203static int setup_hpet_msi(unsigned int irq, unsigned int id)
4204{
4205 struct irq_2_iommu *irte_info;
4206 struct irq_cfg *cfg;
4207 int index, devid;
4208
4209 cfg = irq_get_chip_data(irq);
4210 if (!cfg)
4211 return -EINVAL;
4212
4213 irte_info = &cfg->irq_2_iommu;
4214 devid = get_hpet_devid(id);
4215 if (devid < 0)
4216 return devid;
4217
4218 index = alloc_irq_index(cfg, devid, 1);
4219 if (index < 0)
4220 return index;
4221
4222 irte_info->sub_handle = devid;
4223 irte_info->irte_index = index;
4224 irte_info->iommu = (void *)cfg;
4225
4226 return 0;
4227}
4228
4203#endif 4229#endif