4 Replies Latest reply on Jan 8, 2015 1:37 PM by Intel_Peter

    How to use poweroff-gpio.c(POWER_RESET_GPIO on Kconfig)


      Where is document about how to use poweroff-gpio.c(POWER_RESET_GPIO on Kconfig)?


      I want to use poweroff-gpio function on linux kernel.

      My pcb has power-off function on GP47=L.


      I found POWER_RESET_GPIO item on build/tmp/work/core2-32-poky-linux/linux-libc-headers/3.14-r0/linux-3.14/drivers/power/reset/Kconfig.

      And found "gpio-poweroff.c" at same directory.


      I append


           source "drivers/power/reset/Kconfig"


      to build/tmp/work/edison-poky-linux/linux-yocto/3.10.17+gitAUTOINC+6ad20f049a_c03195ed6e-r0/linux/drivers/Kconfig.

      And append

           config OF

                def_bool y

      to build/tmp/work/edison-poky-linux/linux-yocto/3.10.17+gitAUTOINC+6ad20f049a_c03195ed6e-r0/linux/drivers/of/Kconfig.


      Then, I enable POWER_RESET_GPIO("Board level reset or power off") on menuconfig.

      After rebuilding all, My edison has some file like this:


      root@edison:~# ls -l /sys/bus/platform/drivers/poweroff-gpio/

      --w-------    1 root     root          4096 Oct 30 03:32 bind

      --w-------    1 root     root          4096 Jan  1  2000 uevent

      --w-------    1 root     root          4096 Oct 30 03:32 unbind


      But ther is a few write-only file only, no information to do.

      (I think what to do is invoking gpio_poweroff_probe() function on gpio-poweroff.c, and pass information GP47, ACTIVE_LOW or so.)