Hi,
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:
root@beaglebone:~/keys/overlay# evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0: tps65217_pwr_but
/dev/input/event1: ocp:gpio_keys
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”
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 28 (KEY_ENTER)
Properties:
Testing … (interrupt to exit)
I hope I’ve provided enough information.
Thanks.
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.
uname:
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
both
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
0: PF---- -1
1: PF---- -1
2: PF---- -1
3: PF---- -1
5: P-O-L- 0 Override Board Name,00A0,Override Manuf,BB-BONE-KEYS
Here is dmesg:
BB-BONE-KEYS-00A0.dts (1.12 KB)