]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blob - arch/arm/mach-omap2/board-n800.c
use gpio_direction_output (OMAP tree only)
[linux-2.6-omap-h63xx.git] / arch / arm / mach-omap2 / board-n800.c
1 /*
2  * linux/arch/arm/mach-omap2/board-n800.c
3  *
4  * Copyright (C) 2005-2007 Nokia Corporation
5  * Author: Juha Yrjola <juha.yrjola@nokia.com>
6  *
7  * Modified from mach-omap2/board-generic.c
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License version 2 as
11  * published by the Free Software Foundation.
12  */
13
14 #include <linux/kernel.h>
15 #include <linux/init.h>
16 #include <linux/clk.h>
17 #include <linux/device.h>
18 #include <linux/platform_device.h>
19 #include <linux/spi/spi.h>
20 #include <linux/spi/tsc2301.h>
21 #include <linux/spi/tsc2005.h>
22 #include <linux/input.h>
23 #include <linux/delay.h>
24 #include <linux/interrupt.h>
25 #include <linux/irq.h>
26 #include <linux/i2c.h>
27 #include <linux/i2c/lm8323.h>
28 #include <linux/i2c/menelaus.h>
29 #include <mach/hardware.h>
30 #include <asm/mach-types.h>
31 #include <asm/mach/arch.h>
32 #include <asm/mach/map.h>
33 #include <mach/gpio.h>
34 #include <mach/usb.h>
35 #include <mach/board.h>
36 #include <mach/common.h>
37 #include <mach/mcspi.h>
38 #include <mach/lcd_mipid.h>
39 #include <mach/clock.h>
40 #include <mach/gpio-switch.h>
41 #include <mach/omapfb.h>
42 #include <mach/blizzard.h>
43
44 #include <../drivers/cbus/tahvo.h>
45 #include <../drivers/media/video/tcm825x.h>
46
47 #define N800_BLIZZARD_POWERDOWN_GPIO    15
48 #define N800_STI_GPIO                   62
49 #define N800_KEYB_IRQ_GPIO              109
50 #define N800_DAV_IRQ_GPIO               103
51 #define N800_TSC2301_RESET_GPIO         118
52
53 #ifdef CONFIG_MACH_NOKIA_N810
54 static s16 rx44_keymap[LM8323_KEYMAP_SIZE] = {
55         [0x01] = KEY_Q,
56         [0x02] = KEY_K,
57         [0x03] = KEY_O,
58         [0x04] = KEY_P,
59         [0x05] = KEY_BACKSPACE,
60         [0x06] = KEY_A,
61         [0x07] = KEY_S,
62         [0x08] = KEY_D,
63         [0x09] = KEY_F,
64         [0x0a] = KEY_G,
65         [0x0b] = KEY_H,
66         [0x0c] = KEY_J,
67
68         [0x11] = KEY_W,
69         [0x12] = KEY_F4,
70         [0x13] = KEY_L,
71         [0x14] = KEY_APOSTROPHE,
72         [0x16] = KEY_Z,
73         [0x17] = KEY_X,
74         [0x18] = KEY_C,
75         [0x19] = KEY_V,
76         [0x1a] = KEY_B,
77         [0x1b] = KEY_N,
78         [0x1c] = KEY_LEFTSHIFT, /* Actually, this is both shift keys */
79         [0x1f] = KEY_F7,
80
81         [0x21] = KEY_E,
82         [0x22] = KEY_SEMICOLON,
83         [0x23] = KEY_MINUS,
84         [0x24] = KEY_EQUAL,
85         [0x2b] = KEY_FN,
86         [0x2c] = KEY_M,
87         [0x2f] = KEY_F8,
88
89         [0x31] = KEY_R,
90         [0x32] = KEY_RIGHTCTRL,
91         [0x34] = KEY_SPACE,
92         [0x35] = KEY_COMMA,
93         [0x37] = KEY_UP,
94         [0x3c] = KEY_COMPOSE,
95         [0x3f] = KEY_F6,
96
97         [0x41] = KEY_T,
98         [0x44] = KEY_DOT,
99         [0x46] = KEY_RIGHT,
100         [0x4f] = KEY_F5,
101         [0x51] = KEY_Y,
102         [0x53] = KEY_DOWN,
103         [0x55] = KEY_ENTER,
104         [0x5f] = KEY_ESC,
105
106         [0x61] = KEY_U,
107         [0x64] = KEY_LEFT,
108
109         [0x71] = KEY_I,
110         [0x75] = KEY_KPENTER,
111 };
112
113 static struct lm8323_platform_data lm8323_pdata = {
114         .repeat = 0, /* Repeat is handled in userspace for now. */
115         .keymap = rx44_keymap,
116
117         .name = "Internal keyboard",
118         .pwm1_name = "keyboard",
119         .pwm2_name = "cover",
120 };
121 #endif
122
123 void __init nokia_n800_init_irq(void)
124 {
125         omap2_init_common_hw(NULL);
126         omap_init_irq();
127         omap_gpio_init();
128
129 #ifdef CONFIG_OMAP_STI
130         if (omap_request_gpio(N800_STI_GPIO) < 0) {
131                 printk(KERN_ERR "Failed to request GPIO %d for STI\n",
132                        N800_STI_GPIO);
133                 return;
134         }
135
136         gpio_direction_output(N800_STI_GPIO, 0);
137 #endif
138 }
139
140 #if defined(CONFIG_MENELAUS) && defined(CONFIG_SENSORS_TMP105)
141
142 static int n800_tmp105_set_power(int enable)
143 {
144         return menelaus_set_vaux(enable ? 2800 : 0);
145 }
146
147 #else
148
149 #define n800_tmp105_set_power NULL
150
151 #endif
152
153 static struct omap_uart_config n800_uart_config __initdata = {
154         .enabled_uarts = (1 << 0) | (1 << 2),
155 };
156
157 #include "../../../drivers/cbus/retu.h"
158
159 static struct omap_fbmem_config n800_fbmem0_config __initdata = {
160         .size = 752 * 1024,
161 };
162
163 static struct omap_fbmem_config n800_fbmem1_config __initdata = {
164         .size = 752 * 1024,
165 };
166
167 static struct omap_fbmem_config n800_fbmem2_config __initdata = {
168         .size = 752 * 1024,
169 };
170
171 static struct omap_tmp105_config n800_tmp105_config __initdata = {
172         .tmp105_irq_pin = 125,
173         .set_power = n800_tmp105_set_power,
174 };
175
176 static void mipid_shutdown(struct mipid_platform_data *pdata)
177 {
178         if (pdata->nreset_gpio != -1) {
179                 pr_info("shutdown LCD\n");
180                 gpio_set_value(pdata->nreset_gpio, 0);
181                 msleep(120);
182         }
183 }
184
185 static struct mipid_platform_data n800_mipid_platform_data = {
186         .shutdown = mipid_shutdown,
187 };
188
189 static void __init mipid_dev_init(void)
190 {
191         const struct omap_lcd_config *conf;
192
193         conf = omap_get_config(OMAP_TAG_LCD, struct omap_lcd_config);
194         if (conf != NULL) {
195                 n800_mipid_platform_data.nreset_gpio = conf->nreset_gpio;
196                 n800_mipid_platform_data.data_lines = conf->data_lines;
197         }
198 }
199
200 static struct {
201         struct clk *sys_ck;
202 } blizzard;
203
204 static int blizzard_get_clocks(void)
205 {
206         blizzard.sys_ck = clk_get(0, "osc_ck");
207         if (IS_ERR(blizzard.sys_ck)) {
208                 printk(KERN_ERR "can't get Blizzard clock\n");
209                 return PTR_ERR(blizzard.sys_ck);
210         }
211         return 0;
212 }
213
214 static unsigned long blizzard_get_clock_rate(struct device *dev)
215 {
216         return clk_get_rate(blizzard.sys_ck);
217 }
218
219 static void blizzard_enable_clocks(int enable)
220 {
221         if (enable)
222                 clk_enable(blizzard.sys_ck);
223         else
224                 clk_disable(blizzard.sys_ck);
225 }
226
227 static void blizzard_power_up(struct device *dev)
228 {
229         /* Vcore to 1.475V */
230         tahvo_set_clear_reg_bits(0x07, 0, 0xf);
231         msleep(10);
232
233         blizzard_enable_clocks(1);
234         gpio_set_value(N800_BLIZZARD_POWERDOWN_GPIO, 1);
235 }
236
237 static void blizzard_power_down(struct device *dev)
238 {
239         gpio_set_value(N800_BLIZZARD_POWERDOWN_GPIO, 0);
240         blizzard_enable_clocks(0);
241
242         /* Vcore to 1.005V */
243         tahvo_set_clear_reg_bits(0x07, 0xf, 0);
244 }
245
246 static struct blizzard_platform_data n800_blizzard_data = {
247         .power_up       = blizzard_power_up,
248         .power_down     = blizzard_power_down,
249         .get_clock_rate = blizzard_get_clock_rate,
250         .te_connected   = 1,
251 };
252
253 static void __init blizzard_dev_init(void)
254 {
255         int r;
256
257         r = omap_request_gpio(N800_BLIZZARD_POWERDOWN_GPIO);
258         if (r < 0)
259                 return;
260         gpio_direction_output(N800_BLIZZARD_POWERDOWN_GPIO, 1);
261
262         blizzard_get_clocks();
263         omapfb_set_ctrl_platform_data(&n800_blizzard_data);
264 }
265
266 static struct omap_board_config_kernel n800_config[] __initdata = {
267         { OMAP_TAG_UART,                        &n800_uart_config },
268         { OMAP_TAG_FBMEM,                       &n800_fbmem0_config },
269         { OMAP_TAG_FBMEM,                       &n800_fbmem1_config },
270         { OMAP_TAG_FBMEM,                       &n800_fbmem2_config },
271         { OMAP_TAG_TMP105,                      &n800_tmp105_config },
272 };
273
274 static struct tsc2301_platform_data tsc2301_config = {
275         .reset_gpio     = N800_TSC2301_RESET_GPIO,
276         .keymap = {
277                 -1,             /* Event for bit 0 */
278                 KEY_UP,         /* Event for bit 1 (up) */
279                 KEY_F5,         /* Event for bit 2 (home) */
280                 -1,             /* Event for bit 3 */
281                 KEY_LEFT,       /* Event for bit 4 (left) */
282                 KEY_ENTER,      /* Event for bit 5 (enter) */
283                 KEY_RIGHT,      /* Event for bit 6 (right) */
284                 -1,             /* Event for bit 7 */
285                 KEY_ESC,        /* Event for bit 8 (cycle) */
286                 KEY_DOWN,       /* Event for bit 9 (down) */
287                 KEY_F4,         /* Event for bit 10 (menu) */
288                 -1,             /* Event for bit 11 */
289                 KEY_F8,         /* Event for bit 12 (Zoom-) */
290                 KEY_F6,         /* Event for bit 13 (FS) */
291                 KEY_F7,         /* Event for bit 14 (Zoom+) */
292                 -1,             /* Event for bit 15 */
293         },
294         .kp_rep         = 0,
295         .keyb_name      = "Internal keypad",
296 };
297
298 static void tsc2301_dev_init(void)
299 {
300         int r;
301         int gpio = N800_KEYB_IRQ_GPIO;
302
303         r = gpio_request(gpio, "tsc2301 KBD IRQ");
304         if (r >= 0) {
305                 gpio_direction_input(gpio);
306                 tsc2301_config.keyb_int = OMAP_GPIO_IRQ(gpio);
307         } else {
308                 printk(KERN_ERR "unable to get KBD GPIO");
309         }
310
311         gpio = N800_DAV_IRQ_GPIO;
312         r = gpio_request(gpio, "tsc2301 DAV IRQ");
313         if (r >= 0) {
314                 gpio_direction_input(gpio);
315                 tsc2301_config.dav_int = OMAP_GPIO_IRQ(gpio);
316         } else {
317                 printk(KERN_ERR "unable to get DAV GPIO");
318         }
319 }
320
321 static int __init tea5761_dev_init(void)
322 {
323         const struct omap_tea5761_config *info;
324         int enable_gpio = 0;
325
326         info = omap_get_config(OMAP_TAG_TEA5761, struct omap_tea5761_config);
327         if (info)
328                 enable_gpio = info->enable_gpio;
329
330         if (enable_gpio) {
331                 pr_debug("Enabling tea5761 at GPIO %d\n",
332                          enable_gpio);
333
334                 if (omap_request_gpio(enable_gpio) < 0) {
335                         printk(KERN_ERR "Can't request GPIO %d\n",
336                                enable_gpio);
337                         return -ENODEV;
338                 }
339
340                 gpio_direction_output(enable_gpio, 0);
341                 udelay(50);
342                 gpio_set_value(enable_gpio, 1);
343         }
344
345         return 0;
346 }
347
348 static struct omap2_mcspi_device_config tsc2301_mcspi_config = {
349         .turbo_mode     = 0,
350         .single_channel = 1,
351 };
352
353 static struct omap2_mcspi_device_config mipid_mcspi_config = {
354         .turbo_mode     = 0,
355         .single_channel = 1,
356 };
357
358 static struct omap2_mcspi_device_config cx3110x_mcspi_config = {
359         .turbo_mode     = 0,
360         .single_channel = 1,
361 };
362
363 #ifdef CONFIG_TOUCHSCREEN_TSC2005
364 static struct tsc2005_platform_data tsc2005_config = {
365         .reset_gpio = 94,
366         .dav_gpio = 106
367 };
368
369 static struct omap2_mcspi_device_config tsc2005_mcspi_config = {
370         .turbo_mode     = 0,
371         .single_channel = 1,
372 };
373 #endif
374
375 static struct spi_board_info n800_spi_board_info[] __initdata = {
376         {
377                 .modalias       = "lcd_mipid",
378                 .bus_num        = 1,
379                 .chip_select    = 1,
380                 .max_speed_hz   = 4000000,
381                 .controller_data= &mipid_mcspi_config,
382                 .platform_data  = &n800_mipid_platform_data,
383         }, {
384                 .modalias       = "cx3110x",
385                 .bus_num        = 2,
386                 .chip_select    = 0,
387                 .max_speed_hz   = 48000000,
388                 .controller_data= &cx3110x_mcspi_config,
389         },
390         {
391                 .modalias       = "tsc2301",
392                 .bus_num        = 1,
393                 .chip_select    = 0,
394                 .max_speed_hz   = 6000000,
395                 .controller_data= &tsc2301_mcspi_config,
396                 .platform_data  = &tsc2301_config,
397         },
398 };
399
400 static struct spi_board_info n810_spi_board_info[] __initdata = {
401         {
402                 .modalias        = "lcd_mipid",
403                 .bus_num         = 1,
404                 .chip_select     = 1,
405                 .max_speed_hz    = 4000000,
406                 .controller_data = &mipid_mcspi_config,
407                 .platform_data   = &n800_mipid_platform_data,
408         },
409         {
410                 .modalias        = "cx3110x",
411                 .bus_num         = 2,
412                 .chip_select     = 0,
413                 .max_speed_hz    = 48000000,
414                 .controller_data = &cx3110x_mcspi_config,
415         },
416         {
417                 .modalias        = "tsc2005",
418                 .bus_num         = 1,
419                 .chip_select     = 0,
420                 .max_speed_hz    = 6000000,
421                 .controller_data = &tsc2005_mcspi_config,
422                 .platform_data   = &tsc2005_config,
423         },
424 };
425
426 static void __init tsc2005_set_config(void)
427 {
428         const struct omap_lcd_config *conf;
429
430         conf = omap_get_config(OMAP_TAG_LCD, struct omap_lcd_config);
431         if (conf != NULL) {
432 #ifdef CONFIG_TOUCHSCREEN_TSC2005
433                 if (strcmp(conf->panel_name, "lph8923") == 0) {
434                         tsc2005_config.ts_x_plate_ohm = 180;
435                         tsc2005_config.ts_hw_avg = 0;
436                         tsc2005_config.ts_ignore_last = 0;
437                         tsc2005_config.ts_touch_pressure = 1500;
438                         tsc2005_config.ts_stab_time = 100;
439                         tsc2005_config.ts_pressure_max = 2048;
440                         tsc2005_config.ts_pressure_fudge = 2;
441                         tsc2005_config.ts_x_max = 4096;
442                         tsc2005_config.ts_x_fudge = 4;
443                         tsc2005_config.ts_y_max = 4096;
444                         tsc2005_config.ts_y_fudge = 7;
445                 } else if (strcmp(conf->panel_name, "ls041y3") == 0) {
446                         tsc2005_config.ts_x_plate_ohm = 280;
447                         tsc2005_config.ts_hw_avg = 0;
448                         tsc2005_config.ts_ignore_last = 0;
449                         tsc2005_config.ts_touch_pressure = 1500;
450                         tsc2005_config.ts_stab_time = 1000;
451                         tsc2005_config.ts_pressure_max = 2048;
452                         tsc2005_config.ts_pressure_fudge = 2;
453                         tsc2005_config.ts_x_max = 4096;
454                         tsc2005_config.ts_x_fudge = 4;
455                         tsc2005_config.ts_y_max = 4096;
456                         tsc2005_config.ts_y_fudge = 7;
457                 } else {
458                         printk(KERN_ERR "Unknown panel type, set default "
459                                "touchscreen configuration\n");
460                         tsc2005_config.ts_x_plate_ohm = 200;
461                         tsc2005_config.ts_stab_time = 100;
462                 }
463 #endif
464         }
465 }
466
467 #if defined(CONFIG_CBUS_RETU) && defined(CONFIG_LEDS_OMAP_PWM)
468
469 void retu_keypad_led_set_power(struct omap_pwm_led_platform_data *self,
470                                int on_off)
471 {
472         if (on_off) {
473                 retu_write_reg(RETU_REG_CTRL_SET, 1 << 6);
474                 msleep(2);
475                 retu_write_reg(RETU_REG_CTRL_SET, 1 << 3);
476         } else {
477                 retu_write_reg(RETU_REG_CTRL_CLR, (1 << 6) | (1 << 3));
478         }
479 }
480
481 static struct omap_pwm_led_platform_data n800_keypad_led_data = {
482         .name = "keypad",
483         .intensity_timer = 10,
484         .blink_timer = 9,
485         .set_power = retu_keypad_led_set_power,
486 };
487
488 static struct platform_device n800_keypad_led_device = {
489         .name           = "omap_pwm_led",
490         .id             = -1,
491         .dev            = {
492                 .platform_data = &n800_keypad_led_data,
493         },
494 };
495 #endif
496
497 #if defined(CONFIG_TOUCHSCREEN_TSC2301)
498 static void __init n800_ts_set_config(void)
499 {
500         const struct omap_lcd_config *conf;
501
502         conf = omap_get_config(OMAP_TAG_LCD, struct omap_lcd_config);
503         if (conf != NULL) {
504                 if (strcmp(conf->panel_name, "lph8923") == 0) {
505                         tsc2301_config.ts_x_plate_ohm   = 180;
506                         tsc2301_config.ts_hw_avg        = 8;
507                         tsc2301_config.ts_max_pressure  = 2048;
508                         tsc2301_config.ts_touch_pressure = 400;
509                         tsc2301_config.ts_stab_time     = 100;
510                         tsc2301_config.ts_pressure_fudge = 2;
511                         tsc2301_config.ts_x_max         = 4096;
512                         tsc2301_config.ts_x_fudge       = 4;
513                         tsc2301_config.ts_y_max         = 4096;
514                         tsc2301_config.ts_y_fudge       = 7;
515                 } else if (strcmp(conf->panel_name, "ls041y3") == 0) {
516                         tsc2301_config.ts_x_plate_ohm   = 280;
517                         tsc2301_config.ts_hw_avg        = 8;
518                         tsc2301_config.ts_touch_pressure = 400;
519                         tsc2301_config.ts_max_pressure  = 2048;
520                         tsc2301_config.ts_stab_time     = 1000;
521                         tsc2301_config.ts_pressure_fudge = 2;
522                         tsc2301_config.ts_x_max         = 4096;
523                         tsc2301_config.ts_x_fudge       = 4;
524                         tsc2301_config.ts_y_max         = 4096;
525                         tsc2301_config.ts_y_fudge       = 7;
526                 } else {
527                         printk(KERN_ERR "Unknown panel type, set default "
528                                "touchscreen configuration\n");
529                         tsc2301_config.ts_x_plate_ohm   = 200;
530                         tsc2301_config.ts_stab_time     = 100;
531                 }
532         }
533 }
534 #else
535 static inline void n800_ts_set_config(void)
536 {
537 }
538 #endif
539
540 static struct omap_gpio_switch n800_gpio_switches[] __initdata = {
541         {
542                 .name                   = "bat_cover",
543                 .gpio                   = -1,
544                 .debounce_rising        = 100,
545                 .debounce_falling       = 0,
546                 .notify                 = n800_mmc_slot1_cover_handler,
547                 .notify_data            = NULL,
548         }, {
549                 .name                   = "headphone",
550                 .gpio                   = -1,
551                 .debounce_rising        = 200,
552                 .debounce_falling       = 200,
553         }, {
554                 .name                   = "cam_act",
555                 .gpio                   = -1,
556                 .debounce_rising        = 200,
557                 .debounce_falling       = 200,
558         }, {
559                 .name                   = "cam_turn",
560                 .gpio                   = -1,
561                 .debounce_rising        = 100,
562                 .debounce_falling       = 100,
563         },
564 };
565
566 static struct platform_device *n800_devices[] __initdata = {
567 #if defined(CONFIG_CBUS_RETU) && defined(CONFIG_LEDS_OMAP_PWM)
568         &n800_keypad_led_device,
569 #endif
570 };
571
572 #ifdef CONFIG_MENELAUS
573 static int n800_auto_sleep_regulators(void)
574 {
575         u32 val;
576         int ret;
577
578         val = EN_VPLL_SLEEP | EN_VMMC_SLEEP    \
579                 | EN_VAUX_SLEEP | EN_VIO_SLEEP \
580                 | EN_VMEM_SLEEP | EN_DC3_SLEEP \
581                 | EN_VC_SLEEP | EN_DC2_SLEEP;
582
583         ret = menelaus_set_regulator_sleep(1, val);
584         if (ret < 0) {
585                 printk(KERN_ERR "Could not set regulators to sleep on "
586                         "menelaus: %u\n", ret);
587                 return ret;
588         }
589         return 0;
590 }
591
592 static int n800_auto_voltage_scale(void)
593 {
594         int ret;
595
596         ret = menelaus_set_vcore_hw(1400, 1050);
597         if (ret < 0) {
598                 printk(KERN_ERR "Could not set VCORE voltage on "
599                         "menelaus: %u\n", ret);
600                 return ret;
601         }
602         return 0;
603 }
604
605 static int n800_menelaus_init(struct device *dev)
606 {
607         int ret;
608
609         ret = n800_auto_voltage_scale();
610         if (ret < 0)
611                 return ret;
612         ret = n800_auto_sleep_regulators();
613         if (ret < 0)
614                 return ret;
615         return 0;
616 }
617
618 static struct menelaus_platform_data n800_menelaus_platform_data = {
619         .late_init = n800_menelaus_init,
620 };
621 #endif
622
623 static struct i2c_board_info __initdata n800_i2c_board_info_1[] = {
624         {
625                 I2C_BOARD_INFO("menelaus", 0x72),
626                 .irq = INT_24XX_SYS_NIRQ,
627                 .platform_data = &n800_menelaus_platform_data,
628         },
629 };
630
631 extern struct tcm825x_platform_data n800_tcm825x_platform_data;
632
633 static struct i2c_board_info __initdata_or_module n8x0_i2c_board_info_2[] = {
634         {
635                 I2C_BOARD_INFO(TCM825X_NAME, TCM825X_I2C_ADDR),
636 #if defined (CONFIG_VIDEO_TCM825X) || defined (CONFIG_VIDEO_TCM825X_MODULE)
637                 .platform_data = &n800_tcm825x_platform_data,
638 #endif
639         },
640 };
641
642
643 static struct i2c_board_info __initdata_or_module n800_i2c_board_info_2[] = {
644         {
645                 I2C_BOARD_INFO("tea5761", 0x10),
646         },
647 };
648
649 static struct i2c_board_info __initdata_or_module n810_i2c_board_info_2[] = {
650         {
651                 I2C_BOARD_INFO("lm8323", 0x45),
652                 .irq            = OMAP_GPIO_IRQ(109),
653                 .platform_data  = &lm8323_pdata,
654         },
655         {
656                 I2C_BOARD_INFO("tsl2563", 0x29),
657         },
658         {
659                 I2C_BOARD_INFO("lp5521", 0x32),
660         },
661 };
662
663 void __init nokia_n800_common_init(void)
664 {
665         platform_add_devices(n800_devices, ARRAY_SIZE(n800_devices));
666
667         n800_flash_init();
668         n800_mmc_init();
669         n800_bt_init();
670         n800_dsp_init();
671         n800_usb_init();
672         n800_cam_init();
673         if (machine_is_nokia_n800())
674                 spi_register_board_info(n800_spi_board_info,
675                                 ARRAY_SIZE(n800_spi_board_info));
676         if (machine_is_nokia_n810()) {
677                 tsc2005_set_config();
678                 spi_register_board_info(n810_spi_board_info,
679                                 ARRAY_SIZE(n810_spi_board_info));
680         }
681         omap_serial_init();
682         omap_register_i2c_bus(1, 400, n800_i2c_board_info_1,
683                               ARRAY_SIZE(n800_i2c_board_info_1));
684         omap_register_i2c_bus(2, 400, n8x0_i2c_board_info_2,
685                               ARRAY_SIZE(n8x0_i2c_board_info_2));
686         if (machine_is_nokia_n800())
687                 i2c_register_board_info(2, n800_i2c_board_info_2,
688                         ARRAY_SIZE(n800_i2c_board_info_2));
689         if (machine_is_nokia_n810())
690                 i2c_register_board_info(2, n810_i2c_board_info_2,
691                         ARRAY_SIZE(n810_i2c_board_info_2));
692                 
693         mipid_dev_init();
694         blizzard_dev_init();
695 }
696
697 static void __init nokia_n800_init(void)
698 {
699         nokia_n800_common_init();
700
701         n800_audio_init(&tsc2301_config);
702         n800_ts_set_config();
703         tsc2301_dev_init();
704         tea5761_dev_init();
705         omap_register_gpio_switches(n800_gpio_switches,
706                                     ARRAY_SIZE(n800_gpio_switches));
707 }
708
709 void __init nokia_n800_map_io(void)
710 {
711         omap_board_config = n800_config;
712         omap_board_config_size = ARRAY_SIZE(n800_config);
713
714         omap2_set_globals_242x();
715         omap2_map_common_io();
716 }
717
718 MACHINE_START(NOKIA_N800, "Nokia N800")
719         .phys_io        = 0x48000000,
720         .io_pg_offst    = ((0xd8000000) >> 18) & 0xfffc,
721         .boot_params    = 0x80000100,
722         .map_io         = nokia_n800_map_io,
723         .init_irq       = nokia_n800_init_irq,
724         .init_machine   = nokia_n800_init,
725         .timer          = &omap_timer,
726 MACHINE_END