Irq_set_irq_wake, irq_set_irq_wake
Int irq_set_irq_wake (unsigned int irq, unsigned int on) enables interruption to wake up in sleep state and change the current state to wake up. the routine is as follows: static int cw1__sdio_pm (struct hwbus_priv * self, bool suspend) {int ret = 0; if (self-> pdata-> irq) ret = irq_set_irq_wake (self-> pdata-> irq, suspend); return ret;} source code analysis: int irq_set_irq_wake (unsigned int irq, unsigned int on) {unsigned long flags; struct irq_desc * desc = irq_get_desc_buslock (irq, & flags, IRQ _ GET_DESC_CHECK_GLOBAL); int ret = 0; # exit if (! Desc) return-EINVAL;/* wakeup-capable irqs can be shared between drivers that * don't need to have the same sleep mode behaviors. */# assume that the parameter on is 1if (on) {if (desc-> wake_depth ++ = 0) {# if the current interrupt depth is 0. it indicates that no nested enable_irq and disable_irq are available. # Call the chip function to set wakeret = set_irq_wake_real (irq, on); if (ret) desc-> wake_depth = 0; else # IRQD_WAKEUP_STATEirqd_set (& desc-> irq_data, IRQD_WAKEUP_STATE);} else {if (desc-> wake_depth = 0) {WARN (1, "Unbalanced IRQ % d wake disable \ n", irq);} else if (-- desc-> wake_depth = 0) {ret = set_irq_wake_real (irq, on ); if (ret) desc-> wake_depth = 1; elseirqd_clear (& desc-> irq_data, IRQD_WAKEUP_STATE) ;}} irq_put_desc_busunlock (desc, flags); return ret ;} static int set_irq_wake_real (unsigned int irq, unsigned int on) {struct irq_desc * desc = irq_to_desc (irq); int ret =-ENXIO; # If the flag contains cursor, skip wakeup, exit if (irq_desc_get_chip (desc)-> flags & IRQCHIP_SKIP_SET_WAKE) return 0; # if the irq_set_wake of chip is not null, call the token of chip to set wakeupif (desc-> irq_data.chip-> irq_set_wake) ret = desc-> irq_data.chip-> iterator (& desc-> irq_data, on); return ret ;}