How to enable graceful shut down in imx6?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to enable graceful shut down in imx6?

1,842 Views
derrildsouza
Contributor I

I can see that my power button package is already enabled, and my /proc/interrupts says "192:          1          0  gpio-mxc   0  Power Button". I am now NOT able to manual add a power button module. If I add my own module  I get this print in dmesg "genirq: Flags mismatch irq 192. 00000002 (Custom Power Button) vs. 00000083 (Power Button)"

Can anyone suggest how can I use the inbuilt module for a graceful shut-down or even sleep mode? 

Also is it possible to wake-up from sleep mode by monitoring this GPIO-interrupt?

0 Kudos
4 Replies

1,235 Views
igorpadykov
NXP Employee
NXP Employee

Hi Derril

one can try standard linux poweroff, for supported low power modes

please check sect.21.1.5 Unit Test attached Linux Manual.

GPIO interrupt can wake processor from low power mode.

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

1,235 Views
derrildsouza
Contributor I

Thanks for the response. But however when I run any of these commands "echo mem > /sys/power/state" or "echo standby > /sys/power/state", the board just restarts after a few seconds. The reset cause is WDOG. The board doesn't even enter low power mode. It just resets. 

Are there any test scripts for OpenWRT where I can see different power settings and their option? 

0 Kudos

1,235 Views
igorpadykov
NXP Employee
NXP Employee

please check WDOGx_WCR, bit WDZST

i.MX6DQ RM Chapter 70 Watchdog Timer (WDOG)

http://cache.freescale.com/files/32bit/doc/ref_manual/IMX6DQRM.pdf 

~igor

0 Kudos

1,235 Views
derrildsouza
Contributor I

Igor,

Thanks. I figured out what was the issue. WatchDog was just only doing what its supposed to do. Issue was in my module, which wasn't getting suspended. By removing this module both the commands worked, however, my issue is still not solved!

My requirement is pretty simple. I have a GPIO registered as PowerKey. The gpio is no doubt getting interrupted while there is a transition happening on this pin. The thing I need is to use the PM module and shut my board down once a low pulse is detected on this pin. I'm not able to find any support code for this. I cannot write my own IRQ since PM module is already using this GPIO. Can you please point me to the code where I can add this functionality?

0 Kudos