blob: feb5744d98b7d7658f3d58290b0b1c76ded8f295 [file] [log] [blame]
Rabin Vincent705e0982011-01-21 10:56:16 +05301/*
2 * Copyright (C) ST-Ericsson SA 2010
3 *
Sundar Iyer71f933f2011-01-21 10:56:18 +05304 * Board data for the U8500 UIB, also known as the New UIB
Rabin Vincent705e0982011-01-21 10:56:16 +05305 * License terms: GNU General Public License (GPL), version 2
6 */
Russell King2f8163b2011-07-26 10:53:52 +01007#include <linux/gpio.h>
Rabin Vincent705e0982011-01-21 10:56:16 +05308#include <linux/kernel.h>
9#include <linux/init.h>
Sundar Iyer71f933f2011-01-21 10:56:18 +053010#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>
Sundar Iyer71f933f2011-01-21 10:56:18 +053015
Sundar Iyer71f933f2011-01-21 10:56:18 +053016#include <mach/irqs.h>
Rabin Vincent705e0982011-01-21 10:56:16 +053017
18#include "board-mop500.h"
19
Linus Walleij857f7272011-06-30 08:31:59 +020020/* Dummy data that can be overridden by staging driver */
21struct i2c_board_info __initdata __weak mop500_i2c3_devices_u8500[] = {
Sundar Iyer71f933f2011-01-21 10:56:18 +053022};
23
24/*
25 * TC35893
26 */
27static const unsigned int u8500_keymap[] = {
28 KEY(3, 1, KEY_END),
29 KEY(4, 1, KEY_POWER),
30 KEY(6, 4, KEY_VOLUMEDOWN),
31 KEY(4, 2, KEY_EMAIL),
32 KEY(3, 3, KEY_RIGHT),
33 KEY(2, 5, KEY_BACKSPACE),
34
35 KEY(6, 7, KEY_MENU),
36 KEY(5, 0, KEY_ENTER),
37 KEY(4, 3, KEY_0),
38 KEY(3, 4, KEY_DOT),
39 KEY(5, 2, KEY_UP),
40 KEY(3, 5, KEY_DOWN),
41
42 KEY(4, 5, KEY_SEND),
43 KEY(0, 5, KEY_BACK),
44 KEY(6, 2, KEY_VOLUMEUP),
45 KEY(1, 3, KEY_SPACE),
46 KEY(7, 6, KEY_LEFT),
47 KEY(5, 5, KEY_SEARCH),
48};
49
50static struct matrix_keymap_data u8500_keymap_data = {
51 .keymap = u8500_keymap,
52 .keymap_size = ARRAY_SIZE(u8500_keymap),
53};
54
55static struct tc3589x_keypad_platform_data tc35893_data = {
56 .krow = TC_KPD_ROWS,
57 .kcol = TC_KPD_COLUMNS,
58 .debounce_period = TC_KPD_DEBOUNCE_PERIOD,
59 .settle_time = TC_KPD_SETTLE_TIME,
60 .irqtype = IRQF_TRIGGER_FALLING,
61 .enable_wakeup = true,
62 .keymap_data = &u8500_keymap_data,
63 .no_autorepeat = true,
64};
65
66static struct tc3589x_platform_data tc3589x_keypad_data = {
67 .block = TC3589x_BLOCK_KEYPAD,
68 .keypad = &tc35893_data,
69 .irq_base = MOP500_EGPIO_IRQ_BASE,
70};
71
72static struct i2c_board_info __initdata mop500_i2c0_devices_u8500[] = {
73 {
74 I2C_BOARD_INFO("tc3589x", 0x44),
75 .platform_data = &tc3589x_keypad_data,
76 .irq = NOMADIK_GPIO_TO_IRQ(218),
77 .flags = I2C_CLIENT_WAKE,
78 },
79};
80
81
Rabin Vincent705e0982011-01-21 10:56:16 +053082void __init mop500_u8500uib_init(void)
83{
Sundar Iyer71f933f2011-01-21 10:56:18 +053084 mop500_uib_i2c_add(3, mop500_i2c3_devices_u8500,
85 ARRAY_SIZE(mop500_i2c3_devices_u8500));
86
87 mop500_uib_i2c_add(0, mop500_i2c0_devices_u8500,
88 ARRAY_SIZE(mop500_i2c0_devices_u8500));
89
Rabin Vincent705e0982011-01-21 10:56:16 +053090}