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/AM5728: What's the relationship between CPU and PMIC when apply PWRON button?

Part Number: AM5728
Other Parts Discussed in Thread: TPS659037

Tool/software: Linux

Hardware: AM5728 , TPS6590377

Software: linux 4.9.28 or later, rootfs is form yocto

As we know a short press on PWRON can turn on PMIC and a long press can force PMIC to turn off. The question is when turnning off PMIC by long press can this time scale be adjustable?

And is there a aplication deamon who is watching the PMIC_INT pin all the time? When a interrupt signal comes the deamon read some info from PMIC over I2C then do system shutdown/reboot? 

  • Hello David,

    To make sure we understand, is this a decent summary of your 2 questions: 1) can you adjust PMIC behavior for a power button press, and 2) how does Linux interact with the PMIC when a power button is pushed?

    Regards,
    Nick
  • Yes correct.1, I wounder if the time delay seconds of long pressing action be adjustable? 2, how does Linux interact with the PMIC when a power button is pushed?
  • Hello David,

    To answer your question on long and short presses:

    Let's assume you based your design off of AM572x EVM board rev 3a, running Linux Processor SDK 5.2. Your am57xx device tree files are located in the SDK at board-support/linux.../arch/arm/boot/dts and board-support/linux.../arch/arm/boot/dts/ti (note: if you are using SDK 4.3 or earlier, all device tree files are under board-support/linux.../arch/arm/boot/dts).

    ti/am57xx-evm.its tells us if we want to build am57xx-evm-reva3.dtb, we need to look at am57xx-beagle-x15-revc.dts (among other dts/dtsi/dtso files).

    am57xx-beagle-x15-revc.dts includes am57xx-beagle-x15-common.dtsi, which has a node for tps659038. According to the post TPS659037 DRIVERS, both tps659037 and tps659038 use the same driver, so this is a good example. The tps659038 node has a subnode tps659038_pwr_button. Check the bindings document at board-support/linux.../Documentation/devicetree/bindings that goes with the compatibility of ti,palmas-pwrbutton. The bindings document talks about valid values for the property ti,palmas-long-press-seconds.

    To answer your question on what Linux does when the button is pressed:

    The driver is at board-support/linux.../drivers/input/misc/palmas-pwrbutton.c if you wanted to dig into it more. It looks like the driver initiates powerdown with input_report_key, but what happens at that point is a generic Linux question that we cannot support on the TI forums.

    Regards,

    Nick