Welcome to the Linux Foundation Forum!

Gpio-poweroff usage

Options

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.

Categories

Upcoming Training