I am trying to interface 4X5 keypad with i-MX6 quad . I am using linux 3.14.38 kernel with default imx_keypad.c driver.
I have done the required iomux changes
How can i do keypad mapping in dts file for standard keypad?
my keypad is 4*5 and looks similar as the attached image.
&kpp {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_kpp_1>;
keypad,num-rows = <5>;
keypad,num-columns = <4>;
linux,keymap = <
0X00040031 //number 1 with row 0 column 0 and 31 hex value for number"1"
0X00010032 //2
>;
status = "okay";
};
0X00040031 //number 1 with row 0 column 0 and 31 hex value for number"1"
i need to make a mapping for alphabets abc when 2 is pressed.
how can i make it?
please suggest
Thanks and Regards
Rizwan Syed
Hi Rizvan
please look at linux/Documentation/devicetree/bindings/input/imx-keypad.txt
linux-2.6-imx.git - Freescale i.MX Linux Tree
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Igor,
Thank you for your reply.
With the above mentioned link, i can map row column and particular hex value for digit or number.
But Characters A-Z are spread over keys 2-9 in alphabetic order. The placement of characters is similar on most mobile phones. For example, the 2-key is pressed once for A, twice for B, and three times for C.
How can i make keypad mapping for the above query?
Please suggest
Thanks and Regards
Rizwan Syed
We also want to do the key mapping like normal phone keypad. If you got any clue in the above case suggest us also.
Hi Chandra sekhar,
You need to include all the keys which are in your keypad in DTS file.
Then map the particular key based on row and column in driver.
Thanks and Regards
Rizwan Syed
hi Rizwan Syed
Could you kindly send us the sample DTS file to include key mapping so
that i can get the alpha-numneric keypad which is present in so many
keypad phones.
Regards,
A.Chandrasekhar
Hi Chandrasekhar,
Please update all the keys in your dts file.
for example if u have 26 keys from A to Z and numbers from 1 to 9 .then you should have 26 + 10 =36 lines of mapping in your dts file
0xAAAAAA02 (number 1 value is 02)
0xAAAAAA03 (number 2 value is 03)
0xAAAAAA04 (number 3 value is 04)
and so on..
AAAAAA can be anything, it does not matter.last 2 digits should match with your alphabet or number .
In driver you may need to make an array with your keypad values according to row and column.then modify the driver mapping to that array.
Thanks and Regards
Rizwan Syed