Search code examples
linuxlinux-kernellinux-device-driverembedded-linuxirq

Difference between enable_irq_wake and enable_irq


My driver is using irq which can wake up the device, enable_irq_wake is enough or i need to first enable_irq and then set enable_irq_wake. Looked into the definition of these functions, not able to understand much.

I tried using both the combination it does not seem to have any effect. I mean just use enable_irq_wake and in other case use enable_irq then enable_irq_wake.

Thank you


Solution

  • If you check here, you'll see that enable_irq_wake invokes set_irq_wake_real that does not enable the irq.

    Further more, take for example this driver: they enable/disable_irq the irq at open/close, while they enable/disable_irq_wake at suspend/resume.