This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/AM4378: Gpio-poweroff usage

Part Number: AM4378

Tool/software: Linux

so i want to understand how gpio-poweroff works within the SDK environment

i think i understand it to be a signal that handles the voltage shutdown in the PMIC to allow for the proper shutdown procedure. 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?

second: 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. 

if i am wrong about this then what would you suggest i use as a means to know when the power has been pulled from the system and we should start to handle shutting down the world?

  • Hi cobsonchael,

    poweroff-gpio: drivers/power/reset/gpio-poweroff.c is used to power the system down by pulling a GPIO line and will register a pm_power_off() callback so that userspace can issue the right system call to power down the system.

    Refer to the below files regarding gpio-poweroff info:

    linux-kernel/Documentation/devicetree/bindings/power/reset/gpio-poweroff.txt
    linux-kernel/drivers/power/reset/gpio-poweroff.c

    linux-kernel/arch/arm/boot/dts/dra71-evm.dts

    Regards,
    Pavel
  • yeah, i've seen the documentation. you also didn't answer any of my questions

    does it shut down the PMIC voltage rails in preparation for power loss?

    how do i access this signal in userspace?

  • Hello,

    This is a general Linux question, not a TI-specific question. We do not support general Linux questions on these forums. Pavel's information is correct.

    If you cannot figure out how the driver works by looking at it (probe function registers gpio_poweroff_do_poweroff as the pm_power_off callback if there is not one already defined, gpio_poweroff_do_poweroff does the actual GPIO toggling), please reach out to the wider Linux community.

    If you are not sure how pm_power_off works in Linux, please reach out to the wider Linux community.

    Regards,
    Nick

  • Hello,

    If you have additional TI-specific questions on this topic that I can support, please post them and we can continue the conversation. Otherwise, I am going to mark the post "TI Thinks Resolved" for bookkeeping purposes.

    Regards,
    Nick