@@ -194,7 +194,6 @@ static int __dev_pm_set_dedicated_wake_irq(struct device *dev, int irq, unsigned
194194 return err ;
195195}
196196
197-
198197/**
199198 * dev_pm_set_dedicated_wake_irq - Request a dedicated wake-up interrupt
200199 * @dev: Device entry
@@ -206,11 +205,6 @@ static int __dev_pm_set_dedicated_wake_irq(struct device *dev, int irq, unsigned
206205 * Sets up a threaded interrupt handler for a device that has
207206 * a dedicated wake-up interrupt in addition to the device IO
208207 * interrupt.
209- *
210- * The interrupt starts disabled, and needs to be managed for
211- * the device by the bus code or the device driver using
212- * dev_pm_enable_wake_irq*() and dev_pm_disable_wake_irq*()
213- * functions.
214208 */
215209int dev_pm_set_dedicated_wake_irq (struct device * dev , int irq )
216210{
@@ -232,56 +226,13 @@ EXPORT_SYMBOL_GPL(dev_pm_set_dedicated_wake_irq);
232226 * the status of WAKE_IRQ_DEDICATED_REVERSE to tell rpm_suspend()
233227 * to enable dedicated wake-up interrupt after running the runtime suspend
234228 * callback for @dev.
235- *
236- * The interrupt starts disabled, and needs to be managed for
237- * the device by the bus code or the device driver using
238- * dev_pm_enable_wake_irq*() and dev_pm_disable_wake_irq*()
239- * functions.
240229 */
241230int dev_pm_set_dedicated_wake_irq_reverse (struct device * dev , int irq )
242231{
243232 return __dev_pm_set_dedicated_wake_irq (dev , irq , WAKE_IRQ_DEDICATED_REVERSE );
244233}
245234EXPORT_SYMBOL_GPL (dev_pm_set_dedicated_wake_irq_reverse );
246235
247- /**
248- * dev_pm_enable_wake_irq - Enable device wake-up interrupt
249- * @dev: Device
250- *
251- * Optionally called from the bus code or the device driver for
252- * runtime_resume() to override the PM runtime core managed wake-up
253- * interrupt handling to enable the wake-up interrupt.
254- *
255- * Note that for runtime_suspend()) the wake-up interrupts
256- * should be unconditionally enabled unlike for suspend()
257- * that is conditional.
258- */
259- void dev_pm_enable_wake_irq (struct device * dev )
260- {
261- struct wake_irq * wirq = dev -> power .wakeirq ;
262-
263- if (wirq && (wirq -> status & WAKE_IRQ_DEDICATED_ALLOCATED ))
264- enable_irq (wirq -> irq );
265- }
266- EXPORT_SYMBOL_GPL (dev_pm_enable_wake_irq );
267-
268- /**
269- * dev_pm_disable_wake_irq - Disable device wake-up interrupt
270- * @dev: Device
271- *
272- * Optionally called from the bus code or the device driver for
273- * runtime_suspend() to override the PM runtime core managed wake-up
274- * interrupt handling to disable the wake-up interrupt.
275- */
276- void dev_pm_disable_wake_irq (struct device * dev )
277- {
278- struct wake_irq * wirq = dev -> power .wakeirq ;
279-
280- if (wirq && (wirq -> status & WAKE_IRQ_DEDICATED_ALLOCATED ))
281- disable_irq_nosync (wirq -> irq );
282- }
283- EXPORT_SYMBOL_GPL (dev_pm_disable_wake_irq );
284-
285236/**
286237 * dev_pm_enable_wake_irq_check - Checks and enables wake-up interrupt
287238 * @dev: Device
@@ -314,8 +265,10 @@ void dev_pm_enable_wake_irq_check(struct device *dev,
314265 return ;
315266
316267enable :
317- if (!can_change_status || !(wirq -> status & WAKE_IRQ_DEDICATED_REVERSE ))
268+ if (!can_change_status || !(wirq -> status & WAKE_IRQ_DEDICATED_REVERSE )) {
318269 enable_irq (wirq -> irq );
270+ wirq -> status |= WAKE_IRQ_DEDICATED_ENABLED ;
271+ }
319272}
320273
321274/**
@@ -336,8 +289,10 @@ void dev_pm_disable_wake_irq_check(struct device *dev, bool cond_disable)
336289 if (cond_disable && (wirq -> status & WAKE_IRQ_DEDICATED_REVERSE ))
337290 return ;
338291
339- if (wirq -> status & WAKE_IRQ_DEDICATED_MANAGED )
292+ if (wirq -> status & WAKE_IRQ_DEDICATED_MANAGED ) {
293+ wirq -> status &= ~WAKE_IRQ_DEDICATED_ENABLED ;
340294 disable_irq_nosync (wirq -> irq );
295+ }
341296}
342297
343298/**
@@ -376,7 +331,7 @@ void dev_pm_arm_wake_irq(struct wake_irq *wirq)
376331
377332 if (device_may_wakeup (wirq -> dev )) {
378333 if (wirq -> status & WAKE_IRQ_DEDICATED_ALLOCATED &&
379- !pm_runtime_status_suspended (wirq -> dev ))
334+ !(wirq -> status & WAKE_IRQ_DEDICATED_ENABLED ))
380335 enable_irq (wirq -> irq );
381336
382337 enable_irq_wake (wirq -> irq );
@@ -399,7 +354,7 @@ void dev_pm_disarm_wake_irq(struct wake_irq *wirq)
399354 disable_irq_wake (wirq -> irq );
400355
401356 if (wirq -> status & WAKE_IRQ_DEDICATED_ALLOCATED &&
402- !pm_runtime_status_suspended (wirq -> dev ))
357+ !(wirq -> status & WAKE_IRQ_DEDICATED_ENABLED ))
403358 disable_irq_nosync (wirq -> irq );
404359 }
405360}
0 commit comments