2 * Copyright (C) ST-Ericsson SA 2010
4 * Board data for the U8500 UIB, also known as the New UIB
5 * License terms: GNU General Public License (GPL), version 2
8 #include <linux/kernel.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>
17 #include <mach/gpio.h>
18 #include <mach/irqs.h>
20 #include "board-mop500.h"
23 * Synaptics RMI4 touchscreen interface on the U8500 UIB
27 * Descriptor structure.
28 * Describes the number of i2c devices on the bus that speak RMI.
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
),
35 .regulator_en
= false,
38 static struct i2c_board_info __initdata mop500_i2c3_devices_u8500
[] = {
40 I2C_BOARD_INFO("synaptics_rmi4_i2c", 0x4B),
41 .platform_data
= &rmi4_i2c_dev_platformdata
,
48 static const unsigned int u8500_keymap
[] = {
51 KEY(6, 4, KEY_VOLUMEDOWN
),
54 KEY(2, 5, KEY_BACKSPACE
),
65 KEY(6, 2, KEY_VOLUMEUP
),
68 KEY(5, 5, KEY_SEARCH
),
71 static struct matrix_keymap_data u8500_keymap_data
= {
72 .keymap
= u8500_keymap
,
73 .keymap_size
= ARRAY_SIZE(u8500_keymap
),
76 static struct tc3589x_keypad_platform_data tc35893_data
= {
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,
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
,
93 static struct i2c_board_info __initdata mop500_i2c0_devices_u8500
[] = {
95 I2C_BOARD_INFO("tc3589x", 0x44),
96 .platform_data
= &tc3589x_keypad_data
,
97 .irq
= NOMADIK_GPIO_TO_IRQ(218),
98 .flags
= I2C_CLIENT_WAKE
,
103 void __init
mop500_u8500uib_init(void)
105 mop500_uib_i2c_add(3, mop500_i2c3_devices_u8500
,
106 ARRAY_SIZE(mop500_i2c3_devices_u8500
));
108 mop500_uib_i2c_add(0, mop500_i2c0_devices_u8500
,
109 ARRAY_SIZE(mop500_i2c0_devices_u8500
));