Rabin Vincent | 705e098 | 2011-01-21 10:56:16 +0530 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) ST-Ericsson SA 2010 |
| 3 | * |
Sundar Iyer | 71f933f | 2011-01-21 10:56:18 +0530 | [diff] [blame] | 4 | * Board data for the U8500 UIB, also known as the New UIB |
Rabin Vincent | 705e098 | 2011-01-21 10:56:16 +0530 | [diff] [blame] | 5 | * License terms: GNU General Public License (GPL), version 2 |
| 6 | */ |
Russell King | 2f8163b | 2011-07-26 10:53:52 +0100 | [diff] [blame] | 7 | #include <linux/gpio.h> |
Rabin Vincent | 705e098 | 2011-01-21 10:56:16 +0530 | [diff] [blame] | 8 | #include <linux/kernel.h> |
| 9 | #include <linux/init.h> |
Sundar Iyer | 71f933f | 2011-01-21 10:56:18 +0530 | [diff] [blame] | 10 | #include <linux/i2c.h> |
Sundar Iyer | 71f933f | 2011-01-21 10:56:18 +0530 | [diff] [blame] | 11 | #include <linux/interrupt.h> |
| 12 | #include <linux/mfd/tc3589x.h> |
| 13 | #include <linux/input/matrix_keypad.h> |
Sundar Iyer | 71f933f | 2011-01-21 10:56:18 +0530 | [diff] [blame] | 14 | |
Sundar Iyer | 71f933f | 2011-01-21 10:56:18 +0530 | [diff] [blame] | 15 | #include <mach/irqs.h> |
Rabin Vincent | 705e098 | 2011-01-21 10:56:16 +0530 | [diff] [blame] | 16 | |
| 17 | #include "board-mop500.h" |
| 18 | |
Linus Walleij | 857f727 | 2011-06-30 08:31:59 +0200 | [diff] [blame] | 19 | /* Dummy data that can be overridden by staging driver */ |
| 20 | struct i2c_board_info __initdata __weak mop500_i2c3_devices_u8500[] = { |
Sundar Iyer | 71f933f | 2011-01-21 10:56:18 +0530 | [diff] [blame] | 21 | }; |
| 22 | |
| 23 | /* |
| 24 | * TC35893 |
| 25 | */ |
| 26 | static const unsigned int u8500_keymap[] = { |
| 27 | KEY(3, 1, KEY_END), |
| 28 | KEY(4, 1, KEY_POWER), |
| 29 | KEY(6, 4, KEY_VOLUMEDOWN), |
| 30 | KEY(4, 2, KEY_EMAIL), |
| 31 | KEY(3, 3, KEY_RIGHT), |
| 32 | KEY(2, 5, KEY_BACKSPACE), |
| 33 | |
| 34 | KEY(6, 7, KEY_MENU), |
| 35 | KEY(5, 0, KEY_ENTER), |
| 36 | KEY(4, 3, KEY_0), |
| 37 | KEY(3, 4, KEY_DOT), |
| 38 | KEY(5, 2, KEY_UP), |
| 39 | KEY(3, 5, KEY_DOWN), |
| 40 | |
| 41 | KEY(4, 5, KEY_SEND), |
| 42 | KEY(0, 5, KEY_BACK), |
| 43 | KEY(6, 2, KEY_VOLUMEUP), |
| 44 | KEY(1, 3, KEY_SPACE), |
| 45 | KEY(7, 6, KEY_LEFT), |
| 46 | KEY(5, 5, KEY_SEARCH), |
| 47 | }; |
| 48 | |
| 49 | static struct matrix_keymap_data u8500_keymap_data = { |
| 50 | .keymap = u8500_keymap, |
| 51 | .keymap_size = ARRAY_SIZE(u8500_keymap), |
| 52 | }; |
| 53 | |
| 54 | static struct tc3589x_keypad_platform_data tc35893_data = { |
| 55 | .krow = TC_KPD_ROWS, |
| 56 | .kcol = TC_KPD_COLUMNS, |
| 57 | .debounce_period = TC_KPD_DEBOUNCE_PERIOD, |
| 58 | .settle_time = TC_KPD_SETTLE_TIME, |
| 59 | .irqtype = IRQF_TRIGGER_FALLING, |
| 60 | .enable_wakeup = true, |
| 61 | .keymap_data = &u8500_keymap_data, |
| 62 | .no_autorepeat = true, |
| 63 | }; |
| 64 | |
| 65 | static struct tc3589x_platform_data tc3589x_keypad_data = { |
| 66 | .block = TC3589x_BLOCK_KEYPAD, |
| 67 | .keypad = &tc35893_data, |
| 68 | .irq_base = MOP500_EGPIO_IRQ_BASE, |
| 69 | }; |
| 70 | |
| 71 | static struct i2c_board_info __initdata mop500_i2c0_devices_u8500[] = { |
| 72 | { |
| 73 | I2C_BOARD_INFO("tc3589x", 0x44), |
| 74 | .platform_data = &tc3589x_keypad_data, |
| 75 | .irq = NOMADIK_GPIO_TO_IRQ(218), |
| 76 | .flags = I2C_CLIENT_WAKE, |
| 77 | }, |
| 78 | }; |
| 79 | |
| 80 | |
Rabin Vincent | 705e098 | 2011-01-21 10:56:16 +0530 | [diff] [blame] | 81 | void __init mop500_u8500uib_init(void) |
| 82 | { |
Sundar Iyer | 71f933f | 2011-01-21 10:56:18 +0530 | [diff] [blame] | 83 | mop500_uib_i2c_add(3, mop500_i2c3_devices_u8500, |
| 84 | ARRAY_SIZE(mop500_i2c3_devices_u8500)); |
| 85 | |
| 86 | mop500_uib_i2c_add(0, mop500_i2c0_devices_u8500, |
| 87 | ARRAY_SIZE(mop500_i2c0_devices_u8500)); |
| 88 | |
Rabin Vincent | 705e098 | 2011-01-21 10:56:16 +0530 | [diff] [blame] | 89 | } |