diff options
-rw-r--r-- | include/linux/irq.h | 8 | ||||
-rw-r--r-- | kernel/irq/internals.h | 2 | ||||
-rw-r--r-- | kernel/irq/manage.c | 4 | ||||
-rw-r--r-- | kernel/irq/pm.c | 2 |
4 files changed, 11 insertions, 5 deletions
diff --git a/include/linux/irq.h b/include/linux/irq.h index ef6b66dc9d0..94c8f5bb548 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
@@ -168,6 +168,8 @@ struct irq_data { | |||
168 | * IRQD_PER_CPU - Interrupt is per cpu | 168 | * IRQD_PER_CPU - Interrupt is per cpu |
169 | * IRQD_AFFINITY_SET - Interrupt affinity was set | 169 | * IRQD_AFFINITY_SET - Interrupt affinity was set |
170 | * IRQD_LEVEL - Interrupt is level triggered | 170 | * IRQD_LEVEL - Interrupt is level triggered |
171 | * IRQD_WAKEUP_STATE - Interrupt is configured for wakeup | ||
172 | * from suspend | ||
171 | */ | 173 | */ |
172 | enum { | 174 | enum { |
173 | IRQD_TRIGGER_MASK = 0xf, | 175 | IRQD_TRIGGER_MASK = 0xf, |
@@ -176,6 +178,7 @@ enum { | |||
176 | IRQD_PER_CPU = (1 << 11), | 178 | IRQD_PER_CPU = (1 << 11), |
177 | IRQD_AFFINITY_SET = (1 << 12), | 179 | IRQD_AFFINITY_SET = (1 << 12), |
178 | IRQD_LEVEL = (1 << 13), | 180 | IRQD_LEVEL = (1 << 13), |
181 | IRQD_WAKEUP_STATE = (1 << 14), | ||
179 | }; | 182 | }; |
180 | 183 | ||
181 | static inline bool irqd_is_setaffinity_pending(struct irq_data *d) | 184 | static inline bool irqd_is_setaffinity_pending(struct irq_data *d) |
@@ -217,6 +220,11 @@ static inline bool irqd_is_level_type(struct irq_data *d) | |||
217 | return d->state_use_accessors & IRQD_LEVEL; | 220 | return d->state_use_accessors & IRQD_LEVEL; |
218 | } | 221 | } |
219 | 222 | ||
223 | static inline bool irqd_is_wakeup_set(struct irq_data *d) | ||
224 | { | ||
225 | return d->state_use_accessors & IRQD_WAKEUP_STATE; | ||
226 | } | ||
227 | |||
220 | /** | 228 | /** |
221 | * struct irq_chip - hardware interrupt chip descriptor | 229 | * struct irq_chip - hardware interrupt chip descriptor |
222 | * | 230 | * |
diff --git a/kernel/irq/internals.h b/kernel/irq/internals.h index 1d500fbde0d..5e2366da9f3 100644 --- a/kernel/irq/internals.h +++ b/kernel/irq/internals.h | |||
@@ -46,7 +46,6 @@ enum { | |||
46 | * IRQS_PENDING - irq is pending and replayed later | 46 | * IRQS_PENDING - irq is pending and replayed later |
47 | * IRQS_MASKED - irq is masked | 47 | * IRQS_MASKED - irq is masked |
48 | * IRQS_SUSPENDED - irq is suspended | 48 | * IRQS_SUSPENDED - irq is suspended |
49 | * IRQS_WAKEUP - irq triggers system wakeup from suspend | ||
50 | */ | 49 | */ |
51 | enum { | 50 | enum { |
52 | IRQS_AUTODETECT = 0x00000001, | 51 | IRQS_AUTODETECT = 0x00000001, |
@@ -60,7 +59,6 @@ enum { | |||
60 | IRQS_PENDING = 0x00000200, | 59 | IRQS_PENDING = 0x00000200, |
61 | IRQS_MASKED = 0x00000400, | 60 | IRQS_MASKED = 0x00000400, |
62 | IRQS_SUSPENDED = 0x00000800, | 61 | IRQS_SUSPENDED = 0x00000800, |
63 | IRQS_WAKEUP = 0x00001000, | ||
64 | }; | 62 | }; |
65 | 63 | ||
66 | #include "compat.h" | 64 | #include "compat.h" |
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index 50809c79c7a..ea6add6036b 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c | |||
@@ -492,7 +492,7 @@ int irq_set_irq_wake(unsigned int irq, unsigned int on) | |||
492 | if (ret) | 492 | if (ret) |
493 | desc->wake_depth = 0; | 493 | desc->wake_depth = 0; |
494 | else | 494 | else |
495 | desc->istate |= IRQS_WAKEUP; | 495 | irqd_set(&desc->irq_data, IRQD_WAKEUP_STATE); |
496 | } | 496 | } |
497 | } else { | 497 | } else { |
498 | if (desc->wake_depth == 0) { | 498 | if (desc->wake_depth == 0) { |
@@ -502,7 +502,7 @@ int irq_set_irq_wake(unsigned int irq, unsigned int on) | |||
502 | if (ret) | 502 | if (ret) |
503 | desc->wake_depth = 1; | 503 | desc->wake_depth = 1; |
504 | else | 504 | else |
505 | desc->istate &= ~IRQS_WAKEUP; | 505 | irqd_clear(&desc->irq_data, IRQD_WAKEUP_STATE); |
506 | } | 506 | } |
507 | } | 507 | } |
508 | 508 | ||
diff --git a/kernel/irq/pm.c b/kernel/irq/pm.c index f39383d8672..1329f0eff49 100644 --- a/kernel/irq/pm.c +++ b/kernel/irq/pm.c | |||
@@ -69,7 +69,7 @@ int check_wakeup_irqs(void) | |||
69 | int irq; | 69 | int irq; |
70 | 70 | ||
71 | for_each_irq_desc(irq, desc) | 71 | for_each_irq_desc(irq, desc) |
72 | if ((desc->istate & IRQS_WAKEUP) && | 72 | if (irqd_is_wakeup_set(&desc->irq_data) && |
73 | (desc->istate & IRQS_PENDING)) | 73 | (desc->istate & IRQS_PENDING)) |
74 | return -EBUSY; | 74 | return -EBUSY; |
75 | 75 | ||