aboutsummaryrefslogtreecommitdiff
path: root/include/linux/irqdomain.h
AgeCommit message (Collapse)AuthorFilesLines
2012-02-16irq_domain: Remove 'new' irq_domain in favour of the ppc oneGrant Likely1-41/+4
This patch removes the simplistic implementation of irq_domains and enables the powerpc infrastructure for all irq_domain users. The powerpc infrastructure includes support for complex mappings between Linux and hardware irq numbers, and can manage allocation of irq_descs. This patch also converts the few users of irq_domain_add()/irq_domain_del() to call irq_domain_add_legacy() instead. v3: Fix bug that set up too many irqs in translation range. v2: Fix removal of irq_alloc_descs() call in gic driver Signed-off-by: Grant Likely <[email protected]> Cc: Rob Herring <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Milton Miller <[email protected]> Tested-by: Olof Johansson <[email protected]>
2012-02-16irq_domain: Add support for base irq and hwirq in legacy mappingsGrant Likely1-1/+19
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 <[email protected]> Cc: Rob Herring <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Milton Miller <[email protected]> Tested-by: Olof Johansson <[email protected]>
2012-02-16irq_domain: Replace irq_alloc_host() with revmap-specific initializersGrant Likely1-9/+15
Each revmap type has different arguments for setting up the revmap. This patch splits up the generator functions so that each revmap type can do its own setup and the user doesn't need to keep track of how each revmap type handles the arguments. This patch also adds a host_data argument to the generators. There are cases where the host_data pointer will be needed before the function returns. ie. the legacy map calls the .map callback for each irq before returning. v2: - Add void *host_data argument to irq_domain_add_*() functions - fixed failure to compile - Moved IRQ_DOMAIN_MAP_* defines into irqdomain.c Signed-off-by: Grant Likely <[email protected]> Cc: Rob Herring <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Milton Miller <[email protected]> Tested-by: Olof Johansson <[email protected]>
2012-02-16irq_domain: Move irq_domain code from powerpc to kernel/irqGrant Likely1-4/+42
This patch only moves the code. It doesn't make any changes, and the code is still only compiled for powerpc. Follow-on patches will generalize the code for other architectures. Signed-off-by: Grant Likely <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Milton Miller <[email protected]> Tested-by: Olof Johansson <[email protected]>
2012-02-14irq_domain: Make irq_domain structure match powerpc's irq_hostGrant Likely1-20/+64
Part of the series to unify the irq remapping mechanisms in the kernel. A follow up patch will copy the powerpc implementation into kernel/irq/irqdomain.c, which will be a lot easier if the structures are identical. Where they differ, I've chose to use the powerpc names since there is a lot more code using those names. Signed-off-by: Grant Likely <[email protected]> Cc: Rob Herring <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Milton Miller <[email protected]> Tested-by: Olof Johansson <[email protected]>
2011-12-23ARM: 7235/1: irqdomain: export irq_domain_simple_ops for !CONFIG_OFJamie Iles1-1/+2
irqdomain support is used in interrupt controller drivers that may not have device tree support but only need the basic HW->Linux irq translation. Rather than having each of these implement their own IRQ domain, allow them to use the simple ops. Acked-by: Thomas Gleixner <[email protected]> Acked-by: Rob Herring <[email protected]> Cc: Grant Likely <[email protected]> Signed-off-by: Jamie Iles <[email protected]> Signed-off-by: Russell King <[email protected]>
2011-10-31irq: support domains with non-zero hwirq baseRob Herring1-1/+15
Interrupt controllers can have non-zero starting value for h/w irq numbers. Adding support in irq_domain allows the domain hwirq numbering to match the interrupt controllers' numbering. As this makes looping over irqs for a domain more complicated, add loop iterators to iterate over all hwirqs and irqs for a domain. Signed-off-by: Rob Herring <[email protected]> Reviewed-by: Jamie Iles <[email protected]> Tested-by: Thomas Abraham <[email protected]> Acked-by: Grant Likely <[email protected]> Acked-by: Thomas Gleixner <[email protected]>
2011-09-20irq: Add declaration of irq_domain_simple_ops to irqdomain.hRob Herring1-0/+1
irq_domain_simple_ops is exported, but is not declared in irqdomain.h, so add it. Signed-off-by: Rob Herring <[email protected]> Cc: Grant Likely <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
2011-07-28dt/irq: add irq_domain_generate_simple() helperGrant Likely1-0/+10
irq_domain_generate_simple() is an easy way to generate an irq translation domain for simple irq controllers. It assumes a flat 1:1 mapping from hardware irq number to an offset of the first linux irq number assigned to the controller Signed-off-by: Grant Likely <[email protected]>
2011-07-28irq: add irq_domain translation infrastructureGrant Likely1-0/+81
This patch adds irq_domain infrastructure for translating from hardware irq numbers to linux irqs. This is particularly important for architectures adding device tree support because the current implementation (excluding PowerPC and SPARC) cannot handle translation for more than a single interrupt controller. irq_domain supports device tree translation for any number of interrupt controllers. This patch converts x86, Microblaze, ARM and MIPS to use irq_domain for device tree irq translation. x86 is untested beyond compiling it, irq_domain is enabled for MIPS and Microblaze, but the old behaviour is preserved until the core code is modified to actually register an irq_domain yet. On ARM it works and is required for much of the new ARM device tree board support. PowerPC has /not/ been converted to use this new infrastructure. It is still missing some features before it can replace the virq infrastructure already in powerpc (see documentation on irq_domain_map/unmap for details). Followup patches will add the missing pieces and migrate PowerPC to use irq_domain. SPARC has its own method of managing interrupts from the device tree and is unaffected by this change. Acked-by: Ralf Baechle <[email protected]> Signed-off-by: Grant Likely <[email protected]>