irqchip/gic-v3-its: Add IORT hook for platform MSI support
Getting hold of the DevID requires us to call iort_pmsi_get_dev_id(). Since iort_pmsi_get_dev_id() may or may not be implemented, we provide a weak function that acts as a stub. The weak function will be removed when the ACPI counterpart is merged. Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
This commit is contained in:
@@ -48,6 +48,11 @@ static int of_pmsi_get_dev_id(struct irq_domain *domain, struct device *dev,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int __weak iort_pmsi_get_dev_id(struct device *dev, u32 *dev_id)
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
static int its_pmsi_prepare(struct irq_domain *domain, struct device *dev,
|
static int its_pmsi_prepare(struct irq_domain *domain, struct device *dev,
|
||||||
int nvec, msi_alloc_info_t *info)
|
int nvec, msi_alloc_info_t *info)
|
||||||
{
|
{
|
||||||
@@ -57,7 +62,10 @@ static int its_pmsi_prepare(struct irq_domain *domain, struct device *dev,
|
|||||||
|
|
||||||
msi_info = msi_get_domain_info(domain->parent);
|
msi_info = msi_get_domain_info(domain->parent);
|
||||||
|
|
||||||
|
if (dev->of_node)
|
||||||
ret = of_pmsi_get_dev_id(domain, dev, &dev_id);
|
ret = of_pmsi_get_dev_id(domain, dev, &dev_id);
|
||||||
|
else
|
||||||
|
ret = iort_pmsi_get_dev_id(dev, &dev_id);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user