1 Index: linux-3.1-rc4/arch/arm/mach-omap2/board-n8x0.c
2 ===================================================================
3 --- linux-3.1-rc4.orig/arch/arm/mach-omap2/board-n8x0.c 2011-10-29 20:35:57.228845384 +0200
4 +++ linux-3.1-rc4/arch/arm/mach-omap2/board-n8x0.c 2011-10-29 20:35:58.476842416 +0200
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>
16 #include <plat/serial.h>
17 #include <plat/cbus.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 @@ -799,6 +948,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 @@ -868,7 +1022,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();
197 Index: linux-3.1-rc4/arch/arm/plat-omap/include/plat/cbus.h
198 ===================================================================
199 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
200 +++ linux-3.1-rc4/arch/arm/plat-omap/include/plat/cbus.h 2011-10-29 20:35:58.476842416 +0200
203 + * cbus.h - CBUS platform_data definition
205 + * Copyright (C) 2004 - 2009 Nokia Corporation
207 + * Written by Felipe Balbi <felipe.balbi@nokia.com>
209 + * This file is subject to the terms and conditions of the GNU General
210 + * Public License. See the file "COPYING" in the main directory of this
211 + * archive for more details.
213 + * This program is distributed in the hope that it will be useful,
214 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
215 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
216 + * GNU General Public License for more details.
218 + * You should have received a copy of the GNU General Public License
219 + * along with this program; if not, write to the Free Software
220 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
223 +#ifndef __PLAT_CBUS_H
224 +#define __PLAT_CBUS_H
226 +#define CBUS_RETU_DEVICE_ID 0x01
227 +#define CBUS_TAHVO_DEVICE_ID 0x02
229 +struct cbus_host_platform_data {
235 +struct cbus_retu_platform_data {
241 +#endif /* __PLAT_CBUS_H */