Irq_set_irq_wake, irq_set_irq_wake

Source: Internet
Author: User

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 ;}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.