struct irq_chip_generic — Generic irq chip data structure
struct irq_chip_generic {
raw_spinlock_t lock;
void __iomem * reg_base;
u32 (* reg_readl) (void __iomem *addr);
void (* reg_writel) (u32 val, void __iomem *addr);
void (* suspend) (struct irq_chip_generic *gc);
void (* resume) (struct irq_chip_generic *gc);
unsigned int irq_base;
unsigned int irq_cnt;
u32 mask_cache;
u32 type_cache;
u32 polarity_cache;
u32 wake_enabled;
u32 wake_active;
unsigned int num_ct;
void * private;
unsigned long installed;
unsigned long unused;
struct irq_domain * domain;
struct list_head list;
struct irq_chip_type chip_types[0];
}; raw_spinlock_t lockLock to protect register and cache data access
void __iomem * reg_baseRegister base address (virtual)
u32 (*)(void __iomem *addr) reg_readlAlternate I/O accessor (defaults to readl if NULL)
void (*)(u32 val, void __iomem *addr) reg_writelAlternate I/O accessor (defaults to writel if NULL)
void (*)(struct irq_chip_generic *gc) suspendFunction called from core code on suspend once per chip; can be useful instead of irq_chip::suspend to handle chip details even when no interrupts are in use
void (*)(struct irq_chip_generic *gc) resumeFunction called from core code on resume once per chip; can be useful instead of irq_chip::suspend to handle chip details even when no interrupts are in use
unsigned int irq_baseInterrupt base nr for this chip
unsigned int irq_cntNumber of interrupts handled by this chip
u32 mask_cacheCached mask register shared between all chip types
u32 type_cacheCached type register
u32 polarity_cacheCached polarity register
u32 wake_enabledInterrupt can wakeup from suspend
u32 wake_activeInterrupt is marked as an wakeup from suspend source
unsigned int num_ctNumber of available irq_chip_type instances (usually 1)
void * privatePrivate data for non generic chip callbacks
unsigned long installedbitfield to denote installed interrupts
unsigned long unusedbitfield to denote unused interrupts
struct irq_domain * domainirq domain pointer
struct list_head listList head for keeping track of instances
struct irq_chip_type chip_types[0]Array of interrupt irq_chip_types
Note, that irq_chip_generic can have multiple irq_chip_type implementations which can be associated to a particular irq line of an irq_chip_generic instance. That allows to share and protect state in an irq_chip_generic instance when we need to implement different flow mechanisms (level/edge) for it.