How to add Power Button to AML-S905X-CC Le Potato

Le Potato features many wakeup sources. The one relevant to creating a power button is GPIOH_6 on header 2J3. It can wake up the board from shutdown or suspend when it is pulled low to ground.

Any GPIO can be used to emulate a keyboard input key by creating overlays that map the GPIO to the key. We have pre-defined profiles for shutdown on that pin since it also acts as the wake pin for the board.

You can add a GPIO power button by connecting a button to header 2J3 pin 6 and the ground pin 7 next to it. Enable to test and then permanently merge the overlay for GPIO power button via sudo ldto enable gpio-key-power-2j3-6 and sudo ldto merge gpio-key-power-2j3-6.

Now you can shutdown your system by pressing the power button as well as wake up the machine.

Alternatively, you can wake the board via UART RX and ground but we do not recommend this since it is used as UART by default and cannot be bound to the gpio-key driver for shutdown. So it only acts as a wake button.