4x4 keypad interfacing with i-MX6 solo

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

4x4 keypad interfacing with i-MX6 solo

2,521 Views
hrushinale
Contributor III

I am trying to interface 4X4 keypad with i-MX6 solo , but I don;t have much idea on it. I am using  linux 3.14.28 kernel.

Do I need to modify the driver matrix_keypad.c in linux kernel ?

Do I need to modify the Device Tree File?

If any one has already done this then please guide me or share your suggestions to interface 4x4 keypad with i-MX6 solo

Labels (5)
0 Kudos
7 Replies

1,292 Views
igorpadykov
NXP Employee
NXP Employee

please refer to attached sdk keypad example and description in

Chapter 19 Configuring the Keypad Controller pdf document.

0 Kudos

1,292 Views
hrushinale
Contributor III

Sir, I read the document i.MX 6Solo/6DualLite Applications Processor Reference Manual (chapter 39 Keypad Port (KPP)) but it gives information about registers of KPP and Typical keypad configuration and Key Press Interrupt sequence . But Stll I am unable to do modify the device tree and Driver file 4x4 matrix keypad

0 Kudos

1,292 Views
hrushinale
Contributor III

Do I need to modify platform-imx-keypad.c?

0 Kudos

1,292 Views
igorpadykov
NXP Employee
NXP Employee
0 Kudos

1,292 Views
hrushinale
Contributor III

After browsing some documents I knew that I need to modify the Device tree file.But I am still confused about Driver because when I tried to understand the driver code imx_keypad.c in that they mentioned the below lines:

 #define MAX_MATRIX_KEY_ROWS    8 (Line 45)
 #define MAX_MATRIX_KEY_COLS    8 (Line 46) 
By looking into these lines I thought that if I replace this with 4 at both places it will work for 4x4 keypad.But after going further in driver code I found below lines which made me confused
reg_val |= keypad->rows_en_mask & 0xff;        /* rows */  (Line 325) 
reg_val |= (keypad->cols_en_mask & 0xff) << 8;    /* cols */    (Line 326) 
reg_val &= 0x00ff; (Line 331)  
So,my question is Do I need to modify the above and many more lines like this or just modifying that first two lines ,will it work?
Also I got one sample .dtsi file:

In the above code I am unable to find these addresses .So,if any one has done this previously Plz. help me
igorpadykov sir plz. share your thoughts regarding the Problem.

Thanks in advance.
0 Kudos

1,292 Views
igorpadykov
NXP Employee
NXP Employee

one can start with linux/Documentation/devicetree/bindings/input/imx-keypad.txt

linux-2.6-imx.git - Freescale i.MX Linux Tree

~igor

0 Kudos

1,292 Views
hrushinale
Contributor III

Thanks for Reply.

I have taken above sample .dtsi file from same link .But in that I am unable to get these addresses e.g ( 0x0001006c /* KEY_DOWN */)

Plz. suggest the solution for driver modification.

0 Kudos