The PMIC has hardware debouncing as well as software controlled timers for the powerbutton. It basically generates an interrupt on the A64 for the different things like short press, long press, release. If you hold the powerbutton longer, it does a hard power-off. You can read the event from /dev/input/event1 if the power button is pressed, you will get keycode 116 (POWER_KEY) and that can be mapped for example to shutdown your system.
Come have a chat in the Pine IRC channel >>