I am experimenting with gpio_keys driver, to see if I can get it to work. I fail. Any suggestions?
I can read the value of the gpio through /sys/class/gpio/cpio48/value, and the value in fact changes depending on the button pressed/released. The trouble: NOTHING comes up through /dev/input/event1 when I hit the button, demonstrated by evtest:
No device specified, trying to scan all of /dev/input/event*
Select the device event number [0-1]: 1
Input driver version is 1.0.1
Input device ID: bus 0x19 vendor 0x1 product 0x1 version 0x100
Input device name: "ocp:gpio_keys"
Event code 28 (KEY_ENTER)
Testing ... (interrupt to exit)
I hope I've provided enough information.
Attached is the overlay. This was derived from Derek Molloy's dts (http://exploringbeaglebone.com/chapter6/
), and from the universal cape dts. I started with Malloy's, but it didn't work. I thought it was because my circuit has a pull-down register and his configured the gpio controller's pull-up resister). So, I changed the dts to use neither, and, incidentally, changed the node name from pushbotton_pins to P9_15_gpio_pin (matching the name used by universal dts). Then, I read here that the gpio offset had changed from debian 3.8 to 4.x (which I'm using), and so also made that necessary edit too.
root@beaglebone:~/keys/overlay# uname -a
Linux beaglebone 4.4.36-ti-r72 #1 SMP Wed Dec 7 22:29:53 UTC 2016 armv7l GNU/Linux
Here is edge:
root@beaglebone:~/keys/overlay# cat /sys/class/gpio/gpio48/edge
Yes, I had the universal cape disabled at boot time for this experiment. My /boot/uEnv.txt:
#cmdline=coherent_pool=1M quiet net.ifnames=0 cape_universal=enable
cmdline=coherent_pool=1M quiet net.ifnames=0
Here is slots:
root@beaglebone:~/keys/overlay# cat /sys/devices/platform/bone_capemgr/slots
5: P-O-L- 0 Override Board Name,00A0,Override Manuf,BB-BONE-KEYS
Here is dmesg:
[ 1802.211933] bone_capemgr bone_capemgr: part_number 'BB-BONE-KEYS', version 'N/A'
[ 1802.212015] bone_capemgr bone_capemgr: slot #5: override
[ 1802.212061] bone_capemgr bone_capemgr: Using override eeprom data at slot 5
[ 1802.212109] bone_capemgr bone_capemgr: slot #5: 'Override Board Name,00A0,Override Manuf,BB-BONE-KEYS'
[ 1802.238081] input: ocp:gpio_keys as /devices/platform/ocp/ocp:gpio_keys/input/input2
[ 1802.252947] bone_capemgr bone_capemgr: slot #5: dtbo 'BB-BONE-KEYS-00A0.dtbo' loaded; overlay id #0