diff options
author | Sundar Iyer <sundar.iyer@stericsson.com> | 2010-12-03 18:05:50 +0300 |
---|---|---|
committer | Linus Walleij <linus.walleij@stericsson.com> | 2010-12-30 00:07:05 +0300 |
commit | 60ebe1568fd15b7ffa101acc645069e27d546ed6 (patch) | |
tree | 45592849a6b4f951f8fc785b7aada4413b4e5e77 /arch/arm/mach-ux500 | |
parent | 09c730a488c32c2cadb31cdb8dcc4df528441197 (diff) | |
download | linux-60ebe1568fd15b7ffa101acc645069e27d546ed6.tar.xz |
ux500: add TC35893 keypad platform data
Signed-off-by: Sundar Iyer <sundar.iyer@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
Diffstat (limited to 'arch/arm/mach-ux500')
-rw-r--r-- | arch/arm/mach-ux500/board-mop500-keypads.c | 65 |
1 files changed, 64 insertions, 1 deletions
diff --git a/arch/arm/mach-ux500/board-mop500-keypads.c b/arch/arm/mach-ux500/board-mop500-keypads.c index 8dbba03eb6c1..70318c354d32 100644 --- a/arch/arm/mach-ux500/board-mop500-keypads.c +++ b/arch/arm/mach-ux500/board-mop500-keypads.c @@ -11,6 +11,7 @@ #include <linux/interrupt.h> #include <linux/platform_device.h> #include <linux/mfd/stmpe.h> +#include <linux/mfd/tc3589x.h> #include <linux/input/matrix_keypad.h> #include <plat/pincfg.h> @@ -148,7 +149,7 @@ static struct stmpe_platform_data stmpe1601_data = { .autosleep_timeout = 1024, }; -static struct i2c_board_info __initdata mop500_i2c0_devices_stuib[] = { +static struct i2c_board_info mop500_i2c0_devices_stuib[] = { { I2C_BOARD_INFO("stmpe1601", 0x40), .irq = NOMADIK_GPIO_TO_IRQ(218), @@ -157,10 +158,72 @@ static struct i2c_board_info __initdata mop500_i2c0_devices_stuib[] = { }, }; +/* + * TC35893 + */ + +static const unsigned int uib_keymap[] = { + KEY(3, 1, KEY_END), + KEY(4, 1, KEY_POWER), + KEY(6, 4, KEY_VOLUMEDOWN), + KEY(4, 2, KEY_EMAIL), + KEY(3, 3, KEY_RIGHT), + KEY(2, 5, KEY_BACKSPACE), + + KEY(6, 7, KEY_MENU), + KEY(5, 0, KEY_ENTER), + KEY(4, 3, KEY_0), + KEY(3, 4, KEY_DOT), + KEY(5, 2, KEY_UP), + KEY(3, 5, KEY_DOWN), + + KEY(4, 5, KEY_SEND), + KEY(0, 5, KEY_BACK), + KEY(6, 2, KEY_VOLUMEUP), + KEY(1, 3, KEY_SPACE), + KEY(7, 6, KEY_LEFT), + KEY(5, 5, KEY_SEARCH), +}; + +static struct matrix_keymap_data uib_keymap_data = { + .keymap = uib_keymap, + .keymap_size = ARRAY_SIZE(uib_keymap), +}; + +static struct tc3589x_keypad_platform_data tc35893_data = { + .krow = TC_KPD_ROWS, + .kcol = TC_KPD_COLUMNS, + .debounce_period = TC_KPD_DEBOUNCE_PERIOD, + .settle_time = TC_KPD_SETTLE_TIME, + .irqtype = IRQF_TRIGGER_FALLING, + .enable_wakeup = true, + .keymap_data = &uib_keymap_data, + .no_autorepeat = true, +}; + +static struct tc3589x_platform_data tc3589x_keypad_data = { + .block = TC3589x_BLOCK_KEYPAD, + .keypad = &tc35893_data, + .irq_base = MOP500_EGPIO_IRQ_BASE, +}; + +static struct i2c_board_info mop500_i2c0_devices_uib[] = { + { + I2C_BOARD_INFO("tc3589x", 0x44), + .platform_data = &tc3589x_keypad_data, + .irq = NOMADIK_GPIO_TO_IRQ(218), + .flags = I2C_CLIENT_WAKE, + }, +}; + void mop500_keypad_init(void) { db8500_add_ske_keypad(&ske_keypad_board); i2c_register_board_info(0, mop500_i2c0_devices_stuib, ARRAY_SIZE(mop500_i2c0_devices_stuib)); + + i2c_register_board_info(0, mop500_i2c0_devices_uib, + ARRAY_SIZE(mop500_i2c0_devices_uib)); + } |