]> git.baikalelectronics.ru Git - kernel.git/commit
irq_domain: Add support for base irq and hwirq in legacy mappings
authorGrant Likely <grant.likely@secretlab.ca>
Tue, 14 Feb 2012 21:06:55 +0000 (14:06 -0700)
committerGrant Likely <grant.likely@secretlab.ca>
Thu, 16 Feb 2012 13:11:23 +0000 (06:11 -0700)
commit84f04c7d631a725afadb8bc36c2ba2612bb67984
tree26508a452ca52542ac437f55bb632b48fa607048
parent9b760cf03353e622f724b6aa93eea9d84930f717
irq_domain: Add support for base irq and hwirq in legacy mappings

Add support for a legacy mapping where irq = (hwirq - first_hwirq + first_irq)
so that a controller driver can allocate a fixed range of irq_descs and use
a simple calculation to translate back and forth between linux and hw irq
numbers.  This is needed to use an irq_domain with many of the ARM interrupt
controller drivers that manage their own irq_desc allocations.  Ultimately
the goal is to migrate those drivers to use the linear revmap, but doing it
this way allows each driver to be converted separately which makes the
migration path easier.

This patch generalizes the IRQ_DOMAIN_MAP_LEGACY method to use
(first_irq-first_hwirq) as the offset between hwirq and linux irq number,
and adds checks to make sure that the hwirq number does not exceed range
assigned to the controller.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Milton Miller <miltonm@bga.com>
Tested-by: Olof Johansson <olof@lixom.net>
arch/powerpc/include/asm/irq.h
arch/powerpc/sysdev/i8259.c
arch/powerpc/sysdev/tsi108_pci.c
include/linux/irqdomain.h
kernel/irq/irqdomain.c