Lines Matching +full:irq +full:- +full:device
1 /* SPDX-License-Identifier: GPL-2.0 */
21 #include <asm/irq.h>
42 * irq handling routines.
44 * IRQF_SHARED - allow sharing the irq among several devices
45 * IRQF_PROBE_SHARED - set by callers when they expect sharing mismatches to occur
46 * IRQF_TIMER - Flag to mark this interrupt as timer interrupt
47 * IRQF_PERCPU - Interrupt is per cpu
48 * IRQF_NOBALANCING - Flag to exclude this interrupt from irq balancing
49 * IRQF_IRQPOLL - Interrupt is used for polling (only the interrupt that is
52 * IRQF_ONESHOT - Interrupt is not reenabled after the hardirq handler finished.
54 * irq line disabled until the threaded handler has been run.
55 * IRQF_NO_SUSPEND - Do not disable this IRQ during suspend. Does not guarantee
57 * state. See Documentation/power/suspend-and-interrupts.rst
58 * IRQF_FORCE_RESUME - Force enable it on resume even if IRQF_NO_SUSPEND is set
59 * IRQF_NO_THREAD - Interrupt cannot be threaded
60 * IRQF_EARLY_RESUME - Resume IRQ early during syscore instead of at device
62 * IRQF_COND_SUSPEND - If the IRQ is shared with a NO_SUSPEND user, execute this
66 * IRQF_NO_AUTOEN - Don't enable IRQ or NMI automatically when users request it.
69 * IRQF_NO_DEBUG - Exclude from runnaway detection for IPI and similar handlers,
71 * IRQF_COND_ONESHOT - Agree to do IRQF_ONESHOT if already set for a shared
96 * IRQC_IS_HARDIRQ - interrupt runs in hardirq context
97 * IRQC_IS_NESTED - interrupt runs in a nested threaded context
107 * struct irqaction - per interrupt action descriptor
109 * @name: name of the device
110 * @dev_id: cookie to identify the device
111 * @percpu_dev_id: cookie to identify the device
113 * @irq: interrupt number
120 * @dir: pointer to the proc/irq/NN/name entry
130 unsigned int irq; member
141 * If a (PCI) device interrupt is not connected we set dev->irq to
142 * IRQ_NOTCONNECTED. This causes request_irq() to fail with -ENOTCONN, so we
151 request_threaded_irq(unsigned int irq, irq_handler_t handler,
156 * request_irq - Add a handler for an interrupt line
157 * @irq: The interrupt line to allocate
158 * @handler: Function to be called when the IRQ occurs.
162 * @name: Name of the device generating this interrupt
169 request_irq(unsigned int irq, irq_handler_t handler, unsigned long flags, in request_irq() argument
172 return request_threaded_irq(irq, handler, NULL, flags | IRQF_COND_ONESHOT, name, dev); in request_irq()
176 request_any_context_irq(unsigned int irq, irq_handler_t handler,
180 __request_percpu_irq(unsigned int irq, irq_handler_t handler,
185 request_nmi(unsigned int irq, irq_handler_t handler, unsigned long flags,
189 request_percpu_irq(unsigned int irq, irq_handler_t handler, in request_percpu_irq() argument
192 return __request_percpu_irq(irq, handler, 0, in request_percpu_irq()
197 request_percpu_nmi(unsigned int irq, irq_handler_t handler,
203 extern const void *free_nmi(unsigned int irq, void *dev_id);
204 extern void free_percpu_nmi(unsigned int irq, void __percpu *percpu_dev_id);
206 struct device;
209 devm_request_threaded_irq(struct device *dev, unsigned int irq,
215 devm_request_irq(struct device *dev, unsigned int irq, irq_handler_t handler, in devm_request_irq() argument
218 return devm_request_threaded_irq(dev, irq, handler, NULL, irqflags, in devm_request_irq()
223 devm_request_any_context_irq(struct device *dev, unsigned int irq,
227 extern void devm_free_irq(struct device *dev, unsigned int irq, void *dev_id);
229 bool irq_has_action(unsigned int irq);
230 extern void disable_irq_nosync(unsigned int irq);
231 extern bool disable_hardirq(unsigned int irq);
232 extern void disable_irq(unsigned int irq);
233 extern void disable_percpu_irq(unsigned int irq);
234 extern void enable_irq(unsigned int irq);
235 extern void enable_percpu_irq(unsigned int irq, unsigned int type);
236 extern bool irq_percpu_is_enabled(unsigned int irq);
237 extern void irq_wake_thread(unsigned int irq, void *dev_id);
240 disable_irq(*_T->lock), enable_irq(*_T->lock))
242 extern void disable_nmi_nosync(unsigned int irq);
243 extern void disable_percpu_nmi(unsigned int irq);
244 extern void enable_nmi(unsigned int irq);
245 extern void enable_percpu_nmi(unsigned int irq, unsigned int type);
246 extern int prepare_percpu_nmi(unsigned int irq);
247 extern void teardown_percpu_nmi(unsigned int irq);
249 extern int irq_inject_interrupt(unsigned int irq);
254 extern void rearm_wake_irq(unsigned int irq);
257 * struct irq_affinity_notify - context for notification of IRQ affinity changes
258 * @irq: Interrupt to which notification applies
269 unsigned int irq; member
279 * struct irq_affinity - Description for automatic irq affinity assignments
281 * the MSI(-X) vector space
283 * the MSI(-X) vector space
290 * pointer to driver/device specific data.
302 * struct irq_affinity_desc - Interrupt affinity descriptor
315 extern int irq_set_affinity(unsigned int irq, const struct cpumask *cpumask);
316 extern int irq_force_affinity(unsigned int irq, const struct cpumask *cpumask);
318 extern int irq_can_set_affinity(unsigned int irq);
319 extern int irq_select_affinity(unsigned int irq);
321 extern int __irq_apply_affinity_hint(unsigned int irq, const struct cpumask *m,
325 * irq_update_affinity_hint - Update the affinity hint
326 * @irq: Interrupt to update
332 irq_update_affinity_hint(unsigned int irq, const struct cpumask *m) in irq_update_affinity_hint() argument
334 return __irq_apply_affinity_hint(irq, m, false); in irq_update_affinity_hint()
338 * irq_set_affinity_and_hint - Update the affinity hint and apply the provided
340 * @irq: Interrupt to update
347 irq_set_affinity_and_hint(unsigned int irq, const struct cpumask *m) in irq_set_affinity_and_hint() argument
349 return __irq_apply_affinity_hint(irq, m, true); in irq_set_affinity_and_hint()
356 static inline int irq_set_affinity_hint(unsigned int irq, const struct cpumask *m) in irq_set_affinity_hint() argument
358 return irq_set_affinity_and_hint(irq, m); in irq_set_affinity_hint()
361 extern int irq_update_affinity_desc(unsigned int irq,
365 irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify);
375 static inline int irq_set_affinity(unsigned int irq, const struct cpumask *m) in irq_set_affinity() argument
377 return -EINVAL; in irq_set_affinity()
380 static inline int irq_force_affinity(unsigned int irq, const struct cpumask *cpumask) in irq_force_affinity() argument
385 static inline int irq_can_set_affinity(unsigned int irq) in irq_can_set_affinity() argument
390 static inline int irq_select_affinity(unsigned int irq) { return 0; } in irq_select_affinity() argument
392 static inline int irq_update_affinity_hint(unsigned int irq, in irq_update_affinity_hint() argument
395 return -EINVAL; in irq_update_affinity_hint()
398 static inline int irq_set_affinity_and_hint(unsigned int irq, in irq_set_affinity_and_hint() argument
401 return -EINVAL; in irq_set_affinity_and_hint()
404 static inline int irq_set_affinity_hint(unsigned int irq, in irq_set_affinity_hint() argument
407 return -EINVAL; in irq_set_affinity_hint()
410 static inline int irq_update_affinity_desc(unsigned int irq, in irq_update_affinity_desc() argument
413 return -EINVAL; in irq_update_affinity_desc()
417 irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify) in irq_set_affinity_notifier() argument
438 * Special lockdep variants of irq disabling/enabling.
440 * know that a particular irq context which is disabled,
441 * and which is the only irq-context user of a lock,
442 * that it's safe to take the lock in the irq-disabled
446 * irq disable/enable methods.
448 static inline void disable_irq_nosync_lockdep(unsigned int irq) in disable_irq_nosync_lockdep() argument
450 disable_irq_nosync(irq); in disable_irq_nosync_lockdep()
456 static inline void disable_irq_nosync_lockdep_irqsave(unsigned int irq, unsigned long *flags) in disable_irq_nosync_lockdep_irqsave() argument
458 disable_irq_nosync(irq); in disable_irq_nosync_lockdep_irqsave()
464 static inline void disable_irq_lockdep(unsigned int irq) in disable_irq_lockdep() argument
466 disable_irq(irq); in disable_irq_lockdep()
472 static inline void enable_irq_lockdep(unsigned int irq) in enable_irq_lockdep() argument
477 enable_irq(irq); in enable_irq_lockdep()
480 static inline void enable_irq_lockdep_irqrestore(unsigned int irq, unsigned long *flags) in enable_irq_lockdep_irqrestore() argument
485 enable_irq(irq); in enable_irq_lockdep_irqrestore()
488 /* IRQ wakeup (PM) control: */
489 extern int irq_set_irq_wake(unsigned int irq, unsigned int on);
491 static inline int enable_irq_wake(unsigned int irq) in enable_irq_wake() argument
493 return irq_set_irq_wake(irq, 1); in enable_irq_wake()
496 static inline int disable_irq_wake(unsigned int irq) in disable_irq_wake() argument
498 return irq_set_irq_wake(irq, 0); in disable_irq_wake()
508 IRQCHIP_STATE_LINE_LEVEL, /* Is IRQ line high? */
511 extern int irq_get_irqchip_state(unsigned int irq, enum irqchip_irq_state which,
513 extern int irq_set_irqchip_state(unsigned int irq, enum irqchip_irq_state which,
551 tasklets are more than enough. F.e. all serial device BHs et
626 /* Tasklets --- multithreaded analogue of BHs.
700 return !test_and_set_bit(TASKLET_STATE_RUN, &(t)->state); in tasklet_trylock()
718 if (!test_and_set_bit(TASKLET_STATE_SCHED, &t->state)) in tasklet_schedule()
726 if (!test_and_set_bit(TASKLET_STATE_SCHED, &t->state)) in tasklet_hi_schedule()
732 atomic_inc(&t->count); in tasklet_disable_nosync()
757 atomic_dec(&t->count); in tasklet_enable()
770 * for accurate IRQ probing during kernel initialization. They are
772 * and, unlike other attempts at IRQ probing, they do not get hung on
777 * 1. clear and/or mask the device's internal interrupt.
780 * 4. enable the device and cause it to trigger an interrupt.
781 * 5. wait for the device to interrupt, using non-intrusive polling or a delay.
782 * 6. irq = probe_irq_off(irqs); // get IRQ number, 0=none, negative=multiple
783 * 7. service the device to clear its pending interrupt.
786 * probe_irq_on() returns a mask of allocated irq's.
789 * and returns the irq number which occurred,
790 * or zero if none occurred, or a negative irq number
791 * if more than one irq occurred.
814 /* Initialize /proc/irq/ */