1 Index: linux-3.1/arch/arm/mach-omap2/board-n8x0.c
2 ===================================================================
3 --- linux-3.1.orig/arch/arm/mach-omap2/board-n8x0.c 2011-10-30 19:31:56.000000000 +0100
4 +++ linux-3.1/arch/arm/mach-omap2/board-n8x0.c 2011-10-30 19:32:22.288178756 +0100
6 #include <linux/usb/musb.h>
7 #include <sound/tlv320aic3x.h>
8 #include <linux/spi/tsc2005.h>
9 +#include <linux/input.h>
10 +#include <linux/i2c/lm8323.h>
12 #include <asm/mach/arch.h>
13 #include <asm/mach-types.h>
15 #include <plat/onenand.h>
17 #include <plat/serial.h>
18 +#include <plat/gpio-switch.h>
22 @@ -104,6 +107,152 @@ extern struct mipid_platform_data n8x0_m
23 extern void n8x0_mipid_init(void);
24 extern void n8x0_blizzard_init(void);
26 +/* We map the FN key as LALT to workaround an X keycode problem.
27 + * The XKB map needs to be adjusted to support this. */
28 +#define MAP_FN_AS_LEFTALT
30 +static s16 rx44_keymap[LM8323_KEYMAP_SIZE] = {
35 + [0x05] = KEY_BACKSPACE,
47 + [0x14] = KEY_APOSTROPHE,
54 + [0x1c] = KEY_LEFTSHIFT, /* Actually, this is both shift keys */
58 + [0x22] = KEY_SEMICOLON,
61 +#ifdef MAP_FN_AS_LEFTALT
62 + [0x2b] = KEY_LEFTALT,
70 + [0x32] = KEY_RIGHTCTRL,
74 + [0x3c] = KEY_COMPOSE,
90 + [0x75] = KEY_KPENTER,
93 +static struct lm8323_platform_data lm8323_pdata = {
94 + .repeat = 0, /* Repeat is handled in userspace for now. */
95 + .keymap = rx44_keymap,
98 + .debounce_time = 12,
101 + .name = "Internal keyboard",
102 + .pwm_names[0] = "n810::keyboard",
103 + .pwm_names[1] = "n810::cover",
106 +#define OMAP_TAG_NOKIA_BT 0x4e01
108 +struct omap_bluetooth_config {
111 + u8 host_wakeup_gpio;
118 +static struct platform_device n8x0_bt_device = {
121 + .num_resources = 0,
124 +void __init n8x0_bt_init(void)
126 + const struct omap_bluetooth_config *bt_config;
128 + bt_config = (void *) omap_get_config(OMAP_TAG_NOKIA_BT,
129 + struct omap_bluetooth_config);
130 + n8x0_bt_device.dev.platform_data = (void *) bt_config;
131 + if (platform_device_register(&n8x0_bt_device) < 0)
135 +static struct omap_gpio_switch n8x0_gpio_switches[] __initdata = {
137 + .name = "headphone",
139 + .debounce_rising = 200,
140 + .debounce_falling = 200,
144 + .debounce_rising = 200,
145 + .debounce_falling = 200,
147 + .name = "cam_turn",
149 + .debounce_rising = 100,
150 + .debounce_falling = 100,
154 + .debounce_rising = 200,
155 + .debounce_falling = 200,
159 + .debounce_rising = 200,
160 + .debounce_falling = 200,
164 +static void __init n8x0_gpio_switches_init(void)
166 + /* The switches are actually registered through ATAG mechanism.
167 + * This just updates the parameters (thus .gpio is -1) */
168 + omap_register_gpio_switches(n8x0_gpio_switches,
169 + ARRAY_SIZE(n8x0_gpio_switches));
172 #define TUSB6010_ASYNC_CS 1
173 #define TUSB6010_SYNC_CS 4
174 #define TUSB6010_GPIO_INT 58
175 @@ -795,6 +944,11 @@ static struct aic3x_pdata n810_aic33_dat
178 static struct i2c_board_info n810_i2c_board_info_2[] __initdata = {
180 + I2C_BOARD_INFO("lm8323", 0x45),
181 + .irq = OMAP_GPIO_IRQ(109),
182 + .platform_data = &lm8323_pdata,
185 I2C_BOARD_INFO("tlv320aic3x", 0x18),
186 .platform_data = &n810_aic33_data,
187 @@ -864,7 +1018,9 @@ static inline void board_serial_init(voi
188 static void __init n8x0_init_machine(void)
190 omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAC);
191 + n8x0_gpio_switches_init();
195 /* FIXME: add n810 spi devices */
196 tsc2005_set_config();