aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/irq.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/irq.h')
-rw-r--r--include/linux/irq.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/include/linux/irq.h b/include/linux/irq.h
index b01d06db9101..e140f69163b6 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -211,6 +211,7 @@ struct irq_data {
211 * IRQD_MANAGED_SHUTDOWN - Interrupt was shutdown due to empty affinity 211 * IRQD_MANAGED_SHUTDOWN - Interrupt was shutdown due to empty affinity
212 * mask. Applies only to affinity managed irqs. 212 * mask. Applies only to affinity managed irqs.
213 * IRQD_SINGLE_TARGET - IRQ allows only a single affinity target 213 * IRQD_SINGLE_TARGET - IRQ allows only a single affinity target
214 * IRQD_DEFAULT_TRIGGER_SET - Expected trigger already been set
214 */ 215 */
215enum { 216enum {
216 IRQD_TRIGGER_MASK = 0xf, 217 IRQD_TRIGGER_MASK = 0xf,
@@ -231,6 +232,7 @@ enum {
231 IRQD_IRQ_STARTED = (1 << 22), 232 IRQD_IRQ_STARTED = (1 << 22),
232 IRQD_MANAGED_SHUTDOWN = (1 << 23), 233 IRQD_MANAGED_SHUTDOWN = (1 << 23),
233 IRQD_SINGLE_TARGET = (1 << 24), 234 IRQD_SINGLE_TARGET = (1 << 24),
235 IRQD_DEFAULT_TRIGGER_SET = (1 << 25),
234}; 236};
235 237
236#define __irqd_to_state(d) ACCESS_PRIVATE((d)->common, state_use_accessors) 238#define __irqd_to_state(d) ACCESS_PRIVATE((d)->common, state_use_accessors)
@@ -260,18 +262,25 @@ static inline void irqd_mark_affinity_was_set(struct irq_data *d)
260 __irqd_to_state(d) |= IRQD_AFFINITY_SET; 262 __irqd_to_state(d) |= IRQD_AFFINITY_SET;
261} 263}
262 264
265static inline bool irqd_trigger_type_was_set(struct irq_data *d)
266{
267 return __irqd_to_state(d) & IRQD_DEFAULT_TRIGGER_SET;
268}
269
263static inline u32 irqd_get_trigger_type(struct irq_data *d) 270static inline u32 irqd_get_trigger_type(struct irq_data *d)
264{ 271{
265 return __irqd_to_state(d) & IRQD_TRIGGER_MASK; 272 return __irqd_to_state(d) & IRQD_TRIGGER_MASK;
266} 273}
267 274
268/* 275/*
269 * Must only be called inside irq_chip.irq_set_type() functions. 276 * Must only be called inside irq_chip.irq_set_type() functions or
277 * from the DT/ACPI setup code.
270 */ 278 */
271static inline void irqd_set_trigger_type(struct irq_data *d, u32 type) 279static inline void irqd_set_trigger_type(struct irq_data *d, u32 type)
272{ 280{
273 __irqd_to_state(d) &= ~IRQD_TRIGGER_MASK; 281 __irqd_to_state(d) &= ~IRQD_TRIGGER_MASK;
274 __irqd_to_state(d) |= type & IRQD_TRIGGER_MASK; 282 __irqd_to_state(d) |= type & IRQD_TRIGGER_MASK;
283 __irqd_to_state(d) |= IRQD_DEFAULT_TRIGGER_SET;
275} 284}
276 285
277static inline bool irqd_is_level_type(struct irq_data *d) 286static inline bool irqd_is_level_type(struct irq_data *d)