Commit c1db3e8a authored by Federico Vaga's avatar Federico Vaga

vic: helper to know if a source is managed

Signed-nof -by: Federico Vaga <federico.vaga@cern.ch>
parent 15fa14fb
......@@ -178,6 +178,23 @@ int spec_vic_irq_request(struct spec_dev *spec, struct fmc_device *fmc,
return -EINVAL;
}
int vic_is_managed(struct vic_irq_controller *vic, unsigned long id)
{
int i, ret;
if (!vic)
return 0;
for (i = 0; i < VIC_MAX_VECTORS; i++) {
if (vic->vectors[i].saved_id != id)
continue;
ret = vic_readl(vic, VIC_REG_IMR) & (1 << i);
return !!ret;
}
return 0;
}
/*
* vic_handler_count
......
......@@ -154,5 +154,6 @@ int spec_vic_irq_request(struct spec_dev *spec, struct fmc_device *fmc,
unsigned long id, irq_handler_t handler);
void spec_vic_irq_free(struct spec_dev *spec, unsigned long id);
irqreturn_t spec_vic_irq_dispatch(struct spec_dev *spec);
extern int vic_is_managed(struct vic_irq_controller *vic, unsigned long id);
#endif /* __SPEC_H__ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment