1 Index: linux-2.6.35/arch/arm/mach-omap1/board-nokia770.c
2 ===================================================================
3 --- linux-2.6.35.orig/arch/arm/mach-omap1/board-nokia770.c 2010-08-08 12:56:15.000000000 +0200
4 +++ linux-2.6.35/arch/arm/mach-omap1/board-nokia770.c 2010-08-08 12:56:30.000000000 +0200
6 #include <plat/lcd_mipid.h>
8 #include <plat/clock.h>
9 +#include <plat/cbus.h>
11 #define ADS7846_PENDOWN_GPIO 15
13 @@ -96,8 +97,23 @@ static struct platform_device nokia770_k
14 .resource = nokia770_kp_resources,
17 +static struct cbus_host_platform_data nokia770_cbus_data = {
18 + .clk_gpio = OMAP_MPUIO(11),
19 + .dat_gpio = OMAP_MPUIO(10),
20 + .sel_gpio = OMAP_MPUIO(9),
23 +static struct platform_device nokia770_cbus_device = {
27 + .platform_data = &nokia770_cbus_data,
31 static struct platform_device *nokia770_devices[] __initdata = {
33 + &nokia770_cbus_device,
36 static void mipid_shutdown(struct mipid_platform_data *pdata)
37 Index: linux-2.6.35/arch/arm/mach-omap2/board-n8x0.c
38 ===================================================================
39 --- linux-2.6.35.orig/arch/arm/mach-omap2/board-n8x0.c 2010-08-08 12:56:15.000000000 +0200
40 +++ linux-2.6.35/arch/arm/mach-omap2/board-n8x0.c 2010-08-08 12:56:30.000000000 +0200
43 #include <linux/stddef.h>
44 #include <linux/i2c.h>
45 +#include <linux/platform_device.h>
46 #include <linux/spi/spi.h>
47 +#include <linux/spi/tsc2005.h>
48 +#include <linux/input.h>
49 #include <linux/usb/musb.h>
50 +#include <linux/i2c/lm8323.h>
52 #include <asm/mach/arch.h>
53 #include <asm/mach-types.h>
55 #include <plat/onenand.h>
57 #include <plat/serial.h>
58 +#include <plat/cbus.h>
60 +#define RX51_TSC2005_RESET_GPIO 94
61 +#define RX51_TSC2005_IRQ_GPIO 106
62 +#define OMAP_TAG_NOKIA_BT 0x4e01
64 +static s16 rx44_keymap[LM8323_KEYMAP_SIZE] = {
69 + [0x05] = KEY_BACKSPACE,
81 + [0x14] = KEY_APOSTROPHE,
88 + [0x1c] = KEY_LEFTSHIFT, /* Actually, this is both shift keys */
92 + [0x22] = KEY_SEMICOLON,
100 + [0x32] = KEY_RIGHTCTRL,
101 + [0x34] = KEY_SPACE,
102 + [0x35] = KEY_COMMA,
104 + [0x3c] = KEY_COMPOSE,
109 + [0x46] = KEY_RIGHT,
113 + [0x55] = KEY_ENTER,
120 + [0x75] = KEY_KPENTER,
123 +static struct lm8323_platform_data lm8323_pdata = {
124 + .repeat = 0, /* Repeat is handled in userspace for now. */
125 + .keymap = rx44_keymap,
128 + .debounce_time = 12,
129 + .active_time = 500,
131 + .name = "Internal keyboard",
132 + .pwm_names[0] = "n810::keyboard",
133 + .pwm_names[1] = "n810::cover",
134 + //.pwm1_name = "n810::keyboard",
135 + //.pwm2_name = "n810::cover",
138 +struct omap_bluetooth_config {
141 + u8 host_wakeup_gpio;
148 +static struct platform_device n8x0_bt_device = {
151 + .num_resources = 0,
154 +void __init n8x0_bt_init(void)
156 + const struct omap_bluetooth_config *bt_config;
158 + bt_config = (void *) omap_get_config(OMAP_TAG_NOKIA_BT,
159 + struct omap_bluetooth_config);
160 + n8x0_bt_device.dev.platform_data = (void *) bt_config;
161 + if (platform_device_register(&n8x0_bt_device) < 0)
165 +static struct omap2_mcspi_device_config mipid_mcspi_config = {
167 + .single_channel = 1,
170 static int slot1_cover_open;
171 static int slot2_cover_open;
172 @@ -139,7 +254,34 @@ static struct omap2_mcspi_device_config
176 +#ifdef CONFIG_MACH_NOKIA_N8X0_LCD
177 +extern struct mipid_platform_data n8x0_mipid_platform_data;
180 +#ifdef CONFIG_TOUCHSCREEN_TSC2005
181 +static struct tsc2005_platform_data tsc2005_config;
182 +static void rx51_tsc2005_set_reset(bool enable)
184 + gpio_set_value(RX51_TSC2005_RESET_GPIO, enable);
187 +static struct omap2_mcspi_device_config tsc2005_mcspi_config = {
189 + .single_channel = 1,
193 static struct spi_board_info n800_spi_board_info[] __initdata = {
194 +#ifdef CONFIG_MACH_NOKIA_N8X0_LCD
196 + .modalias = "lcd_mipid",
199 + .max_speed_hz = 4000000,
200 + .controller_data= &mipid_mcspi_config,
201 + .platform_data = &n8x0_mipid_platform_data,
205 .modalias = "p54spi",
207 @@ -147,6 +289,68 @@ static struct spi_board_info n800_spi_bo
208 .max_speed_hz = 48000000,
209 .controller_data = &p54spi_mcspi_config,
212 + .modalias = "tsc2005",
215 + .irq = OMAP_GPIO_IRQ(RX51_TSC2005_IRQ_GPIO),
216 + .max_speed_hz = 6000000,
217 + .controller_data = &tsc2005_mcspi_config,
218 + .platform_data = &tsc2005_config,
222 +static void __init tsc2005_set_config(void)
224 + const struct omap_lcd_config *conf;
226 + conf = omap_get_config(OMAP_TAG_LCD, struct omap_lcd_config);
227 + if (conf != NULL) {
228 +#ifdef CONFIG_TOUCHSCREEN_TSC2005
229 + if (strcmp(conf->panel_name, "lph8923") == 0) {
230 + tsc2005_config.ts_x_plate_ohm = 180;
231 + tsc2005_config.ts_hw_avg = 0;
232 + tsc2005_config.ts_ignore_last = 0;
233 + tsc2005_config.ts_touch_pressure = 1500;
234 + tsc2005_config.ts_stab_time = 100;
235 + tsc2005_config.ts_pressure_max = 2048;
236 + tsc2005_config.ts_pressure_fudge = 2;
237 + tsc2005_config.ts_x_max = 4096;
238 + tsc2005_config.ts_x_fudge = 4;
239 + tsc2005_config.ts_y_max = 4096;
240 + tsc2005_config.ts_y_fudge = 7;
241 + tsc2005_config.set_reset = rx51_tsc2005_set_reset;
242 + } else if (strcmp(conf->panel_name, "ls041y3") == 0) {
243 + tsc2005_config.ts_x_plate_ohm = 280;
244 + tsc2005_config.ts_hw_avg = 0;
245 + tsc2005_config.ts_ignore_last = 0;
246 + tsc2005_config.ts_touch_pressure = 1500;
247 + tsc2005_config.ts_stab_time = 1000;
248 + tsc2005_config.ts_pressure_max = 2048;
249 + tsc2005_config.ts_pressure_fudge = 2;
250 + tsc2005_config.ts_x_max = 4096;
251 + tsc2005_config.ts_x_fudge = 4;
252 + tsc2005_config.ts_y_max = 4096;
253 + tsc2005_config.ts_y_fudge = 7;
254 + tsc2005_config.set_reset = rx51_tsc2005_set_reset;
256 + printk(KERN_ERR "Unknown panel type, set default "
257 + "touchscreen configuration\n");
258 + tsc2005_config.ts_x_plate_ohm = 200;
259 + tsc2005_config.ts_stab_time = 100;
265 +static struct i2c_board_info __initdata_or_module n8x0_i2c_board_info_2[] = {};
267 +static struct i2c_board_info __initdata_or_module n810_i2c_board_info_2[] = {
269 + I2C_BOARD_INFO("lm8323", 0x45),
270 + .irq = OMAP_GPIO_IRQ(109),
271 + .platform_data = &lm8323_pdata,
275 #if defined(CONFIG_MTD_ONENAND_OMAP2) || \
276 @@ -181,6 +385,20 @@ static struct mtd_partition onenand_part
280 +static struct cbus_host_platform_data n8x0_cbus_data = {
286 +static struct platform_device n8x0_cbus_device = {
290 + .platform_data = &n8x0_cbus_data,
294 static struct omap_onenand_platform_data board_onenand_data = {
297 @@ -649,14 +867,37 @@ static void __init n8x0_init_irq(void)
301 +#ifdef CONFIG_MACH_NOKIA_N8X0_LCD
302 +extern void n8x0_mipid_init(void);
303 +extern void n8x0_blizzard_init(void);
305 +#define n8x0_mipid_init() 0
306 +#define n8x0_blizzard_init() 0
309 static void __init n8x0_init_machine(void)
311 + platform_device_register(&n8x0_cbus_device);
315 /* FIXME: add n810 spi devices */
316 + tsc2005_set_config();
317 spi_register_board_info(n800_spi_board_info,
318 ARRAY_SIZE(n800_spi_board_info));
321 n8x0_menelaus_init();
323 + omap_register_i2c_bus(2, 400, n8x0_i2c_board_info_2,
324 + ARRAY_SIZE(n8x0_i2c_board_info_2));
326 + i2c_register_board_info(2, n810_i2c_board_info_2,
327 + ARRAY_SIZE(n810_i2c_board_info_2));
330 + n8x0_blizzard_init();
335 Index: linux-2.6.35/arch/arm/mach-omap2/board-n8x0-lcd.c
336 ===================================================================
337 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
338 +++ linux-2.6.35/arch/arm/mach-omap2/board-n8x0-lcd.c 2010-08-08 12:56:31.000000000 +0200
341 + * linux/arch/arm/mach-omap2/board-n8x0.c
343 + * Copyright (C) 2005-2009 Nokia Corporation
344 + * Author: Juha Yrjola <juha.yrjola@nokia.com>
346 + * Modified from mach-omap2/board-generic.c
348 + * This program is free software; you can redistribute it and/or modify
349 + * it under the terms of the GNU General Public License version 2 as
350 + * published by the Free Software Foundation.
353 +#include <linux/clk.h>
354 +#include <linux/delay.h>
355 +#include <linux/gpio.h>
356 +#include <linux/omapfb.h>
358 +#include <plat/lcd_mipid.h>
359 +#include <plat/blizzard.h>
361 +#include <../drivers/cbus/tahvo.h>
363 +#define N8X0_BLIZZARD_POWERDOWN_GPIO 15
367 +static void mipid_shutdown(struct mipid_platform_data *pdata)
369 + if (pdata->nreset_gpio != -1) {
370 + pr_info("shutdown LCD\n");
371 + gpio_set_value(pdata->nreset_gpio, 0);
376 +struct mipid_platform_data n8x0_mipid_platform_data = {
377 + .shutdown = mipid_shutdown,
380 +void __init n8x0_mipid_init(void)
382 + const struct omap_lcd_config *conf;
384 + conf = omap_get_config(OMAP_TAG_LCD, struct omap_lcd_config);
385 + if (conf != NULL) {
386 + n8x0_mipid_platform_data.nreset_gpio = conf->nreset_gpio;
387 + n8x0_mipid_platform_data.data_lines = conf->data_lines;
388 + printk(KERN_INFO "N8x0 MIPID config loaded");
391 + printk(KERN_INFO "N8x0 MIPID config not provided");
395 +// Epson Blizzard LCD Controller
398 + struct clk *sys_ck;
401 +static int blizzard_get_clocks(void)
403 + blizzard.sys_ck = clk_get(0, "osc_ck");
404 + if (IS_ERR(blizzard.sys_ck)) {
405 + printk(KERN_ERR "can't get Blizzard clock\n");
406 + return PTR_ERR(blizzard.sys_ck);
411 +static unsigned long blizzard_get_clock_rate(struct device *dev)
413 + return clk_get_rate(blizzard.sys_ck);
416 +static void blizzard_enable_clocks(int enable)
419 + clk_enable(blizzard.sys_ck);
421 + clk_disable(blizzard.sys_ck);
424 +static void blizzard_power_up(struct device *dev)
426 + /* Vcore to 1.475V */
427 + tahvo_set_clear_reg_bits(0x07, 0, 0xf);
430 + blizzard_enable_clocks(1);
431 + gpio_set_value(N8X0_BLIZZARD_POWERDOWN_GPIO, 1);
434 +static void blizzard_power_down(struct device *dev)
436 + gpio_set_value(N8X0_BLIZZARD_POWERDOWN_GPIO, 0);
437 + blizzard_enable_clocks(0);
439 + /* Vcore to 1.005V */
440 + tahvo_set_clear_reg_bits(0x07, 0xf, 0);
443 +static struct blizzard_platform_data n8x0_blizzard_data = {
444 + .power_up = blizzard_power_up,
445 + .power_down = blizzard_power_down,
446 + .get_clock_rate = blizzard_get_clock_rate,
450 +void __init n8x0_blizzard_init(void)
454 + r = gpio_request(N8X0_BLIZZARD_POWERDOWN_GPIO, "Blizzard pd");
457 + printk(KERN_ERR "Can't get N8x0 Blizzard powerdown GPIO %d\n", N8X0_BLIZZARD_POWERDOWN_GPIO);
460 + gpio_direction_output(N8X0_BLIZZARD_POWERDOWN_GPIO, 1);
462 + blizzard_get_clocks();
463 + omapfb_set_ctrl_platform_data(&n8x0_blizzard_data);
465 + printk(KERN_INFO "N8x0 Blizzard initialized");
467 Index: linux-2.6.35/arch/arm/mach-omap2/board-n8x0-usb.c
468 ===================================================================
469 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
470 +++ linux-2.6.35/arch/arm/mach-omap2/board-n8x0-usb.c 2010-08-08 12:56:31.000000000 +0200
473 + * linux/arch/arm/mach-omap2/board-n8x0-usb.c
475 + * Copyright (C) 2006 Nokia Corporation
476 + * Author: Juha Yrjola
478 + * This program is free software; you can redistribute it and/or modify
479 + * it under the terms of the GNU General Public License version 2 as
480 + * published by the Free Software Foundation.
483 +#include <linux/types.h>
484 +#include <linux/delay.h>
485 +#include <linux/platform_device.h>
486 +#include <linux/clk.h>
487 +#include <linux/err.h>
488 +#include <linux/gpio.h>
489 +#include <linux/usb/musb.h>
491 +#include <plat/gpmc.h>
493 +#define TUSB_ASYNC_CS 1
494 +#define TUSB_SYNC_CS 4
495 +#define GPIO_TUSB_INT 58
496 +#define GPIO_TUSB_ENABLE 0
498 +static int tusb_set_power(int state);
499 +static int tusb_set_clock(struct clk *osc_ck, int state);
501 +#if defined(CONFIG_USB_MUSB_OTG)
502 +# define BOARD_MODE MUSB_OTG
503 +#elif defined(CONFIG_USB_MUSB_PERIPHERAL)
504 +# define BOARD_MODE MUSB_PERIPHERAL
505 +#else /* defined(CONFIG_USB_MUSB_HOST) */
506 +# define BOARD_MODE MUSB_HOST
509 +static struct musb_hdrc_eps_bits musb_eps[] = {
542 +static struct musb_hdrc_config musb_config = {
550 + .eps_bits = musb_eps,
553 +static struct musb_hdrc_platform_data tusb_data = {
554 + .mode = BOARD_MODE,
555 + .set_power = tusb_set_power,
556 + .set_clock = tusb_set_clock,
557 + .min_power = 25, /* x2 = 50 mA drawn from VBUS as peripheral */
558 + .power = 100, /* Max 100 mA VBUS for host mode */
560 + .config = &musb_config,
564 + * Enable or disable power to TUSB6010. When enabling, turn on 3.3 V and
565 + * 1.5 V voltage regulators of PM companion chip. Companion chip will then
566 + * provide then PGOOD signal to TUSB6010 which will release it from reset.
568 +static int tusb_set_power(int state)
573 + gpio_set_value(GPIO_TUSB_ENABLE, 1);
576 + /* Wait until TUSB6010 pulls INT pin down */
578 + while (i && gpio_get_value(GPIO_TUSB_INT)) {
584 + printk(KERN_ERR "tusb: powerup failed\n");
588 + gpio_set_value(GPIO_TUSB_ENABLE, 0);
595 +static int osc_ck_on;
597 +static int tusb_set_clock(struct clk *osc_ck, int state)
603 + //omap2_block_sleep();
604 + clk_enable(osc_ck);
607 + if (osc_ck_on == 0)
610 + clk_disable(osc_ck);
612 + //omap2_allow_sleep();
618 +void __init n8x0_usb_init(void)
621 + static char announce[] __initdata = KERN_INFO "TUSB 6010\n";
623 + /* PM companion chip power control pin */
624 + ret = gpio_request(GPIO_TUSB_ENABLE, "TUSB6010 enable");
626 + printk(KERN_ERR "Could not get TUSB power GPIO%i\n",
630 + gpio_direction_output(GPIO_TUSB_ENABLE, 0);
634 + ret = tusb6010_setup_interface(&tusb_data, TUSB6010_REFCLK_19, 2,
635 + TUSB_ASYNC_CS, TUSB_SYNC_CS,
636 + GPIO_TUSB_INT, 0x3f);
645 + gpio_free(GPIO_TUSB_ENABLE);
647 Index: linux-2.6.35/arch/arm/mach-omap2/control.c
648 ===================================================================
649 --- linux-2.6.35.orig/arch/arm/mach-omap2/control.c 2010-08-08 12:56:15.000000000 +0200
650 +++ linux-2.6.35/arch/arm/mach-omap2/control.c 2010-08-08 12:56:32.000000000 +0200
651 @@ -162,6 +162,7 @@ u16 omap_ctrl_readw(u16 offset)
652 return __raw_readw(OMAP_CTRL_REGADDR(offset));
655 +EXPORT_SYMBOL_GPL(omap_ctrl_readl);
656 u32 omap_ctrl_readl(u16 offset)
658 return __raw_readl(OMAP_CTRL_REGADDR(offset));
659 @@ -177,6 +178,7 @@ void omap_ctrl_writew(u16 val, u16 offse
660 __raw_writew(val, OMAP_CTRL_REGADDR(offset));
663 +EXPORT_SYMBOL_GPL(omap_ctrl_writel);
664 void omap_ctrl_writel(u32 val, u16 offset)
666 __raw_writel(val, OMAP_CTRL_REGADDR(offset));
667 Index: linux-2.6.35/arch/arm/mach-omap2/Kconfig
668 ===================================================================
669 --- linux-2.6.35.orig/arch/arm/mach-omap2/Kconfig 2010-08-08 12:56:15.000000000 +0200
670 +++ linux-2.6.35/arch/arm/mach-omap2/Kconfig 2010-08-08 12:56:33.000000000 +0200
671 @@ -116,6 +116,16 @@ config MACH_NOKIA_N8X0
672 select MACH_NOKIA_N810
673 select MACH_NOKIA_N810_WIMAX
675 +config MACH_NOKIA_N8X0_LCD
677 + depends on MACH_NOKIA_N8X0 && FB_OMAP_LCDC_BLIZZARD && FB_OMAP_LCD_MIPID
680 +config MACH_NOKIA_N8X0_USB
682 + depends on MACH_NOKIA_N8X0 && MACH_OMAP2_TUSB6010
685 config MACH_NOKIA_RX51
686 bool "Nokia RX-51 board"
687 depends on ARCH_OMAP3
688 Index: linux-2.6.35/arch/arm/mach-omap2/Makefile
689 ===================================================================
690 --- linux-2.6.35.orig/arch/arm/mach-omap2/Makefile 2010-08-08 12:56:15.000000000 +0200
691 +++ linux-2.6.35/arch/arm/mach-omap2/Makefile 2010-08-08 12:56:33.000000000 +0200
692 @@ -116,6 +116,8 @@ obj-$(CONFIG_MACH_OMAP_3430SDP) += boar
695 obj-$(CONFIG_MACH_NOKIA_N8X0) += board-n8x0.o
696 +obj-$(CONFIG_MACH_NOKIA_N8X0_LCD) += board-n8x0-lcd.o
697 +obj-$(CONFIG_MACH_NOKIA_N8X0_USB) += board-n8x0-usb.o
698 obj-$(CONFIG_MACH_NOKIA_RX51) += board-rx51.o \
700 board-rx51-peripherals.o \
701 Index: linux-2.6.35/arch/arm/mach-omap2/serial.c
702 ===================================================================
703 --- linux-2.6.35.orig/arch/arm/mach-omap2/serial.c 2010-08-08 12:56:15.000000000 +0200
704 +++ linux-2.6.35/arch/arm/mach-omap2/serial.c 2010-08-08 12:56:34.000000000 +0200
705 @@ -495,10 +495,10 @@ static void omap_uart_idle_init(struct o
709 - p->irqflags |= IRQF_SHARED;
710 +/* p->irqflags |= IRQF_SHARED;
711 ret = request_irq(p->irq, omap_uart_interrupt, IRQF_SHARED,
712 "serial idle", (void *)uart);
717 void omap_uart_enable_irqs(int enable)
718 @@ -506,13 +506,13 @@ void omap_uart_enable_irqs(int enable)
720 struct omap_uart_state *uart;
722 - list_for_each_entry(uart, &uart_list, node) {
723 +/* list_for_each_entry(uart, &uart_list, node) {
725 ret = request_irq(uart->p->irq, omap_uart_interrupt,
726 IRQF_SHARED, "serial idle", (void *)uart);
728 free_irq(uart->p->irq, (void *)uart);
733 static ssize_t sleep_timeout_show(struct device *dev,