GPIO power-off driver

modulename: gpio-poweroff.ko

configname: CONFIG_POWER_RESET_GPIO

Linux Kernel Configuration
└─>Device Drivers
└─>Power supply class support
└─>Board level reset or power off
└─>GPIO power-off driver
In linux kernel since version 3.1 (release Date: 2011-10-24)  
This driver supports turning off your board via a GPIO line.
If your board needs a GPIO high/low to power down, say Y and
create a binding in your devicetree.

source code: