aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ux500
diff options
context:
space:
mode:
authorSundar Iyer <sundar.iyer@stericsson.com>2010-12-03 10:05:50 -0500
committerLinus Walleij <linus.walleij@stericsson.com>2010-12-29 16:07:05 -0500
commit60ebe1568fd15b7ffa101acc645069e27d546ed6 (patch)
tree45592849a6b4f951f8fc785b7aada4413b4e5e77 /arch/arm/mach-ux500
parent09c730a488c32c2cadb31cdb8dcc4df528441197 (diff)
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.c65
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 @@
11#include <linux/interrupt.h> 11#include <linux/interrupt.h>
12#include <linux/platform_device.h> 12#include <linux/platform_device.h>
13#include <linux/mfd/stmpe.h> 13#include <linux/mfd/stmpe.h>
14#include <linux/mfd/tc3589x.h>
14#include <linux/input/matrix_keypad.h> 15#include <linux/input/matrix_keypad.h>
15 16
16#include <plat/pincfg.h> 17#include <plat/pincfg.h>
@@ -148,7 +149,7 @@ static struct stmpe_platform_data stmpe1601_data = {
148 .autosleep_timeout = 1024, 149 .autosleep_timeout = 1024,
149}; 150};
150 151
151static struct i2c_board_info __initdata mop500_i2c0_devices_stuib[] = { 152static struct i2c_board_info mop500_i2c0_devices_stuib[] = {
152 { 153 {
153 I2C_BOARD_INFO("stmpe1601", 0x40), 154 I2C_BOARD_INFO("stmpe1601", 0x40),
154 .irq = NOMADIK_GPIO_TO_IRQ(218), 155 .irq = NOMADIK_GPIO_TO_IRQ(218),
@@ -157,10 +158,72 @@ static struct i2c_board_info __initdata mop500_i2c0_devices_stuib[] = {
157 }, 158 },
158}; 159};
159 160
161/*
162 * TC35893
163 */
164
165static const unsigned int uib_keymap[] = {
166 KEY(3, 1, KEY_END),
167 KEY(4, 1, KEY_POWER),
168 KEY(6, 4, KEY_VOLUMEDOWN),
169 KEY(4, 2, KEY_EMAIL),
170 KEY(3, 3, KEY_RIGHT),
171 KEY(2, 5, KEY_BACKSPACE),
172
173 KEY(6, 7, KEY_MENU),
174 KEY(5, 0, KEY_ENTER),
175 KEY(4, 3, KEY_0),
176 KEY(3, 4, KEY_DOT),
177 KEY(5, 2, KEY_UP),
178 KEY(3, 5, KEY_DOWN),
179
180 KEY(4, 5, KEY_SEND),
181 KEY(0, 5, KEY_BACK),
182 KEY(6, 2, KEY_VOLUMEUP),
183 KEY(1, 3, KEY_SPACE),
184 KEY(7, 6, KEY_LEFT),
185 KEY(5, 5, KEY_SEARCH),
186};
187
188static struct matrix_keymap_data uib_keymap_data = {
189 .keymap = uib_keymap,
190 .keymap_size = ARRAY_SIZE(uib_keymap),
191};
192
193static struct tc3589x_keypad_platform_data tc35893_data = {
194 .krow = TC_KPD_ROWS,
195 .kcol = TC_KPD_COLUMNS,
196 .debounce_period = TC_KPD_DEBOUNCE_PERIOD,
197 .settle_time = TC_KPD_SETTLE_TIME,
198 .irqtype = IRQF_TRIGGER_FALLING,
199 .enable_wakeup = true,
200 .keymap_data = &uib_keymap_data,
201 .no_autorepeat = true,
202};
203
204static struct tc3589x_platform_data tc3589x_keypad_data = {
205 .block = TC3589x_BLOCK_KEYPAD,
206 .keypad = &tc35893_data,
207 .irq_base = MOP500_EGPIO_IRQ_BASE,
208};
209
210static struct i2c_board_info mop500_i2c0_devices_uib[] = {
211 {
212 I2C_BOARD_INFO("tc3589x", 0x44),
213 .platform_data = &tc3589x_keypad_data,
214 .irq = NOMADIK_GPIO_TO_IRQ(218),
215 .flags = I2C_CLIENT_WAKE,
216 },
217};
218
160void mop500_keypad_init(void) 219void mop500_keypad_init(void)
161{ 220{
162 db8500_add_ske_keypad(&ske_keypad_board); 221 db8500_add_ske_keypad(&ske_keypad_board);
163 222
164 i2c_register_board_info(0, mop500_i2c0_devices_stuib, 223 i2c_register_board_info(0, mop500_i2c0_devices_stuib,
165 ARRAY_SIZE(mop500_i2c0_devices_stuib)); 224 ARRAY_SIZE(mop500_i2c0_devices_stuib));
225
226 i2c_register_board_info(0, mop500_i2c0_devices_uib,
227 ARRAY_SIZE(mop500_i2c0_devices_uib));
228
166} 229}