AnsweredAssumed Answered

How to software poweroff using on/off button?

Question asked by ellie kim on Jul 18, 2019
Latest reply on Jul 18, 2019 by igorpadykov

Hello. 

 

I am making a custom board using imx6ul
I want to change the power off during on / off button operation

Now, if the on / off button is pressed for more than 5 seconds, the power is turned off and turned off. In this case, the file saved immediately before the end of the file may be damaged, and the "poweroff" Just like when you command
 I want to clean up the file system and turn off the power.

 

The question is,


1. It seems that the BTN_PRESS_TIME of SNVS_LPCR can be changed to 5 seconds, 10 seconds and 15 seconds in the reference manual. Is it possible? (It takes more than 5 seconds to organize file system and driver, so I want to extend the power shutdown in 5 seconds)

 

2. In snvs_pwrkey.c, I found the location where the on / off button is pressed and the long key that keeps pressing down. I do not see the code to shut down the power. Where is the source code to shut down the power when the on / off button is pressed for more than 5 seconds?

 

3. When the status changes at the location where the long key is detected, I do an input_event, which seems to be caught by / dev / input / event1. Is there any way to read this event1 while (1) to process it?

 

I just want to execute the "poweroff" command using call_usermodehelper when I detect the long key of the on / off button at any time, but when I use it in snvs_pwrkey.c, it runs only error and does not power off the software.

Please help me

Outcomes