8 #include <linux/slab.h>
9 #include <linux/export.h>
19 static inline struct irq_chip_regs *cur_regs(
struct irq_data *
d)
41 struct irq_chip_generic *
gc = irq_data_get_irq_chip_data(d);
46 gc->mask_cache &= ~mask;
59 struct irq_chip_generic *
gc = irq_data_get_irq_chip_data(d);
63 gc->mask_cache |=
mask;
77 struct irq_chip_generic *
gc = irq_data_get_irq_chip_data(d);
81 gc->mask_cache &= ~mask;
95 struct irq_chip_generic *
gc = irq_data_get_irq_chip_data(d);
100 gc->mask_cache |=
mask;
110 struct irq_chip_generic *
gc = irq_data_get_irq_chip_data(d);
124 struct irq_chip_generic *
gc = irq_data_get_irq_chip_data(d);
138 struct irq_chip_generic *
gc = irq_data_get_irq_chip_data(d);
153 struct irq_chip_generic *
gc = irq_data_get_irq_chip_data(d);
171 struct irq_chip_generic *
gc = irq_data_get_irq_chip_data(d);
174 if (!(mask & gc->wake_enabled))
179 gc->wake_active |=
mask;
181 gc->wake_active &= ~mask;
197 struct irq_chip_generic *
201 struct irq_chip_generic *
gc;
202 unsigned long sz =
sizeof(*gc) + num_ct *
sizeof(
struct irq_chip_type);
208 gc->irq_base = irq_base;
209 gc->reg_base = reg_base;
210 gc->chip_types->chip.name =
name;
211 gc->chip_types->handler = handler;
236 enum irq_gc_flags
flags,
unsigned int clr,
239 struct irq_chip_type *
ct = gc->chip_types;
247 if (flags & IRQ_GC_INIT_MASK_CACHE)
248 gc->mask_cache =
irq_reg_readl(gc->reg_base + ct->regs.mask);
250 for (i = gc->irq_base; msk; msk >>= 1, i++) {
254 if (flags & IRQ_GC_INIT_NESTED_LOCK)
255 irq_set_lockdep_class(i, &irq_nested_lock_class);
257 irq_set_chip_and_handler(i, &ct->chip, ct->handler);
261 gc->irq_cnt = i - gc->irq_base;
274 struct irq_chip_generic *
gc = irq_data_get_irq_chip_data(d);
275 struct irq_chip_type *
ct = gc->chip_types;
278 for (i = 0; i < gc->num_ct; i++, ct++) {
279 if (ct->type & type) {
299 unsigned int clr,
unsigned int set)
301 unsigned int i = gc->irq_base;
307 for (;
msk; msk >>= 1, i++) {
312 irq_set_handler(i,
NULL);
323 struct irq_chip_generic *
gc;
326 struct irq_chip_type *
ct = gc->chip_types;
328 if (ct->chip.irq_suspend)
336 struct irq_chip_generic *gc;
339 struct irq_chip_type *ct = gc->chip_types;
341 if (ct->chip.irq_resume)
346 #define irq_gc_suspend NULL
347 #define irq_gc_resume NULL
350 static void irq_gc_shutdown(
void)
352 struct irq_chip_generic *gc;
355 struct irq_chip_type *ct = gc->chip_types;
357 if (ct->chip.irq_pm_shutdown)
365 .shutdown = irq_gc_shutdown,
368 static int __init irq_gc_init_ops(
void)