iMX6Q kpp matrix keyboard driver not work -help

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

iMX6Q kpp matrix keyboard driver not work -help

Jump to solution
1,394 Views
piyushashtikar
Contributor II
We are working on custom iMX6Q board and have interfaced 4 x 4 Matrix keyboard.

I am using fsl-community-bsp daisy branch.

I tested if hardware is correct by making all pins gpio, it works well.
Now, I need to use kpp driver, which does not work.
My device tree entry looks like this
///////////////////////////////////////////////////////////////////////////////////
    &kpp{
        compatible = "fsl,imx6q-kpp", "fsl,imx21-kpp";
        reg = <0x020b8000 0x4000>;
        interrupts = <0 82 0x04>;
        clocks = <&clks 62>;
        pinctrl-0 = <&pinctrl_kpp_2>;
        linux,keymap = <
                0x01010032      /*  KEY_M*/
                0x01020014      /*  KEY_T */
                0x0100001F      /*  KEY_S */
                0x01050012      /*  KEY_E */
                >;
        keypad,num-rows = <4>;
        keypad,num-columns = <4>;
        };

    kpp {
        pinctrl_kpp_2: kpp_grp_2 {
            fsl,pins = <
                MX6QDL_PAD_KEY_ROW0__KEY_ROW0       0x1b010
                MX6QDL_PAD_KEY_ROW1__KEY_ROW1      0x1b010
                MX6QDL_PAD_KEY_ROW2__KEY_ROW2      0x1b0b0
                MX6QDL_PAD_KEY_ROW4__KEY_ROW4      0x1b0b0
               
                MX6QDL_PAD_KEY_COL0__KEY_COL0      0x1b0b0
                MX6QDL_PAD_KEY_COL1__KEY_COL1      0x1b0b0
                MX6QDL_PAD_KEY_COL2__KEY_COL2      0x1b0b0
                MX6QDL_PAD_GPIO_0__KEY_COL5      0x1b0b0
            >;
        };


    };

/////////////////////////////////////////////////////////////////////////////////////////////////////////
in file imx_keypad.c   
   dev_dbg(&pdev->dev, "enabled rows mask: %x\n", keypad->rows_en_mask);
    dev_dbg(&pdev->dev, "enabled cols mask: %x\n", keypad->cols_en_mask);

Messages print 0x17 and 0x27 which I guess is correct.

Now I tried putting message in function imx_keypad_check_for_events() and in imx_keypad_scan_matrix()
which does not print even once.

Here is my dmesg log.

///////////////////////////////////////////////////////                                                     
Nov 25 13:21:00 imx6qsabresd user.debug kernel: imx-keypad 20b8000.kpp: enabled rows mask: 17                                                                  
Nov 25 13:21:00 imx6qsabresd user.debug kernel: imx-keypad 20b8000.kpp: enabled cols mask: 27                                                                  
Nov 25 13:21:00 imx6qsabresd user.info kernel: input: 20b8000.kpp as /devices/soc0/soc.1/2000000.aips-bus/20b8000.kpp/input/input0
///////////////////////////////////////////////////////

I guess my setup_timer fails, any help is appreciated.

Labels (4)
Tags (1)
1 Solution
807 Views
piyushashtikar
Contributor II

Thanks igor,

MATRIX_KEY macro is not defined in the daisy branch.
My problem was that IOMUX implemented in .dtsi file is not reflected in registers.

I have exclusively write those registers using a bash script.
Regards,
Piyush Ashtikar.

View solution in original post

3 Replies
808 Views
piyushashtikar
Contributor II

Thanks igor,

MATRIX_KEY macro is not defined in the daisy branch.
My problem was that IOMUX implemented in .dtsi file is not reflected in registers.

I have exclusively write those registers using a bash script.
Regards,
Piyush Ashtikar.
807 Views
abhijeet_ghodga
Contributor III

How to write these registers using bash script?

0 Kudos
807 Views
igorpadykov
NXP Employee
NXP Employee

Hi piyush

keypad is used on i.MX6SL EVK please check imx6sl-evk.dts
http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/tree/arch/arm/boot/dts/imx6sl-evk.dts?id...

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