Lines Matching refs:desc
16 bool irq_pm_check_wakeup(struct irq_desc *desc) in irq_pm_check_wakeup() argument
18 if (irqd_is_wakeup_armed(&desc->irq_data)) { in irq_pm_check_wakeup()
19 irqd_clear(&desc->irq_data, IRQD_WAKEUP_ARMED); in irq_pm_check_wakeup()
20 desc->istate |= IRQS_SUSPENDED | IRQS_PENDING; in irq_pm_check_wakeup()
21 desc->depth++; in irq_pm_check_wakeup()
22 irq_disable(desc); in irq_pm_check_wakeup()
23 pm_system_irq_wakeup(irq_desc_get_irq(desc)); in irq_pm_check_wakeup()
33 void irq_pm_install_action(struct irq_desc *desc, struct irqaction *action) in irq_pm_install_action() argument
35 desc->nr_actions++; in irq_pm_install_action()
38 desc->force_resume_depth++; in irq_pm_install_action()
40 WARN_ON_ONCE(desc->force_resume_depth && in irq_pm_install_action()
41 desc->force_resume_depth != desc->nr_actions); in irq_pm_install_action()
44 desc->no_suspend_depth++; in irq_pm_install_action()
46 desc->cond_suspend_depth++; in irq_pm_install_action()
48 WARN_ON_ONCE(desc->no_suspend_depth && in irq_pm_install_action()
49 (desc->no_suspend_depth + in irq_pm_install_action()
50 desc->cond_suspend_depth) != desc->nr_actions); in irq_pm_install_action()
57 void irq_pm_remove_action(struct irq_desc *desc, struct irqaction *action) in irq_pm_remove_action() argument
59 desc->nr_actions--; in irq_pm_remove_action()
62 desc->force_resume_depth--; in irq_pm_remove_action()
65 desc->no_suspend_depth--; in irq_pm_remove_action()
67 desc->cond_suspend_depth--; in irq_pm_remove_action()
70 static bool suspend_device_irq(struct irq_desc *desc) in suspend_device_irq() argument
72 unsigned long chipflags = irq_desc_get_chip(desc)->flags; in suspend_device_irq()
73 struct irq_data *irqd = &desc->irq_data; in suspend_device_irq()
75 if (!desc->action || irq_desc_is_chained(desc) || in suspend_device_irq()
76 desc->no_suspend_depth) in suspend_device_irq()
89 __enable_irq(desc); in suspend_device_irq()
101 desc->istate |= IRQS_SUSPENDED; in suspend_device_irq()
102 __disable_irq(desc); in suspend_device_irq()
111 mask_irq(desc); in suspend_device_irq()
133 struct irq_desc *desc; in suspend_device_irqs() local
136 for_each_irq_desc(irq, desc) { in suspend_device_irqs()
140 if (irq_settings_is_nested_thread(desc)) in suspend_device_irqs()
142 raw_spin_lock_irqsave(&desc->lock, flags); in suspend_device_irqs()
143 sync = suspend_device_irq(desc); in suspend_device_irqs()
144 raw_spin_unlock_irqrestore(&desc->lock, flags); in suspend_device_irqs()
152 static void resume_irq(struct irq_desc *desc) in resume_irq() argument
154 struct irq_data *irqd = &desc->irq_data; in resume_irq()
164 __disable_irq(desc); in resume_irq()
168 if (desc->istate & IRQS_SUSPENDED) in resume_irq()
172 if (!desc->force_resume_depth) in resume_irq()
176 desc->depth++; in resume_irq()
177 irq_state_set_disabled(desc); in resume_irq()
178 irq_state_set_masked(desc); in resume_irq()
180 desc->istate &= ~IRQS_SUSPENDED; in resume_irq()
181 __enable_irq(desc); in resume_irq()
186 struct irq_desc *desc; in resume_irqs() local
189 for_each_irq_desc(irq, desc) { in resume_irqs()
191 bool is_early = desc->action && in resume_irqs()
192 desc->action->flags & IRQF_EARLY_RESUME; in resume_irqs()
196 if (irq_settings_is_nested_thread(desc)) in resume_irqs()
199 raw_spin_lock_irqsave(&desc->lock, flags); in resume_irqs()
200 resume_irq(desc); in resume_irqs()
201 raw_spin_unlock_irqrestore(&desc->lock, flags); in resume_irqs()
212 struct irq_desc *desc = irq_get_desc_buslock(irq, &flags, IRQ_GET_DESC_CHECK_GLOBAL); in rearm_wake_irq() local
214 if (!desc) in rearm_wake_irq()
217 if (!(desc->istate & IRQS_SUSPENDED) || in rearm_wake_irq()
218 !irqd_is_wakeup_set(&desc->irq_data)) in rearm_wake_irq()
221 desc->istate &= ~IRQS_SUSPENDED; in rearm_wake_irq()
222 irqd_set(&desc->irq_data, IRQD_WAKEUP_ARMED); in rearm_wake_irq()
223 __enable_irq(desc); in rearm_wake_irq()
226 irq_put_desc_busunlock(desc, flags); in rearm_wake_irq()