keypad port doesn't show up in Linux

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

keypad port doesn't show up in Linux

1,304 Views
dluberger
Contributor V

I've setup my device tree, done all the mappings, i have a 5x8 matrix keyboard i have connected to the kpp, configured for letters a-z and 0-9 plus up down esc enter, but when the OS is running and i have the terminal on my lcd, pressing keys does nothing. I looked in /dev and /proc but i don't see anything anywhere that indicates the keypad is actively being scanned and no letters show up when i press a key.  if i run evtest it only shows the power button (tied to the onoff input, not a kpp button) and my touchscreen controller.  when the os is starting it does hang for a bit on the message "LSB: preliminary key mapping" but other than that i don't see any indication that the keypad port is setup as a keyboard device in linux.

My device tree dts file is attached, as well as the console output during bootup.

0 Kudos
4 Replies

942 Views
igorpadykov
NXP Employee
NXP Employee

Hi David

seems you are using third party bsp, one can try with nxp official from

linux-imx - i.MX Linux kernel 

keypad is used on i.MX6SL EVK and one can look at some examples:

imx6sl-evk.dts\dts\boot\arm\arch - linux-imx - i.MX Linux kernel 

imx6ul-tx6ul.dtsi\dts\boot\arm\arch - linux-imx - i.MX Linux kernel 

4x4 Matrix keypad Interfacing with i-MX6 - Toradex Community 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

942 Views
dluberger
Contributor V

ok I've already followed those examples, but do i have to use the matrix_key function for the keymap? and where are the keyname constants defined?  I couldn't find the linux standard key codes anywhere. also, do i need to define or set an interrupts parameter? ive seen some device trees that have interrupt setup on kpp. finally, am i correct in assuming that of setup correctly the kpp works exactly the same as if i was using a usb keyboard (for the mapped keys)?

0 Kudos

942 Views
igorpadykov
NXP Employee
NXP Employee

Hi David

one can try to analyze keypad driver imx_keypad.c :

imx_keypad.c\keyboard\input\drivers - linux-imx - i.MX Linux kernel 

If it is not showing up in Linux, one can start to debug it in probe function.

Best regards
igor

0 Kudos

942 Views
dluberger
Contributor V

ok i made a bit of progress. the device kpp now shows up in linux as a device, and i can see it listed as an event source in evtest.  however I notice when the lcd comes up, the letter p fills the screen and running evtest shows nonstop key press event with the key_p over and over, eventually it becomes key_enter over and over.  i dont have a key pad plugged in when i startup and when i plug in a keypad it doesnt register any key press.  

1. is it ok not to have the keypad connected.

2. is there a problem having a 1k series resistor in each row and column line?

3. why am i getting nonstop keypress event even with no keypad connected? 

0 Kudos