AnsweredAssumed Answered

How to calculate linux, keymap for 3x2 keypad.

Question asked by Purvi Billore on Sep 26, 2019
Latest reply on Sep 29, 2019 by igorpadykov

Hello,

I have to use 3x2 keypad for my iMX6 custom board;

where the interfacing with rows are like:

                                                   KEY_ROW0

                                                   KEY_ROW2

and where the interfacing with columns are like:                                               

                                                   KEY_COL0

                                                   KEY_COL2

                                                   KEY_COL4

Can, anyone guide me to calculate linux, keymap to be added in my device tree:

&kpp {
            compatible = "fsl,imx6q-kpp", "fsl,imx21-kpp";
            clocks = <&clks IMX6QDL_CLK_IPG>;
            pinctrl-0 = <&pinctrl_kpp>;
            linux,keymap = < ?             //KEY_UP

                                        ?             //KEY_DOWN

                                        ?             //KEY_LEFT

                                        ?             //KEY_RIGHT

                                        ?             //KEY_ESC

                                        ?             //KEY_ENTER

                                        >;
            keypad,num-rows = <2>;
            keypad,num-columns = <3>;

};

pinctrl_kpp:kpp_grp_1{
              fsl,pins = <
                           MX6QDL_PAD_KEY_COL0__KEY_COL0 0x80000000
                           MX6QDL_PAD_KEY_ROW0__KEY_ROW0 0x80000000
                           MX6QDL_PAD_KEY_COL2__KEY_COL2 0x80000000
                           MX6QDL_PAD_KEY_ROW2__KEY_ROW2 0x80000000
                           MX6QDL_PAD_KEY_COL4__KEY_COL4 0x80000000
>;
};

Outcomes