My apologies. Allow me to investigate what would be the register that allows you to read the status of the ONOFF button on the i.MX7. I will let you know when I have more information.
My apologies for the delay.
If you want to check that the ONOFF button is pressed or not you can read BTN bit of SNVS.HPSR register. and if you want count of button pressed then you can check it through $cat /proc/interrupts
If you need more details on this register and the SNVS module please consult the i.MX7D Security Reference Manual, which is distributed under an NDA.
I hope this helps!
Are you using the i.MX6? If that’s the case the following thread may help. If not, please let me know which processor you are using.