This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

GPIO - wakeup source

Guru 20755 points
Other Parts Discussed in Thread: OMAP3530

Hello,

I am using OMAP3530 with power management capabilities (retention as the deepest power save mode).

I would like to know if and how I should configure some gpio input interrupt as wakeup sources. I did not find wiki describing this.

1. should I configure OMAP_WAKEUP_EN , OMAP_WAKEUP_EVENT (Only for OMAP4x ?)

OR 
2. should I use  /sys/class/gpio/gpioX/power/wakeup ? 

Thank you,

Ran

  • Hi Ran,

    If you need DEEPSLEEP mode then you can wakeup the processor only through dedicated GPIO.

    If it is some other power saving mode, you can wakeup the processor through any GPIO by using "enable_irq_wake" and "device_may_wakeup" APIs.

    http://processors.wiki.ti.com/index.php/Android_Devkit_Power_Management_Porting_Guide#Wake_up_enabled_devices

    One can wakeup from standby from any of the GPIO lines by pressing any button/key connected to a GPIO line.

    static struct gpio_keys_button testdev_gpio_keys[] = {
    	{
    		.code = BTN_EXTRA, /* See include/linux/input.h */
    		.gpio = (10, /* GPIO number */
    		.active_low = 1,
    		.desc = "SW1", /* Button description*/
    		.wakeup = 0,
    	},
    };
    
  • Hi Titusrathinaraj Stalin,

    Thanks again, you're assistance on this topic is highly appreciated.

    I would please like to ask some more on this if I may.

    I am not using suspend/resume, only cpuidle, cpufreq, smartreflex, and runtime PM. I am using retention mode only (not off mode which is the deepeset)

    I understand now from your answer, that I should use enable_irq_wake.

    I did not understand the use of field ".wakeup" for the button gpio. Do you mean that is should be used too together with enable_irq_wake ?

     

    Thanks,

    Ran

  • Also, do we need to set OMAP_WAKEUP_EN ?

    Thanks,

    Ran

  • Hi Ran,

    Yes please, you have to.

    I did not understand the use of field ".wakeup" for the button gpio. Do you mean that is should be used too together with enable_irq_wake ?


    Nope. That is different kind of wakeup source.

  • Hi Titusrathinaraj Stalin,

     I suspect that the console hang is related to WAKEUP_EN (bit 14) not being enabled in uart 2. 

    I'll try it now first thing. I wander how the OMAP3 EVM can demonstrate wakeup without this bit being enabled in the board file for UART #2. Anyhow, I don't have the EVM , only custom board, so I can't check behaviour in EVM with same kernel.

    Ran

  • Hi,

    I have configured all UART pins for wakeup, and it seems to work now.

    OMAP3_MUX(UART2_CTS,(OMAP_MUX_MODE2 | OMAP_PIN_OFF_WAKEUPENABLE)), /*timer 9*/
    OMAP3_MUX(UART2_RTS,(OMAP_MUX_MODE4 | OMAP_PIN_OFF_WAKEUPENABLE)), /*gpio 145 (can be timer 10)*/
    OMAP3_MUX(UART2_TX,(OMAP_MUX_MODE0 | OMAP_PIN_OFF_WAKEUPENABLE)),
    OMAP3_MUX(UART2_RX,(OMAP_MUX_MODE0 | OMAP_INPUT_EN | OMAP_PIN_OFF_WAKEUPENABLE)),

    though it takes ~15 seconds (!!) till the console is alive again.

    Thanks

    Ran