Debugging keypad on Android

I’m trying to get i.MX51 keypad (mxc_keyb.c) working on Android, but any key works as it is defined on my keymapping[] array.

Fortunately there is an useful command on Android called “getevent”, it is similar to Linux “evtest” program.

Testing it on my target I can see this message when I press HOME key:

# getevent                                                                      
add device 1: /dev/input/event1                                                 
  name:     "mxc_ts"                                                            
could not get driver version for /dev/input/mouse0, Not a typewriter            
add device 2: /dev/input/event0                                                 
  name:     "mxckpd"                                                            
...
/dev/input/event0: 0001 0066 00000001                                           
/dev/input/event0: 0001 0066 00000000                                           

Now pressing same key on real keyboard connected to my board I can see:

# getevent                                                                      
add device 1: /dev/input/event1                                                 
  name:     "mxc_ts"                                                            
could not get driver version for /dev/input/mouse0, Not a typewriter            
add device 2: /dev/input/event0                                                 
  name:     "mxckpd"                                                            
could not get driver version for /dev/input/mice, Not a typewriter              
add device 3: /dev/input/event3                                                 
  name:     "USB keyboard"                                                      
could not get driver version for /dev/input/mouse1, Not a typewriter            
add device 4: /dev/input/event2                                                 
  name:     "USB keyboard"                                                      
/dev/input/event2: 0004 0004 0007004a                                           
/dev/input/event2: 0001 0066 00000001                                           
/dev/input/event2: 0000 0000 00000000                                           
/dev/input/event2: 0004 0004 0007004a                                           
/dev/input/event2: 0001 0066 00000000                                           
/dev/input/event2: 0000 0000 00000000

Then I found the culprit: our driver (mxc_keyb.c) is not generating Misc and Sync events:
0004 0004 0007004a = type 4 (Misc), code 4 (ScanCode), value 7004a
and
0000 0000 00000000 = type 0 (Sync), … don’t care

One thought on “Debugging keypad on Android

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s