Hello All,
I am following the below post to port TCA8418 to OMAPl138 EVM.
http://e2e.ti.com/support/interface/etc_interface/f/390/p/202938/757229.aspx#757229
I am able to successfully interface on board TCA6416 to OMAP. Now omap is able to read states of the switches. Similar thing I am trying to do for 8418 matrix driver interfaced with 4*4 kepad to same I2C channel.
As there is no support in 2.6 linux kenrel I checked out tca8418_keypad.c / .h files. Now I am trying to edit platform file (da850_omapl138) to add device TCA 8418. I don't know the basics of editing platform file so I was following the procedure given in above link. But that code is not working and I am getting errors in board file while building the kernel.
#include <linux/input/tca8418_keypad.h>
...
/* KEY(row, col, val) */
static uint32_t tca8418_km_data[] = {
KEY(0, 0, KEY_LEFT),
KEY(0, 1, KEY_DOWN),
KEY(0, 2, KEY_ENTER),
KEY(0, 3, KEY_M),
KEY(1, 0, KEY_RIGHT),
KEY(1, 1, KEY_UP),
KEY(1, 2, KEY_I),
KEY(1, 3, KEY_N),
KEY(2, 0, KEY_A),
KEY(2, 1, KEY_E),
KEY(2, 2, KEY_J),
KEY(2, 3, KEY_O),
KEY(3, 0, KEY_B),
KEY(3, 1, KEY_F),
KEY(3, 2, KEY_K),
KEY(3, 3, KEY_P)
};
static const struct matrix_keymap_data tca8418_mkdata[] = {
.keymap = tca8418_km_data,
.keymap_size = ARRAY_SIZE(tca8418_km_data),
};
static struct tca8418_keypad_platform_data tca8418_pdata = {
.keymap_data = &tca8418_mkdata;
.rows = 4;
.cols = 4;
.rep = 1; /* Just a guess */
.irq_is_gpio = 0; /* Just a guess */
};
static struct i2c_board_info am335x_i2c_boardinfo2[] = {
{
I2C_BOARD_INFO(TCA8418_NAME, TCA8418_I2C_ADDR),
.platform_data = &tca8418_pdata,
},
};
Error -
arch/arm/mach-davinci/board-da850-evm.c:899: error: field name not in record or union initializer
arch/arm/mach-davinci/board-da850-evm.c:899: error: (near initialization for 'tca8418_mkdata')
arch/arm/mach-davinci/board-da850-evm.c:899: warning: missing braces around initializer
arch/arm/mach-davinci/board-da850-evm.c:899: warning: (near initialization for 'tca8418_mkdata[0]')
arch/arm/mach-davinci/board-da850-evm.c:900: error: field name not in record or union initializer
arch/arm/mach-davinci/board-da850-evm.c:900: error: (near initialization for 'tca8418_mkdata')
arch/arm/mach-davinci/board-da850-evm.c:900: warning: initialization makes pointer from integer without a cast
arch/arm/mach-davinci/board-da850-evm.c:904: warning: initialization from incompatible pointer type
arch/arm/mach-davinci/board-da850-evm.c:904: error: expected '}' before ';' token
make[1]: *** [arch/arm/mach-davinci/board-da850-evm.o] Error 1
make: *** [arch/arm/mach-davinci] Error 2
So in tca8418_mkdata structure initialization code I am getting above error. Could you please guide me in this aspect. Also is there any TI link for writing board file ??
Thanks in advance !!!
Regards
Aditya