blob: d397c19570af5e611489987ebc044dfe47261ae2 [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>
Sundar Iyer71f933f2011-01-21 10:56:18 +053011#include <linux/interrupt.h>
12#include <linux/mfd/tc3589x.h>
13#include <linux/input/matrix_keypad.h>
Sundar Iyer71f933f2011-01-21 10:56:18 +053014
Arnd Bergmanneba52748b2013-03-21 22:51:08 +010015#include "irqs.h"
Rabin Vincent705e0982011-01-21 10:56:16 +053016
17#include "board-mop500.h"
18
Arnd Bergmanne5a1f682013-03-21 22:51:10 +010019static struct i2c_board_info __initdata mop500_i2c3_devices_u8500[] = {
20 {
21 I2C_BOARD_INFO("synaptics_rmi4_i2c", 0x4B),
22 .irq = NOMADIK_GPIO_TO_IRQ(84),
23 },
Sundar Iyer71f933f2011-01-21 10:56:18 +053024};
25
26/*
27 * TC35893
28 */
29static const unsigned int u8500_keymap[] = {
30 KEY(3, 1, KEY_END),
31 KEY(4, 1, KEY_POWER),
32 KEY(6, 4, KEY_VOLUMEDOWN),
33 KEY(4, 2, KEY_EMAIL),
34 KEY(3, 3, KEY_RIGHT),
35 KEY(2, 5, KEY_BACKSPACE),
36
37 KEY(6, 7, KEY_MENU),
38 KEY(5, 0, KEY_ENTER),
39 KEY(4, 3, KEY_0),
40 KEY(3, 4, KEY_DOT),
41 KEY(5, 2, KEY_UP),
42 KEY(3, 5, KEY_DOWN),
43
44 KEY(4, 5, KEY_SEND),
45 KEY(0, 5, KEY_BACK),
46 KEY(6, 2, KEY_VOLUMEUP),
47 KEY(1, 3, KEY_SPACE),
48 KEY(7, 6, KEY_LEFT),
49 KEY(5, 5, KEY_SEARCH),
50};
51
52static struct matrix_keymap_data u8500_keymap_data = {
53 .keymap = u8500_keymap,
54 .keymap_size = ARRAY_SIZE(u8500_keymap),
55};
56
57static struct tc3589x_keypad_platform_data tc35893_data = {
58 .krow = TC_KPD_ROWS,
59 .kcol = TC_KPD_COLUMNS,
60 .debounce_period = TC_KPD_DEBOUNCE_PERIOD,
61 .settle_time = TC_KPD_SETTLE_TIME,
62 .irqtype = IRQF_TRIGGER_FALLING,
63 .enable_wakeup = true,
64 .keymap_data = &u8500_keymap_data,
65 .no_autorepeat = true,
66};
67
68static struct tc3589x_platform_data tc3589x_keypad_data = {
69 .block = TC3589x_BLOCK_KEYPAD,
70 .keypad = &tc35893_data,
71 .irq_base = MOP500_EGPIO_IRQ_BASE,
72};
73
74static struct i2c_board_info __initdata mop500_i2c0_devices_u8500[] = {
75 {
76 I2C_BOARD_INFO("tc3589x", 0x44),
77 .platform_data = &tc3589x_keypad_data,
78 .irq = NOMADIK_GPIO_TO_IRQ(218),
79 .flags = I2C_CLIENT_WAKE,
80 },
81};
82
83
Rabin Vincent705e0982011-01-21 10:56:16 +053084void __init mop500_u8500uib_init(void)
85{
Sundar Iyer71f933f2011-01-21 10:56:18 +053086 mop500_uib_i2c_add(3, mop500_i2c3_devices_u8500,
87 ARRAY_SIZE(mop500_i2c3_devices_u8500));
88
89 mop500_uib_i2c_add(0, mop500_i2c0_devices_u8500,
90 ARRAY_SIZE(mop500_i2c0_devices_u8500));
91
Rabin Vincent705e0982011-01-21 10:56:16 +053092}