Hey david
Its not a big issue i'll explain you that how to do that. I am assuming that you are you using TI-Android source code.
In that GPIO1_16,17,31 is already implemented in lcd_cape_keys in board-am335xevm.c so its reduce our work. but this pins are active only if you are plugging your beaglebone LCD cape. but i guess you don't have LCD cape.
I'm assuming you are using BB div cape for display. Do the following steps to make your GPIO work
1--> Configure the GPIO_Buttons in kernel ( its configured default in TI source code)
2--> Copy the lcd_cape_keys_init(DEV_ON_DGHTER_BRD,PROFILE_NONE) ( line no--2449)
3--> Paste the line below the dvi_init(DEV_ON_DGHTER_BRD,PROFILE_NONE) ( line no-- 2455)
Then as usual build the source code and boot BB in your android shell screen execute the " getevent" yo will see the
add device 2: /dev/input/event2
name: "gpio-keys"
If you can see this you have added the gpio driver node successfully . Then touch the p9-4 pin and gpio1_16 you will get some scanning code in your shell screen. if you can see this code your work is over, its will work for home,back,power off as configured in board.c file.
Note: If you are not using DIV cape paste the init function at where you want call the init function
After try this let me know that you got it or not, because i wanna know my idea is working or not.
Good luck david.
Cheers
Chainz