Lines Matching refs:desc

16 bool irq_pm_check_wakeup(struct irq_desc *desc)
18 if (irqd_is_wakeup_armed(&desc->irq_data)) {
19 irqd_clear(&desc->irq_data, IRQD_WAKEUP_ARMED);
20 desc->istate |= IRQS_SUSPENDED | IRQS_PENDING;
21 desc->depth++;
22 irq_disable(desc);
23 pm_system_irq_wakeup(irq_desc_get_irq(desc));
30 * Called from __setup_irq() with desc->lock held after @action has
33 void irq_pm_install_action(struct irq_desc *desc, struct irqaction *action)
35 desc->nr_actions++;
38 desc->force_resume_depth++;
40 WARN_ON_ONCE(desc->force_resume_depth &&
41 desc->force_resume_depth != desc->nr_actions);
44 desc->no_suspend_depth++;
46 desc->cond_suspend_depth++;
48 WARN_ON_ONCE(desc->no_suspend_depth &&
49 (desc->no_suspend_depth +
50 desc->cond_suspend_depth) != desc->nr_actions);
54 * Called from __free_irq() with desc->lock held after @action has
57 void irq_pm_remove_action(struct irq_desc *desc, struct irqaction *action)
59 desc->nr_actions--;
62 desc->force_resume_depth--;
65 desc->no_suspend_depth--;
67 desc->cond_suspend_depth--;
70 static bool suspend_device_irq(struct irq_desc *desc)
72 unsigned long chipflags = irq_desc_get_chip(desc)->flags;
73 struct irq_data *irqd = &desc->irq_data;
75 if (!desc->action || irq_desc_is_chained(desc) ||
76 desc->no_suspend_depth)
89 __enable_irq(desc);
101 desc->istate |= IRQS_SUSPENDED;
102 __disable_irq(desc);
111 mask_irq(desc);
133 struct irq_desc *desc;
136 for_each_irq_desc(irq, desc) {
140 if (irq_settings_is_nested_thread(desc))
142 raw_spin_lock_irqsave(&desc->lock, flags);
143 sync = suspend_device_irq(desc);
144 raw_spin_unlock_irqrestore(&desc->lock, flags);
151 static void resume_irq(struct irq_desc *desc)
153 struct irq_data *irqd = &desc->irq_data;
163 __disable_irq(desc);
167 if (desc->istate & IRQS_SUSPENDED)
171 if (!desc->force_resume_depth)
175 desc->depth++;
176 irq_state_set_disabled(desc);
177 irq_state_set_masked(desc);
179 desc->istate &= ~IRQS_SUSPENDED;
180 __enable_irq(desc);
185 struct irq_desc *desc;
188 for_each_irq_desc(irq, desc) {
190 bool is_early = desc->action &&
191 desc->action->flags & IRQF_EARLY_RESUME;
195 if (irq_settings_is_nested_thread(desc))
198 raw_spin_lock_irqsave(&desc->lock, flags);
199 resume_irq(desc);
200 raw_spin_unlock_irqrestore(&desc->lock, flags);
211 struct irq_desc *desc = irq_get_desc_buslock(irq, &flags, IRQ_GET_DESC_CHECK_GLOBAL);
213 if (!desc)
216 if (!(desc->istate & IRQS_SUSPENDED) ||
217 !irqd_is_wakeup_set(&desc->irq_data))
220 desc->istate &= ~IRQS_SUSPENDED;
221 irqd_set(&desc->irq_data, IRQD_WAKEUP_ARMED);
222 __enable_irq(desc);
225 irq_put_desc_busunlock(desc, flags);