@@ -194,7 +194,6 @@ static int __dev_pm_set_dedicated_wake_irq(struct device *dev, int irq, unsigned
194
194
return err ;
195
195
}
196
196
197
-
198
197
/**
199
198
* dev_pm_set_dedicated_wake_irq - Request a dedicated wake-up interrupt
200
199
* @dev: Device entry
@@ -206,11 +205,6 @@ static int __dev_pm_set_dedicated_wake_irq(struct device *dev, int irq, unsigned
206
205
* Sets up a threaded interrupt handler for a device that has
207
206
* a dedicated wake-up interrupt in addition to the device IO
208
207
* 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.
214
208
*/
215
209
int dev_pm_set_dedicated_wake_irq (struct device * dev , int irq )
216
210
{
@@ -232,56 +226,13 @@ EXPORT_SYMBOL_GPL(dev_pm_set_dedicated_wake_irq);
232
226
* the status of WAKE_IRQ_DEDICATED_REVERSE to tell rpm_suspend()
233
227
* to enable dedicated wake-up interrupt after running the runtime suspend
234
228
* 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.
240
229
*/
241
230
int dev_pm_set_dedicated_wake_irq_reverse (struct device * dev , int irq )
242
231
{
243
232
return __dev_pm_set_dedicated_wake_irq (dev , irq , WAKE_IRQ_DEDICATED_REVERSE );
244
233
}
245
234
EXPORT_SYMBOL_GPL (dev_pm_set_dedicated_wake_irq_reverse );
246
235
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
-
285
236
/**
286
237
* dev_pm_enable_wake_irq_check - Checks and enables wake-up interrupt
287
238
* @dev: Device
@@ -314,8 +265,10 @@ void dev_pm_enable_wake_irq_check(struct device *dev,
314
265
return ;
315
266
316
267
enable :
317
- if (!can_change_status || !(wirq -> status & WAKE_IRQ_DEDICATED_REVERSE ))
268
+ if (!can_change_status || !(wirq -> status & WAKE_IRQ_DEDICATED_REVERSE )) {
318
269
enable_irq (wirq -> irq );
270
+ wirq -> status |= WAKE_IRQ_DEDICATED_ENABLED ;
271
+ }
319
272
}
320
273
321
274
/**
@@ -336,8 +289,10 @@ void dev_pm_disable_wake_irq_check(struct device *dev, bool cond_disable)
336
289
if (cond_disable && (wirq -> status & WAKE_IRQ_DEDICATED_REVERSE ))
337
290
return ;
338
291
339
- if (wirq -> status & WAKE_IRQ_DEDICATED_MANAGED )
292
+ if (wirq -> status & WAKE_IRQ_DEDICATED_MANAGED ) {
293
+ wirq -> status &= ~WAKE_IRQ_DEDICATED_ENABLED ;
340
294
disable_irq_nosync (wirq -> irq );
295
+ }
341
296
}
342
297
343
298
/**
@@ -376,7 +331,7 @@ void dev_pm_arm_wake_irq(struct wake_irq *wirq)
376
331
377
332
if (device_may_wakeup (wirq -> dev )) {
378
333
if (wirq -> status & WAKE_IRQ_DEDICATED_ALLOCATED &&
379
- !pm_runtime_status_suspended (wirq -> dev ))
334
+ !(wirq -> status & WAKE_IRQ_DEDICATED_ENABLED ))
380
335
enable_irq (wirq -> irq );
381
336
382
337
enable_irq_wake (wirq -> irq );
@@ -399,7 +354,7 @@ void dev_pm_disarm_wake_irq(struct wake_irq *wirq)
399
354
disable_irq_wake (wirq -> irq );
400
355
401
356
if (wirq -> status & WAKE_IRQ_DEDICATED_ALLOCATED &&
402
- !pm_runtime_status_suspended (wirq -> dev ))
357
+ !(wirq -> status & WAKE_IRQ_DEDICATED_ENABLED ))
403
358
disable_irq_nosync (wirq -> irq );
404
359
}
405
360
}
0 commit comments