LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Gpio-poweroff usage (https://www.linuxquestions.org/questions/linux-software-2/gpio-poweroff-usage-4175654405/)

DeusDingo 05-22-2019 03:44 PM

Gpio-poweroff usage
 
so i want to understand how gpio-poweroff works. i'm coming from an embedded environment.

I am sorry if this is the wrong forum

for starters i have seen:
linux-kernel/Documentation/devicetree/bindings/power/reset/gpio-poweroff.txt
linux-kernel/drivers/power/reset/gpio-poweroff.c

it gives a timeout in the drivers to allow the userspace/kernel time to wrap up anything before it starts ramping down power rails. is that correct?

in userspace how do i know that this has occurred? i looked around in /dev and i can't see anything obvious that would be a signal i could latch on to. if the system is about to shut down and i my program is running a large portion of the system then my program needs to know we are shutting down. how do i know this countdown has started in the kernel so i abandon ship?

thanks for any help you can give.


All times are GMT -5. The time now is 01:52 AM.