1 --- a/arch/arm/mach-omap2/board-n8x0.c
2 +++ b/arch/arm/mach-omap2/board-n8x0.c
4 #include <linux/usb/musb.h>
5 #include <sound/tlv320aic3x.h>
6 #include <linux/spi/tsc2005.h>
7 +#include <linux/input.h>
8 +#include <linux/i2c/lm8323.h>
10 #include <asm/mach/arch.h>
11 #include <asm/mach-types.h>
13 #include <plat/onenand.h>
15 #include <plat/serial.h>
16 +#include <plat/gpio-switch.h>
20 @@ -104,6 +107,152 @@ extern struct mipid_platform_data n8x0_m
21 extern void n8x0_mipid_init(void);
22 extern void n8x0_blizzard_init(void);
24 +/* We map the FN key as LALT to workaround an X keycode problem.
25 + * The XKB map needs to be adjusted to support this. */
26 +#define MAP_FN_AS_LEFTALT
28 +static s16 rx44_keymap[LM8323_KEYMAP_SIZE] = {
33 + [0x05] = KEY_BACKSPACE,
45 + [0x14] = KEY_APOSTROPHE,
52 + [0x1c] = KEY_LEFTSHIFT, /* Actually, this is both shift keys */
56 + [0x22] = KEY_SEMICOLON,
59 +#ifdef MAP_FN_AS_LEFTALT
60 + [0x2b] = KEY_LEFTALT,
68 + [0x32] = KEY_RIGHTCTRL,
72 + [0x3c] = KEY_COMPOSE,
88 + [0x75] = KEY_KPENTER,
91 +static struct lm8323_platform_data lm8323_pdata = {
92 + .repeat = 0, /* Repeat is handled in userspace for now. */
93 + .keymap = rx44_keymap,
96 + .debounce_time = 12,
99 + .name = "Internal keyboard",
100 + .pwm_names[0] = "n810::keyboard",
101 + .pwm_names[1] = "n810::cover",
104 +#define OMAP_TAG_NOKIA_BT 0x4e01
106 +struct omap_bluetooth_config {
109 + u8 host_wakeup_gpio;
116 +static struct platform_device n8x0_bt_device = {
119 + .num_resources = 0,
122 +void __init n8x0_bt_init(void)
124 + const struct omap_bluetooth_config *bt_config;
126 + bt_config = (void *) omap_get_config(OMAP_TAG_NOKIA_BT,
127 + struct omap_bluetooth_config);
128 + n8x0_bt_device.dev.platform_data = (void *) bt_config;
129 + if (platform_device_register(&n8x0_bt_device) < 0)
133 +static struct omap_gpio_switch n8x0_gpio_switches[] __initdata = {
135 + .name = "headphone",
137 + .debounce_rising = 200,
138 + .debounce_falling = 200,
142 + .debounce_rising = 200,
143 + .debounce_falling = 200,
145 + .name = "cam_turn",
147 + .debounce_rising = 100,
148 + .debounce_falling = 100,
152 + .debounce_rising = 200,
153 + .debounce_falling = 200,
157 + .debounce_rising = 200,
158 + .debounce_falling = 200,
162 +static void __init n8x0_gpio_switches_init(void)
164 + /* The switches are actually registered through ATAG mechanism.
165 + * This just updates the parameters (thus .gpio is -1) */
166 + omap_register_gpio_switches(n8x0_gpio_switches,
167 + ARRAY_SIZE(n8x0_gpio_switches));
170 #define TUSB6010_ASYNC_CS 1
171 #define TUSB6010_SYNC_CS 4
172 #define TUSB6010_GPIO_INT 58
173 @@ -795,6 +944,11 @@ static struct aic3x_pdata n810_aic33_dat
176 static struct i2c_board_info n810_i2c_board_info_2[] __initdata = {
178 + I2C_BOARD_INFO("lm8323", 0x45),
179 + .irq = OMAP_GPIO_IRQ(109),
180 + .platform_data = &lm8323_pdata,
183 I2C_BOARD_INFO("tlv320aic3x", 0x18),
184 .platform_data = &n810_aic33_data,
185 @@ -864,7 +1018,9 @@ static inline void board_serial_init(voi
186 static void __init n8x0_init_machine(void)
188 omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAC);
189 + n8x0_gpio_switches_init();
193 /* FIXME: add n810 spi devices */
194 tsc2005_set_config();