aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-12-10 11:38:57 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-12-10 11:38:57 -0500
commitecb50f0afd35a51ef487e8a54b976052eb03d729 (patch)
tree27457f87d3dc2ce6c81e16d795f953e66c2fff45 /include/linux
parenta157508c9790ccd1c8b5c6a828d6ba85bbe95aaa (diff)
parent1655b0530d9502e69686220491ffb15ba0738c58 (diff)
Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull irq core updates from Thomas Gleixner: "This is the first (boring) part of irq updates: - support for big endian I/O accessors in the generic irq chip - cleanup of brcmstb/bcm7120 drivers so they can be reused for non ARM SoCs - the usual pile of fixes and updates for the various ARM irq chips" * 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (25 commits) irqchip: dw-apb-ictl: Add PM support irqchip: dw-apb-ictl: Enable IRQ_GC_MASK_CACHE_PER_TYPE irqchip: dw-apb-ictl: Always use use {readl|writel}_relaxed ARM: orion: convert the irq_reg_{readl,writel} calls to the new API irqchip: atmel-aic: Add missing entry for rm9200 irq fixups irqchip: atmel-aic: Rename at91sam9_aic_irq_fixup for naming consistency irqchip: atmel-aic: Add specific irq fixup function for sam9g45 and sam9rl irqchip: atmel-aic: Add irq fixups for at91sam926x SoCs irqchip: atmel-aic: Add irq fixup for RTT block irqchip: brcmstb-l2: Convert driver to use irq_reg_{readl,writel} irqchip: bcm7120-l2: Convert driver to use irq_reg_{readl,writel} irqchip: bcm7120-l2: Decouple driver from brcmstb-l2 irqchip: bcm7120-l2: Extend driver to support 64+ bit controllers irqchip: bcm7120-l2: Use gc->mask_cache to simplify suspend/resume functions irqchip: bcm7120-l2: Fix missing nibble in gc->unused mask irqchip: bcm7120-l2: Make sure all register accesses use base+offset irqchip: bcm7120-l2, brcmstb-l2: Remove ARM Kconfig dependency irqchip: bcm7120-l2: Eliminate bad IRQ check irqchip: brcmstb-l2: Eliminate dependency on ARM code genirq: Generic chip: Add big endian I/O accessors ...
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/irq.h32
1 files changed, 25 insertions, 7 deletions
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 03f48d936f66..8588e5efe577 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -20,6 +20,7 @@
20#include <linux/errno.h> 20#include <linux/errno.h>
21#include <linux/topology.h> 21#include <linux/topology.h>
22#include <linux/wait.h> 22#include <linux/wait.h>
23#include <linux/io.h>
23 24
24#include <asm/irq.h> 25#include <asm/irq.h>
25#include <asm/ptrace.h> 26#include <asm/ptrace.h>
@@ -639,13 +640,6 @@ void arch_teardown_hwirq(unsigned int irq);
639void irq_init_desc(unsigned int irq); 640void irq_init_desc(unsigned int irq);
640#endif 641#endif
641 642
642#ifndef irq_reg_writel
643# define irq_reg_writel(val, addr) writel(val, addr)
644#endif
645#ifndef irq_reg_readl
646# define irq_reg_readl(addr) readl(addr)
647#endif
648
649/** 643/**
650 * struct irq_chip_regs - register offsets for struct irq_gci 644 * struct irq_chip_regs - register offsets for struct irq_gci
651 * @enable: Enable register offset to reg_base 645 * @enable: Enable register offset to reg_base
@@ -692,6 +686,8 @@ struct irq_chip_type {
692 * struct irq_chip_generic - Generic irq chip data structure 686 * struct irq_chip_generic - Generic irq chip data structure
693 * @lock: Lock to protect register and cache data access 687 * @lock: Lock to protect register and cache data access
694 * @reg_base: Register base address (virtual) 688 * @reg_base: Register base address (virtual)
689 * @reg_readl: Alternate I/O accessor (defaults to readl if NULL)
690 * @reg_writel: Alternate I/O accessor (defaults to writel if NULL)
695 * @irq_base: Interrupt base nr for this chip 691 * @irq_base: Interrupt base nr for this chip
696 * @irq_cnt: Number of interrupts handled by this chip 692 * @irq_cnt: Number of interrupts handled by this chip
697 * @mask_cache: Cached mask register shared between all chip types 693 * @mask_cache: Cached mask register shared between all chip types
@@ -716,6 +712,8 @@ struct irq_chip_type {
716struct irq_chip_generic { 712struct irq_chip_generic {
717 raw_spinlock_t lock; 713 raw_spinlock_t lock;
718 void __iomem *reg_base; 714 void __iomem *reg_base;
715 u32 (*reg_readl)(void __iomem *addr);
716 void (*reg_writel)(u32 val, void __iomem *addr);
719 unsigned int irq_base; 717 unsigned int irq_base;
720 unsigned int irq_cnt; 718 unsigned int irq_cnt;
721 u32 mask_cache; 719 u32 mask_cache;
@@ -740,12 +738,14 @@ struct irq_chip_generic {
740 * the parent irq. Usually GPIO implementations 738 * the parent irq. Usually GPIO implementations
741 * @IRQ_GC_MASK_CACHE_PER_TYPE: Mask cache is chip type private 739 * @IRQ_GC_MASK_CACHE_PER_TYPE: Mask cache is chip type private
742 * @IRQ_GC_NO_MASK: Do not calculate irq_data->mask 740 * @IRQ_GC_NO_MASK: Do not calculate irq_data->mask
741 * @IRQ_GC_BE_IO: Use big-endian register accesses (default: LE)
743 */ 742 */
744enum irq_gc_flags { 743enum irq_gc_flags {
745 IRQ_GC_INIT_MASK_CACHE = 1 << 0, 744 IRQ_GC_INIT_MASK_CACHE = 1 << 0,
746 IRQ_GC_INIT_NESTED_LOCK = 1 << 1, 745 IRQ_GC_INIT_NESTED_LOCK = 1 << 1,
747 IRQ_GC_MASK_CACHE_PER_TYPE = 1 << 2, 746 IRQ_GC_MASK_CACHE_PER_TYPE = 1 << 2,
748 IRQ_GC_NO_MASK = 1 << 3, 747 IRQ_GC_NO_MASK = 1 << 3,
748 IRQ_GC_BE_IO = 1 << 4,
749}; 749};
750 750
751/* 751/*
@@ -821,4 +821,22 @@ static inline void irq_gc_lock(struct irq_chip_generic *gc) { }
821static inline void irq_gc_unlock(struct irq_chip_generic *gc) { } 821static inline void irq_gc_unlock(struct irq_chip_generic *gc) { }
822#endif 822#endif
823 823
824static inline void irq_reg_writel(struct irq_chip_generic *gc,
825 u32 val, int reg_offset)
826{
827 if (gc->reg_writel)
828 gc->reg_writel(val, gc->reg_base + reg_offset);
829 else
830 writel(val, gc->reg_base + reg_offset);
831}
832
833static inline u32 irq_reg_readl(struct irq_chip_generic *gc,
834 int reg_offset)
835{
836 if (gc->reg_readl)
837 return gc->reg_readl(gc->reg_base + reg_offset);
838 else
839 return readl(gc->reg_base + reg_offset);
840}
841
824#endif /* _LINUX_IRQ_H */ 842#endif /* _LINUX_IRQ_H */