2 arch/arm/mach-omap1/board-nokia770.c | 16 +
3 arch/arm/mach-omap2/Kconfig | 10 +
4 arch/arm/mach-omap2/Makefile | 2
5 arch/arm/mach-omap2/board-n8x0-lcd.c | 127 +++++++++++++
6 arch/arm/mach-omap2/board-n8x0-usb.c | 175 +++++++++++++++++++
7 arch/arm/mach-omap2/board-n8x0.c | 318 +++++++++++++++++++++++++----------
8 arch/arm/mach-omap2/control.c | 2
9 arch/arm/mach-omap2/serial.c | 8
10 8 files changed, 571 insertions(+), 87 deletions(-)
12 --- linux-2.6.36-rc4.orig/arch/arm/mach-omap1/board-nokia770.c
13 +++ linux-2.6.36-rc4/arch/arm/mach-omap1/board-nokia770.c
15 #include <plat/lcd_mipid.h>
17 #include <plat/clock.h>
18 +#include <plat/cbus.h>
20 #define ADS7846_PENDOWN_GPIO 15
22 @@ -95,8 +96,23 @@ static struct platform_device nokia770_k
23 .resource = nokia770_kp_resources,
26 +static struct cbus_host_platform_data nokia770_cbus_data = {
27 + .clk_gpio = OMAP_MPUIO(11),
28 + .dat_gpio = OMAP_MPUIO(10),
29 + .sel_gpio = OMAP_MPUIO(9),
32 +static struct platform_device nokia770_cbus_device = {
36 + .platform_data = &nokia770_cbus_data,
40 static struct platform_device *nokia770_devices[] __initdata = {
42 + &nokia770_cbus_device,
45 static void mipid_shutdown(struct mipid_platform_data *pdata)
46 --- linux-2.6.36-rc4.orig/arch/arm/mach-omap2/board-n8x0.c
47 +++ linux-2.6.36-rc4/arch/arm/mach-omap2/board-n8x0.c
50 #include <linux/stddef.h>
51 #include <linux/i2c.h>
52 +#include <linux/platform_device.h>
53 #include <linux/spi/spi.h>
54 +#include <linux/spi/tsc2005.h>
55 +#include <linux/input.h>
56 #include <linux/usb/musb.h>
57 +#include <linux/i2c/lm8323.h>
59 #include <asm/mach/arch.h>
60 #include <asm/mach-types.h>
62 #include <plat/onenand.h>
64 #include <plat/serial.h>
65 +#include <plat/cbus.h>
69 @@ -39,109 +44,154 @@ static int slot1_cover_open;
70 static int slot2_cover_open;
71 static struct device *mmc_device;
73 -#define TUSB6010_ASYNC_CS 1
74 -#define TUSB6010_SYNC_CS 4
75 -#define TUSB6010_GPIO_INT 58
76 -#define TUSB6010_GPIO_ENABLE 0
77 -#define TUSB6010_DMACHAN 0x3f
78 +#define RX51_TSC2005_RESET_GPIO 94
79 +#define RX51_TSC2005_IRQ_GPIO 106
80 +#define OMAP_TAG_NOKIA_BT 0x4e01
82 +static s16 rx44_keymap[LM8323_KEYMAP_SIZE] = {
87 + [0x05] = KEY_BACKSPACE,
99 + [0x14] = KEY_APOSTROPHE,
106 + [0x1c] = KEY_LEFTSHIFT, /* Actually, this is both shift keys */
110 + [0x22] = KEY_SEMICOLON,
111 + [0x23] = KEY_MINUS,
112 + [0x24] = KEY_EQUAL,
118 + [0x32] = KEY_RIGHTCTRL,
119 + [0x34] = KEY_SPACE,
120 + [0x35] = KEY_COMMA,
122 + [0x3c] = KEY_COMPOSE,
127 + [0x46] = KEY_RIGHT,
131 + [0x55] = KEY_ENTER,
134 -#if defined(CONFIG_USB_TUSB6010) || \
135 - defined(CONFIG_USB_TUSB6010_MODULE)
137 - * Enable or disable power to TUSB6010. When enabling, turn on 3.3 V and
138 - * 1.5 V voltage regulators of PM companion chip. Companion chip will then
139 - * provide then PGOOD signal to TUSB6010 which will release it from reset.
141 -static int tusb_set_power(int state)
146 - gpio_set_value(TUSB6010_GPIO_ENABLE, 1);
151 - /* Wait until TUSB6010 pulls INT pin down */
153 - while (i && gpio_get_value(TUSB6010_GPIO_INT)) {
159 - printk(KERN_ERR "tusb: powerup failed\n");
163 - gpio_set_value(TUSB6010_GPIO_ENABLE, 0);
167 + [0x75] = KEY_KPENTER,
172 +static struct lm8323_platform_data lm8323_pdata = {
173 + .repeat = 0, /* Repeat is handled in userspace for now. */
174 + .keymap = rx44_keymap,
177 + .debounce_time = 12,
178 + .active_time = 500,
180 + .name = "Internal keyboard",
181 + .pwm_names[0] = "n810::keyboard",
182 + .pwm_names[1] = "n810::cover",
183 + //.pwm1_name = "n810::keyboard",
184 + //.pwm2_name = "n810::cover",
187 -static struct musb_hdrc_config musb_config = {
192 +struct omap_bluetooth_config {
195 + u8 host_wakeup_gpio;
202 -static struct musb_hdrc_platform_data tusb_data = {
203 -#if defined(CONFIG_USB_MUSB_OTG)
205 -#elif defined(CONFIG_USB_MUSB_PERIPHERAL)
206 - .mode = MUSB_PERIPHERAL,
207 -#else /* defined(CONFIG_USB_MUSB_HOST) */
210 - .set_power = tusb_set_power,
211 - .min_power = 25, /* x2 = 50 mA drawn from VBUS as peripheral */
212 - .power = 100, /* Max 100 mA VBUS for host mode */
213 - .config = &musb_config,
216 -static void __init n8x0_usb_init(void)
219 - static char announce[] __initdata = KERN_INFO "TUSB 6010\n";
221 - /* PM companion chip power control pin */
222 - ret = gpio_request(TUSB6010_GPIO_ENABLE, "TUSB6010 enable");
224 - printk(KERN_ERR "Could not get TUSB power GPIO%i\n",
225 - TUSB6010_GPIO_ENABLE);
228 - gpio_direction_output(TUSB6010_GPIO_ENABLE, 0);
229 +static struct platform_device n8x0_bt_device = {
232 + .num_resources = 0,
236 +void __init n8x0_bt_init(void)
238 + const struct omap_bluetooth_config *bt_config;
240 - ret = tusb6010_setup_interface(&tusb_data, TUSB6010_REFCLK_19, 2,
241 - TUSB6010_ASYNC_CS, TUSB6010_SYNC_CS,
242 - TUSB6010_GPIO_INT, TUSB6010_DMACHAN);
245 + bt_config = (void *) omap_get_config(OMAP_TAG_NOKIA_BT,
246 + struct omap_bluetooth_config);
247 + n8x0_bt_device.dev.platform_data = (void *) bt_config;
248 + if (platform_device_register(&n8x0_bt_device) < 0)
253 +static struct omap2_mcspi_device_config mipid_mcspi_config = {
255 + .single_channel = 1,
259 +static int slot1_cover_open;
260 +static int slot2_cover_open;
261 +static struct device *mmc_device;
264 - gpio_free(TUSB6010_GPIO_ENABLE);
268 -static void __init n8x0_usb_init(void) {}
269 +static struct omap2_mcspi_device_config p54spi_mcspi_config = {
271 + .single_channel = 1,
274 -#endif /*CONFIG_USB_TUSB6010 */
275 +#ifdef CONFIG_MACH_NOKIA_N8X0_LCD
276 +extern struct mipid_platform_data n8x0_mipid_platform_data;
279 +#ifdef CONFIG_TOUCHSCREEN_TSC2005
280 +static struct tsc2005_platform_data tsc2005_config;
281 +static void rx51_tsc2005_set_reset(bool enable)
283 + gpio_set_value(RX51_TSC2005_RESET_GPIO, enable);
286 -static struct omap2_mcspi_device_config p54spi_mcspi_config = {
287 +static struct omap2_mcspi_device_config tsc2005_mcspi_config = {
293 static struct spi_board_info n800_spi_board_info[] __initdata = {
294 +#ifdef CONFIG_MACH_NOKIA_N8X0_LCD
296 + .modalias = "lcd_mipid",
299 + .max_speed_hz = 4000000,
300 + .controller_data= &mipid_mcspi_config,
301 + .platform_data = &n8x0_mipid_platform_data,
305 .modalias = "p54spi",
307 @@ -149,6 +199,68 @@ static struct spi_board_info n800_spi_bo
308 .max_speed_hz = 48000000,
309 .controller_data = &p54spi_mcspi_config,
312 + .modalias = "tsc2005",
315 + .irq = OMAP_GPIO_IRQ(RX51_TSC2005_IRQ_GPIO),
316 + .max_speed_hz = 6000000,
317 + .controller_data = &tsc2005_mcspi_config,
318 + .platform_data = &tsc2005_config,
322 +static void __init tsc2005_set_config(void)
324 + const struct omap_lcd_config *conf;
326 + conf = omap_get_config(OMAP_TAG_LCD, struct omap_lcd_config);
327 + if (conf != NULL) {
328 +#ifdef CONFIG_TOUCHSCREEN_TSC2005
329 + if (strcmp(conf->panel_name, "lph8923") == 0) {
330 + tsc2005_config.ts_x_plate_ohm = 180;
331 + tsc2005_config.ts_hw_avg = 0;
332 + tsc2005_config.ts_ignore_last = 0;
333 + tsc2005_config.ts_touch_pressure = 1500;
334 + tsc2005_config.ts_stab_time = 100;
335 + tsc2005_config.ts_pressure_max = 2048;
336 + tsc2005_config.ts_pressure_fudge = 2;
337 + tsc2005_config.ts_x_max = 4096;
338 + tsc2005_config.ts_x_fudge = 4;
339 + tsc2005_config.ts_y_max = 4096;
340 + tsc2005_config.ts_y_fudge = 7;
341 + tsc2005_config.set_reset = rx51_tsc2005_set_reset;
342 + } else if (strcmp(conf->panel_name, "ls041y3") == 0) {
343 + tsc2005_config.ts_x_plate_ohm = 280;
344 + tsc2005_config.ts_hw_avg = 0;
345 + tsc2005_config.ts_ignore_last = 0;
346 + tsc2005_config.ts_touch_pressure = 1500;
347 + tsc2005_config.ts_stab_time = 1000;
348 + tsc2005_config.ts_pressure_max = 2048;
349 + tsc2005_config.ts_pressure_fudge = 2;
350 + tsc2005_config.ts_x_max = 4096;
351 + tsc2005_config.ts_x_fudge = 4;
352 + tsc2005_config.ts_y_max = 4096;
353 + tsc2005_config.ts_y_fudge = 7;
354 + tsc2005_config.set_reset = rx51_tsc2005_set_reset;
356 + printk(KERN_ERR "Unknown panel type, set default "
357 + "touchscreen configuration\n");
358 + tsc2005_config.ts_x_plate_ohm = 200;
359 + tsc2005_config.ts_stab_time = 100;
365 +static struct i2c_board_info __initdata_or_module n8x0_i2c_board_info_2[] = {};
367 +static struct i2c_board_info __initdata_or_module n810_i2c_board_info_2[] = {
369 + I2C_BOARD_INFO("lm8323", 0x45),
370 + .irq = OMAP_GPIO_IRQ(109),
371 + .platform_data = &lm8323_pdata,
375 #if defined(CONFIG_MTD_ONENAND_OMAP2) || \
376 @@ -183,6 +295,20 @@ static struct mtd_partition onenand_part
380 +static struct cbus_host_platform_data n8x0_cbus_data = {
386 +static struct platform_device n8x0_cbus_device = {
390 + .platform_data = &n8x0_cbus_data,
394 static struct omap_onenand_platform_data board_onenand_data = {
397 @@ -659,15 +785,41 @@ static struct omap_board_mux board_mux[]
398 #define board_mux NULL
401 +#ifdef CONFIG_MACH_NOKIA_N8X0_LCD
402 +extern void n8x0_mipid_init(void);
403 +extern void n8x0_blizzard_init(void);
405 +#define n8x0_mipid_init() 0
406 +#define n8x0_blizzard_init() 0
409 +extern void n8x0_usb_init(void);
411 static void __init n8x0_init_machine(void)
413 omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAC);
415 + platform_device_register(&n8x0_cbus_device);
419 /* FIXME: add n810 spi devices */
420 + tsc2005_set_config();
421 spi_register_board_info(n800_spi_board_info,
422 ARRAY_SIZE(n800_spi_board_info));
425 n8x0_menelaus_init();
427 + omap_register_i2c_bus(2, 400, n8x0_i2c_board_info_2,
428 + ARRAY_SIZE(n8x0_i2c_board_info_2));
430 + i2c_register_board_info(2, n810_i2c_board_info_2,
431 + ARRAY_SIZE(n810_i2c_board_info_2));
434 + n8x0_blizzard_init();
440 +++ linux-2.6.36-rc4/arch/arm/mach-omap2/board-n8x0-lcd.c
443 + * linux/arch/arm/mach-omap2/board-n8x0.c
445 + * Copyright (C) 2005-2009 Nokia Corporation
446 + * Author: Juha Yrjola <juha.yrjola@nokia.com>
448 + * Modified from mach-omap2/board-generic.c
450 + * This program is free software; you can redistribute it and/or modify
451 + * it under the terms of the GNU General Public License version 2 as
452 + * published by the Free Software Foundation.
455 +#include <linux/clk.h>
456 +#include <linux/delay.h>
457 +#include <linux/gpio.h>
458 +#include <linux/omapfb.h>
460 +#include <plat/lcd_mipid.h>
461 +#include <plat/blizzard.h>
463 +#include <../drivers/cbus/tahvo.h>
465 +#define N8X0_BLIZZARD_POWERDOWN_GPIO 15
469 +static void mipid_shutdown(struct mipid_platform_data *pdata)
471 + if (pdata->nreset_gpio != -1) {
472 + pr_info("shutdown LCD\n");
473 + gpio_set_value(pdata->nreset_gpio, 0);
478 +struct mipid_platform_data n8x0_mipid_platform_data = {
479 + .shutdown = mipid_shutdown,
482 +void __init n8x0_mipid_init(void)
484 + const struct omap_lcd_config *conf;
486 + conf = omap_get_config(OMAP_TAG_LCD, struct omap_lcd_config);
487 + if (conf != NULL) {
488 + n8x0_mipid_platform_data.nreset_gpio = conf->nreset_gpio;
489 + n8x0_mipid_platform_data.data_lines = conf->data_lines;
490 + printk(KERN_INFO "N8x0 MIPID config loaded");
493 + printk(KERN_INFO "N8x0 MIPID config not provided");
497 +// Epson Blizzard LCD Controller
500 + struct clk *sys_ck;
503 +static int blizzard_get_clocks(void)
505 + blizzard.sys_ck = clk_get(0, "osc_ck");
506 + if (IS_ERR(blizzard.sys_ck)) {
507 + printk(KERN_ERR "can't get Blizzard clock\n");
508 + return PTR_ERR(blizzard.sys_ck);
513 +static unsigned long blizzard_get_clock_rate(struct device *dev)
515 + return clk_get_rate(blizzard.sys_ck);
518 +static void blizzard_enable_clocks(int enable)
521 + clk_enable(blizzard.sys_ck);
523 + clk_disable(blizzard.sys_ck);
526 +static void blizzard_power_up(struct device *dev)
528 + /* Vcore to 1.475V */
529 + tahvo_set_clear_reg_bits(0x07, 0, 0xf);
532 + blizzard_enable_clocks(1);
533 + gpio_set_value(N8X0_BLIZZARD_POWERDOWN_GPIO, 1);
536 +static void blizzard_power_down(struct device *dev)
538 + gpio_set_value(N8X0_BLIZZARD_POWERDOWN_GPIO, 0);
539 + blizzard_enable_clocks(0);
541 + /* Vcore to 1.005V */
542 + tahvo_set_clear_reg_bits(0x07, 0xf, 0);
545 +static struct blizzard_platform_data n8x0_blizzard_data = {
546 + .power_up = blizzard_power_up,
547 + .power_down = blizzard_power_down,
548 + .get_clock_rate = blizzard_get_clock_rate,
552 +void __init n8x0_blizzard_init(void)
556 + r = gpio_request(N8X0_BLIZZARD_POWERDOWN_GPIO, "Blizzard pd");
559 + printk(KERN_ERR "Can't get N8x0 Blizzard powerdown GPIO %d\n", N8X0_BLIZZARD_POWERDOWN_GPIO);
562 + gpio_direction_output(N8X0_BLIZZARD_POWERDOWN_GPIO, 1);
564 + blizzard_get_clocks();
565 + omapfb_set_ctrl_platform_data(&n8x0_blizzard_data);
567 + printk(KERN_INFO "N8x0 Blizzard initialized");
570 +++ linux-2.6.36-rc4/arch/arm/mach-omap2/board-n8x0-usb.c
573 + * linux/arch/arm/mach-omap2/board-n8x0-usb.c
575 + * Copyright (C) 2006 Nokia Corporation
576 + * Author: Juha Yrjola
578 + * This program is free software; you can redistribute it and/or modify
579 + * it under the terms of the GNU General Public License version 2 as
580 + * published by the Free Software Foundation.
583 +#include <linux/types.h>
584 +#include <linux/delay.h>
585 +#include <linux/platform_device.h>
586 +#include <linux/clk.h>
587 +#include <linux/err.h>
588 +#include <linux/gpio.h>
589 +#include <linux/usb/musb.h>
591 +#include <plat/gpmc.h>
593 +#define TUSB_ASYNC_CS 1
594 +#define TUSB_SYNC_CS 4
595 +#define GPIO_TUSB_INT 58
596 +#define GPIO_TUSB_ENABLE 0
598 +static int tusb_set_power(int state);
599 +static int tusb_set_clock(struct clk *osc_ck, int state);
601 +#if defined(CONFIG_USB_MUSB_OTG)
602 +# define BOARD_MODE MUSB_OTG
603 +#elif defined(CONFIG_USB_MUSB_PERIPHERAL)
604 +# define BOARD_MODE MUSB_PERIPHERAL
605 +#else /* defined(CONFIG_USB_MUSB_HOST) */
606 +# define BOARD_MODE MUSB_HOST
609 +static struct musb_hdrc_eps_bits musb_eps[] = {
642 +static struct musb_hdrc_config musb_config = {
650 + .eps_bits = musb_eps,
653 +static struct musb_hdrc_platform_data tusb_data = {
654 + .mode = BOARD_MODE,
655 + .set_power = tusb_set_power,
656 + .set_clock = tusb_set_clock,
657 + .min_power = 25, /* x2 = 50 mA drawn from VBUS as peripheral */
658 + .power = 100, /* Max 100 mA VBUS for host mode */
660 + .config = &musb_config,
664 + * Enable or disable power to TUSB6010. When enabling, turn on 3.3 V and
665 + * 1.5 V voltage regulators of PM companion chip. Companion chip will then
666 + * provide then PGOOD signal to TUSB6010 which will release it from reset.
668 +static int tusb_set_power(int state)
673 + gpio_set_value(GPIO_TUSB_ENABLE, 1);
676 + /* Wait until TUSB6010 pulls INT pin down */
678 + while (i && gpio_get_value(GPIO_TUSB_INT)) {
684 + printk(KERN_ERR "tusb: powerup failed\n");
688 + gpio_set_value(GPIO_TUSB_ENABLE, 0);
695 +static int osc_ck_on;
697 +static int tusb_set_clock(struct clk *osc_ck, int state)
703 + //omap2_block_sleep();
704 + clk_enable(osc_ck);
707 + if (osc_ck_on == 0)
710 + clk_disable(osc_ck);
712 + //omap2_allow_sleep();
718 +void __init n8x0_usb_init(void)
721 + static char announce[] __initdata = KERN_INFO "TUSB 6010\n";
723 + /* PM companion chip power control pin */
724 + ret = gpio_request(GPIO_TUSB_ENABLE, "TUSB6010 enable");
726 + printk(KERN_ERR "Could not get TUSB power GPIO%i\n",
730 + gpio_direction_output(GPIO_TUSB_ENABLE, 0);
734 + ret = tusb6010_setup_interface(&tusb_data, TUSB6010_REFCLK_19, 2,
735 + TUSB_ASYNC_CS, TUSB_SYNC_CS,
736 + GPIO_TUSB_INT, 0x3f);
745 + gpio_free(GPIO_TUSB_ENABLE);
747 --- linux-2.6.36-rc4.orig/arch/arm/mach-omap2/control.c
748 +++ linux-2.6.36-rc4/arch/arm/mach-omap2/control.c
749 @@ -162,6 +162,7 @@ u16 omap_ctrl_readw(u16 offset)
750 return __raw_readw(OMAP_CTRL_REGADDR(offset));
753 +EXPORT_SYMBOL_GPL(omap_ctrl_readl);
754 u32 omap_ctrl_readl(u16 offset)
756 return __raw_readl(OMAP_CTRL_REGADDR(offset));
757 @@ -177,6 +178,7 @@ void omap_ctrl_writew(u16 val, u16 offse
758 __raw_writew(val, OMAP_CTRL_REGADDR(offset));
761 +EXPORT_SYMBOL_GPL(omap_ctrl_writel);
762 void omap_ctrl_writel(u32 val, u16 offset)
764 __raw_writel(val, OMAP_CTRL_REGADDR(offset));
765 --- linux-2.6.36-rc4.orig/arch/arm/mach-omap2/Kconfig
766 +++ linux-2.6.36-rc4/arch/arm/mach-omap2/Kconfig
767 @@ -189,6 +189,16 @@ config MACH_NOKIA_N8X0
768 select MACH_NOKIA_N810
769 select MACH_NOKIA_N810_WIMAX
771 +config MACH_NOKIA_N8X0_LCD
773 + depends on MACH_NOKIA_N8X0 && FB_OMAP_LCDC_BLIZZARD && FB_OMAP_LCD_MIPID
776 +config MACH_NOKIA_N8X0_USB
778 + depends on MACH_NOKIA_N8X0 && MACH_OMAP2_TUSB6010
781 config MACH_NOKIA_RX51
782 bool "Nokia RX-51 board"
783 depends on ARCH_OMAP3
784 --- linux-2.6.36-rc4.orig/arch/arm/mach-omap2/Makefile
785 +++ linux-2.6.36-rc4/arch/arm/mach-omap2/Makefile
786 @@ -125,6 +125,8 @@ obj-$(CONFIG_MACH_OMAP_3430SDP) += boar
789 obj-$(CONFIG_MACH_NOKIA_N8X0) += board-n8x0.o
790 +obj-$(CONFIG_MACH_NOKIA_N8X0_LCD) += board-n8x0-lcd.o
791 +obj-$(CONFIG_MACH_NOKIA_N8X0_USB) += board-n8x0-usb.o
792 obj-$(CONFIG_MACH_NOKIA_RX51) += board-rx51.o \
794 board-rx51-peripherals.o \
795 --- linux-2.6.36-rc4.orig/arch/arm/mach-omap2/serial.c
796 +++ linux-2.6.36-rc4/arch/arm/mach-omap2/serial.c
797 @@ -546,10 +546,10 @@ static void omap_uart_idle_init(struct o
801 - p->irqflags |= IRQF_SHARED;
802 +/* p->irqflags |= IRQF_SHARED;
803 ret = request_irq(p->irq, omap_uart_interrupt, IRQF_SHARED,
804 "serial idle", (void *)uart);
809 void omap_uart_enable_irqs(int enable)
810 @@ -557,13 +557,13 @@ void omap_uart_enable_irqs(int enable)
812 struct omap_uart_state *uart;
814 - list_for_each_entry(uart, &uart_list, node) {
815 +/* list_for_each_entry(uart, &uart_list, node) {
817 ret = request_irq(uart->p->irq, omap_uart_interrupt,
818 IRQF_SHARED, "serial idle", (void *)uart);
820 free_irq(uart->p->irq, (void *)uart);
825 static ssize_t sleep_timeout_show(struct device *dev,