Add a routine to setup a HPET MSI interrupt for remapping.

Signed-off-by: Joerg Roedel <joerg.roe...@amd.com>
---
 drivers/iommu/amd_iommu.c |   26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index 84efecd..af245f4 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,
        return 0;
 }
 
+static int setup_hpet_msi(unsigned int irq, unsigned int id)
+{
+       struct irq_2_iommu *irte_info;
+       struct irq_cfg *cfg;
+       int index, devid;
+
+       cfg = irq_get_chip_data(irq);
+       if (!cfg)
+               return -EINVAL;
+
+       irte_info = &cfg->irq_2_iommu;
+       devid     = get_hpet_devid(id);
+       if (devid < 0)
+               return devid;
+
+       index = alloc_irq_index(cfg, devid, 1);
+       if (index < 0)
+               return index;
+
+       irte_info->sub_handle = devid;
+       irte_info->irte_index = index;
+       irte_info->iommu      = (void *)cfg;
+
+       return 0;
+}
+
 #endif
-- 
1.7.9.5


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to