Hello,
I need to enable power saving mode on my i.MX6 Solo based board. The board used same configuration of sabrelite with additional PMIC (PF0100 as pmic).
All I need is to switch the device to STANDBY mode based on a GPIO interrupt (looks like mem mode is not supported by the kernel)
These are the power state modes supported in my board.
root@imx6qsabrelite:/# cat /sys/power/state
freeze standby mem
I am also able to make switch board to STOP mode by below command.
root@imx6qsabrelite:~# echo standby > /sys/power/state
PM: Syncing filesystems ... done.
Freezing user space processes ... (elapsed 0.01 seconds) done.
...
...
...
PM: Calling sched_clock_suspend+0x0/0x2c
PM: Calling fw_suspend+0x0/0x24
PM: Calling cpufreq_bp_suspend+0x0/0xc4
PM: Calling cpu_pm_suspend+0x0/0x20
How do I configure a GPIO as the wake up source?
Appreciate your pointers...
Regards,
Krishnan.
From hardware design perspective, to enable an interrupt as an wakeup source of STOP mode, you just need to ensure this interrupt is triggered and its mask bit in GPC is not set, you can refer to the routine imx_gpc_irq_mask in arch/arm/mach-imx/gpc.c. In kernel, you should call enable_irq_wake before suspend, just as Fabio said, you can refer to the code of gpio-key, drivers/input/keyboard/gpio_keys.c, gpio_keys_suspend.
You can use gpio-key,wakeup.
An example is available here:
Regards,
Fabio Estevam