static int xics_host_map(struct irq_domain *h, unsigned int virq,
			 irq_hw_number_t hw)
{
	struct ics *ics;

	pr_devel("xics: map virq %d, hwirq 0x%lx\n", virq, hw);

	/* Insert the interrupt mapping into the radix tree for fast lookup */
	irq_radix_revmap_insert(xics_host, virq, hw);

	/* They aren't all level sensitive but we just don't really know */
	irq_set_status_flags(virq, IRQ_LEVEL);

	/* Don't call into ICS for IPIs */
	if (hw == XICS_IPI) {
		irq_set_chip_and_handler(virq, &xics_ipi_chip,
					 handle_percpu_irq);
		return 0;
	}

	/* Let the ICS setup the chip data */
	list_for_each_entry(ics, &ics_list, link)
		if (ics->map(ics, virq) == 0)
			return 0;

	return -EINVAL;
}
Пример #2
0
static int xics_host_map(struct irq_domain *h, unsigned int virq,
			 irq_hw_number_t hw)
{
	struct ics *ics;

	pr_devel("xics: map virq %d, hwirq 0x%lx\n", virq, hw);

	
	irq_radix_revmap_insert(xics_host, virq, hw);

	
	irq_set_status_flags(virq, IRQ_LEVEL);

	
	if (hw == XICS_IPI) {
		irq_set_chip_and_handler(virq, &xics_ipi_chip,
					 handle_percpu_irq);
		return 0;
	}

	
	list_for_each_entry(ics, &ics_list, link)
		if (ics->map(ics, virq) == 0)
			return 0;

	return -EINVAL;
}
Пример #3
0
static int xics_host_map(struct irq_host *h, unsigned int virq,
			 irq_hw_number_t hw)
{
	pr_devel("xics: map virq %d, hwirq 0x%lx\n", virq, hw);

	/* Insert the interrupt mapping into the radix tree for fast lookup */
	irq_radix_revmap_insert(xics_host, virq, hw);

	irq_to_desc(virq)->status |= IRQ_LEVEL;
	set_irq_chip_and_handler(virq, xics_irq_chip, handle_fasteoi_irq);
	return 0;
}
static int qpnpint_irq_domain_map(struct irq_domain *d,
                                  unsigned int virq, irq_hw_number_t hwirq)
{
    struct q_chip_data *chip_d = d->host_data;
    struct q_irq_data *irq_d;
    int rc;

    pr_debug("hwirq = %lu\n", hwirq);

    if (hwirq < 0 || hwirq >= QPNPINT_NR_IRQS) {
        pr_err("hwirq %lu out of bounds\n", hwirq);
        return -EINVAL;
    }

    irq_radix_revmap_insert(d, virq, hwirq);

    irq_d = qpnpint_alloc_irq_data(chip_d, hwirq);
    if (IS_ERR(irq_d)) {
        pr_err("failed to alloc irq data for hwirq %lu\n", hwirq);
        return PTR_ERR(irq_d);
    }

    rc = qpnpint_init_irq_data(chip_d, irq_d, hwirq);
    if (rc) {
        pr_err("failed to init irq data for hwirq %lu\n", hwirq);
        goto map_err;
    }

    irq_set_chip_and_handler(virq,
                             &qpnpint_chip,
                             handle_level_irq);
    irq_set_chip_data(virq, irq_d);
#ifdef CONFIG_ARM
    set_irq_flags(virq, IRQF_VALID);
#else
    irq_set_noprobe(virq);
#endif
    return 0;

map_err:
    qpnpint_free_irq_data(irq_d);
    return rc;
}