This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM335X using I2C TCA8418 keypad

Other Parts Discussed in Thread: TCA8418, TCA8418E

Hi,

I am using am335x and used TCA8418 keypad in my design and included the driver and it is working in linux 3.2. the same i am doing in my Linux 3.12 SDK7 version.

how to define my below declaration in am335x-evm.dts. Please suggest me how to call in Linux 3.12.

I have added below platform data with my board file board-am335xevm.c

------------------------------------------------------------------------------------------------------------

       static struct tca8418_keypad_platform_data am335x_tca8418_info = {
        .keymap_data = &am335x_evm_keymap_data,
        .rows=8,
        .cols=10,
        .rep=0,
        .irq_is_gpio=0,

   };

            {

                        I2C_BOARD_INFO("tca8418_keypad", 0x34),

                        .irq = OMAP_GPIO_IRQ(AM335X_KEYPAD_INT_IRQ_GPIO),          //GPIO1[24]=1*32+24=56

                        .platform_data =  (void *)&am335x_tca8418_info,

            },

------------------------------------------------------------------------------------------------------------

Regards,

Anil.

  • This question appears to be more about the AM335x Linux software than the TCA8418e, so I am moving this to the Sitara forum where someone who better understands the software can help you.
  • Hi,

    I will forward this to the SW team.

  • Hi Anil,

    Check  Documentation/devicetree/bindings/input/omap-keypad.txt & Documentation/devicetree/bindings/input/tca8418_keypad.txt.

    Suppose you've connected the TCA8418 to I2C1. Your abstraction should look something like ( some modifications may be needed to fit your hardware):

    &i2c1 {

         status = "okay";

         pinctrl-names = "default", "sleep";

         pinctrl-0 = <&i2c1_pins_default>;

         pinctrl-0 = <&i2c1_pins_sleep>;         

    ....................................................

                 tca8418_keypad@i2c address  {

                                       compatible =  "ti, tca8418";

                                       reg = <i2c address>

                                       keypad,num-rows =  <8>;

                                       keypad,num-columns = <10>;  

                                       linux,keypad-no-autorepeat;

                                       interrupt-parent = <&gpio1>;

                                       interrupts = <list of irqs >

                                       status = "okay";

               };

    ......................

    .....................

    } ; 

    Hope this helps. 

    Best Regards, 
    Yordan

  • Hi Yordan,

    Thanks for your response. I have defined in my Linux 3.2 with the below key-map code in separate function. How do i call in Linux 3.12 with the below keymap code with values.

    tca8418_keypad@0x34 {
    compatible = "ti, tca8418";
    reg = <0x34 >
    keypad,num-rows = <7>;
    keypad,num-columns = <7>;
    linux,keymap = <KEY_0
    KEY_1
    KEY_2
    KEY_3
    KEY_4
    KEY_5
    KEY_6
    KEY_A
    KEY_B
    KEY_C
    KEY_D
    KEY_E
    KEY_F
    KEY_G
    KEY_H
    KEY_I >;
    linux,keypad-no-autorepeat;
    interrupt-parent = <&gpio1>;
    interrupts = <29 IRQ_TYPE_NONE >
    status = "okay";
    };

    Please explain me, i am not familiar with .dts for modification under Linux 3.12/3.14. Please do the needful.

    Regards,
    Anil.
  • Hi Yordan,

    Is this is the way is to call keymap values, In Linux 3.2 i have created this as platform driver and called with main driver, It is working.

    It is not working with this logic.  Please help me.

    Regards,

    Anil

  • Hi,

    Still i stuck on the same place.

    Please help me how should i get the key values in my application

    Regards,

    Anil

  • Hi Anil,

    Sorry for the delayed response, I was OoO for a while.

    The linux,keymap element is described in Documentation/devicetree/bindings/input/matrix-keypad.txt :
    - linux,keymap: an array of packed 1-cell entries containing the equivalent
    of row, column and linux key-code. The 32-bit big endian cell is packed
    as:
    row << 24 | column << 16 | key-code
    Please check the document & example provided there to fit your use case.

    Best Regards,
    Yordan
  • Hi Yordan,

    Still i am not yet success in my project except qwerty keypad.

    the keypad tca8418 interface has created under i2c nodes and showing the address as well. when i tried to capture something from cat /dev/input/event1 is continuously coming some raw characters. It shouldn't like this, when i trigger my any qwerty keys it should generate the raw values. But continuously coming the raw values.

    When i did the exercise for my LCD Touch screen cat /dev/input/event0 it is coming as per as per touch raw values.

    How to fix my problem.

    Regards,

    Anil