diff options
author | Sundar Iyer <sundar.iyer@stericsson.com> | 2011-01-21 00:26:18 -0500 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2011-03-14 09:05:10 -0400 |
commit | 71f933f4efe8395d4f3da6979cab6a01f2c5411b (patch) | |
tree | 75c02d570f924390143501bd261ef2f4fa3c2916 /arch/arm/mach-ux500/board-mop500-u8500uib.c | |
parent | 0c24352eada58dc3571647593e516b2d5b50014f (diff) |
mach-ux500: add U8500 UIB platform data
The U8500 UIB contains a Synaptics RMI touchpanel and
a matrix keyboard via the TC35893 port expander device.
Signed-off-by: Sundar Iyer <sundar.iyer@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'arch/arm/mach-ux500/board-mop500-u8500uib.c')
-rw-r--r-- | arch/arm/mach-ux500/board-mop500-u8500uib.c | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/arch/arm/mach-ux500/board-mop500-u8500uib.c b/arch/arm/mach-ux500/board-mop500-u8500uib.c index e81c65b2f721..d8a8734a0eba 100644 --- a/arch/arm/mach-ux500/board-mop500-u8500uib.c +++ b/arch/arm/mach-ux500/board-mop500-u8500uib.c | |||
@@ -1,14 +1,111 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) ST-Ericsson SA 2010 | 2 | * Copyright (C) ST-Ericsson SA 2010 |
3 | * | 3 | * |
4 | * Board data for the U8500 UIB, also known as the New UIB | ||
4 | * License terms: GNU General Public License (GPL), version 2 | 5 | * License terms: GNU General Public License (GPL), version 2 |
5 | */ | 6 | */ |
6 | 7 | ||
7 | #include <linux/kernel.h> | 8 | #include <linux/kernel.h> |
8 | #include <linux/init.h> | 9 | #include <linux/init.h> |
10 | #include <linux/i2c.h> | ||
11 | #include <linux/gpio.h> | ||
12 | #include <linux/interrupt.h> | ||
13 | #include <linux/mfd/tc3589x.h> | ||
14 | #include <linux/input/matrix_keypad.h> | ||
15 | #include <../drivers/staging/ste_rmi4/synaptics_i2c_rmi4.h> | ||
16 | |||
17 | #include <mach/gpio.h> | ||
18 | #include <mach/irqs.h> | ||
9 | 19 | ||
10 | #include "board-mop500.h" | 20 | #include "board-mop500.h" |
11 | 21 | ||
22 | /* | ||
23 | * Synaptics RMI4 touchscreen interface on the U8500 UIB | ||
24 | */ | ||
25 | |||
26 | /* | ||
27 | * Descriptor structure. | ||
28 | * Describes the number of i2c devices on the bus that speak RMI. | ||
29 | */ | ||
30 | static struct synaptics_rmi4_platform_data rmi4_i2c_dev_platformdata = { | ||
31 | .irq_number = NOMADIK_GPIO_TO_IRQ(84), | ||
32 | .irq_type = (IRQF_TRIGGER_FALLING | IRQF_SHARED), | ||
33 | .x_flip = false, | ||
34 | .y_flip = true, | ||
35 | .regulator_en = false, | ||
36 | }; | ||
37 | |||
38 | static struct i2c_board_info __initdata mop500_i2c3_devices_u8500[] = { | ||
39 | { | ||
40 | I2C_BOARD_INFO("synaptics_rmi4_i2c", 0x4B), | ||
41 | .platform_data = &rmi4_i2c_dev_platformdata, | ||
42 | }, | ||
43 | }; | ||
44 | |||
45 | /* | ||
46 | * TC35893 | ||
47 | */ | ||
48 | static const unsigned int u8500_keymap[] = { | ||
49 | KEY(3, 1, KEY_END), | ||
50 | KEY(4, 1, KEY_POWER), | ||
51 | KEY(6, 4, KEY_VOLUMEDOWN), | ||
52 | KEY(4, 2, KEY_EMAIL), | ||
53 | KEY(3, 3, KEY_RIGHT), | ||
54 | KEY(2, 5, KEY_BACKSPACE), | ||
55 | |||
56 | KEY(6, 7, KEY_MENU), | ||
57 | KEY(5, 0, KEY_ENTER), | ||
58 | KEY(4, 3, KEY_0), | ||
59 | KEY(3, 4, KEY_DOT), | ||
60 | KEY(5, 2, KEY_UP), | ||
61 | KEY(3, 5, KEY_DOWN), | ||
62 | |||
63 | KEY(4, 5, KEY_SEND), | ||
64 | KEY(0, 5, KEY_BACK), | ||
65 | KEY(6, 2, KEY_VOLUMEUP), | ||
66 | KEY(1, 3, KEY_SPACE), | ||
67 | KEY(7, 6, KEY_LEFT), | ||
68 | KEY(5, 5, KEY_SEARCH), | ||
69 | }; | ||
70 | |||
71 | static struct matrix_keymap_data u8500_keymap_data = { | ||
72 | .keymap = u8500_keymap, | ||
73 | .keymap_size = ARRAY_SIZE(u8500_keymap), | ||
74 | }; | ||
75 | |||
76 | static struct tc3589x_keypad_platform_data tc35893_data = { | ||
77 | .krow = TC_KPD_ROWS, | ||
78 | .kcol = TC_KPD_COLUMNS, | ||
79 | .debounce_period = TC_KPD_DEBOUNCE_PERIOD, | ||
80 | .settle_time = TC_KPD_SETTLE_TIME, | ||
81 | .irqtype = IRQF_TRIGGER_FALLING, | ||
82 | .enable_wakeup = true, | ||
83 | .keymap_data = &u8500_keymap_data, | ||
84 | .no_autorepeat = true, | ||
85 | }; | ||
86 | |||
87 | static struct tc3589x_platform_data tc3589x_keypad_data = { | ||
88 | .block = TC3589x_BLOCK_KEYPAD, | ||
89 | .keypad = &tc35893_data, | ||
90 | .irq_base = MOP500_EGPIO_IRQ_BASE, | ||
91 | }; | ||
92 | |||
93 | static struct i2c_board_info __initdata mop500_i2c0_devices_u8500[] = { | ||
94 | { | ||
95 | I2C_BOARD_INFO("tc3589x", 0x44), | ||
96 | .platform_data = &tc3589x_keypad_data, | ||
97 | .irq = NOMADIK_GPIO_TO_IRQ(218), | ||
98 | .flags = I2C_CLIENT_WAKE, | ||
99 | }, | ||
100 | }; | ||
101 | |||
102 | |||
12 | void __init mop500_u8500uib_init(void) | 103 | void __init mop500_u8500uib_init(void) |
13 | { | 104 | { |
105 | mop500_uib_i2c_add(3, mop500_i2c3_devices_u8500, | ||
106 | ARRAY_SIZE(mop500_i2c3_devices_u8500)); | ||
107 | |||
108 | mop500_uib_i2c_add(0, mop500_i2c0_devices_u8500, | ||
109 | ARRAY_SIZE(mop500_i2c0_devices_u8500)); | ||
110 | |||
14 | } | 111 | } |