1 Index: linux-3.1/arch/arm/mach-omap2/board-n8x0.c
2 ===================================================================
3 --- linux-3.1.orig/arch/arm/mach-omap2/board-n8x0.c 2011-10-30 00:48:47.357044479 +0200
4 +++ linux-3.1/arch/arm/mach-omap2/board-n8x0.c 2011-10-30 00:48:48.205044041 +0200
6 #include <linux/spi/spi.h>
7 #include <linux/usb/musb.h>
8 #include <sound/tlv320aic3x.h>
9 +#include <linux/spi/tsc2005.h>
11 #include <asm/mach/arch.h>
12 #include <asm/mach-types.h>
13 @@ -43,6 +44,66 @@ static int slot1_cover_open;
14 static int slot2_cover_open;
15 static struct device *mmc_device;
17 +#define RX51_TSC2005_RESET_GPIO 94
18 +#define RX51_TSC2005_IRQ_GPIO 106
20 +#ifdef CONFIG_TOUCHSCREEN_TSC2005
21 +static struct tsc2005_platform_data tsc2005_config;
22 +static void rx51_tsc2005_set_reset(bool enable)
24 + gpio_set_value(RX51_TSC2005_RESET_GPIO, enable);
27 +static struct omap2_mcspi_device_config tsc2005_mcspi_config = {
29 + .single_channel = 1,
33 +static void __init tsc2005_set_config(void)
35 + const struct omap_lcd_config *conf;
37 + conf = omap_get_config(OMAP_TAG_LCD, struct omap_lcd_config);
39 +#ifdef CONFIG_TOUCHSCREEN_TSC2005
40 + if (strcmp(conf->panel_name, "lph8923") == 0) {
41 + tsc2005_config.ts_x_plate_ohm = 180;
42 + tsc2005_config.ts_pressure_max = 2048;
43 + tsc2005_config.ts_pressure_fudge = 2;
44 + tsc2005_config.ts_x_max = 4096;
45 + tsc2005_config.ts_x_fudge = 4;
46 + tsc2005_config.ts_y_max = 4096;
47 + tsc2005_config.ts_y_fudge = 7;
48 + tsc2005_config.set_reset = rx51_tsc2005_set_reset;
49 + } else if (strcmp(conf->panel_name, "ls041y3") == 0) {
50 + tsc2005_config.ts_x_plate_ohm = 280;
51 + tsc2005_config.ts_pressure_max = 2048;
52 + tsc2005_config.ts_pressure_fudge = 2;
53 + tsc2005_config.ts_x_max = 4096;
54 + tsc2005_config.ts_x_fudge = 4;
55 + tsc2005_config.ts_y_max = 4096;
56 + tsc2005_config.ts_y_fudge = 7;
57 + tsc2005_config.set_reset = rx51_tsc2005_set_reset;
59 + printk(KERN_ERR "Unknown panel type, set default "
60 + "touchscreen configuration\n");
61 + tsc2005_config.ts_x_plate_ohm = 200;
67 +static struct omap2_mcspi_device_config mipid_mcspi_config = {
69 + .single_channel = 1,
72 +extern struct mipid_platform_data n8x0_mipid_platform_data;
74 +extern void n8x0_mipid_init(void);
75 +extern void n8x0_blizzard_init(void);
77 #define TUSB6010_ASYNC_CS 1
78 #define TUSB6010_SYNC_CS 4
79 #define TUSB6010_GPIO_INT 58
80 @@ -145,12 +206,29 @@ static struct omap2_mcspi_device_config
82 static struct spi_board_info n800_spi_board_info[] __initdata = {
84 + .modalias = "lcd_mipid",
87 + .max_speed_hz = 4000000,
88 + .controller_data= &mipid_mcspi_config,
89 + .platform_data = &n8x0_mipid_platform_data,
95 .max_speed_hz = 48000000,
96 .controller_data = &p54spi_mcspi_config,
99 + .modalias = "tsc2005",
102 + .irq = OMAP_GPIO_IRQ(RX51_TSC2005_IRQ_GPIO),
103 + .max_speed_hz = 6000000,
104 + .controller_data = &tsc2005_mcspi_config,
105 + .platform_data = &tsc2005_config,
109 #if defined(CONFIG_MTD_ONENAND_OMAP2) || \
110 @@ -793,6 +871,7 @@ static void __init n8x0_init_machine(voi
113 /* FIXME: add n810 spi devices */
114 + tsc2005_set_config();
115 spi_register_board_info(n800_spi_board_info,
116 ARRAY_SIZE(n800_spi_board_info));
117 omap_register_i2c_bus(1, 400, n8x0_i2c_board_info_1,
118 @@ -802,6 +881,8 @@ static void __init n8x0_init_machine(voi
119 i2c_register_board_info(2, n810_i2c_board_info_2,
120 ARRAY_SIZE(n810_i2c_board_info_2));
123 + n8x0_blizzard_init();
124 gpmc_onenand_init(board_onenand_data);
127 Index: linux-3.1/arch/arm/mach-omap2/board-n8x0-lcd.c
128 ===================================================================
129 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
130 +++ linux-3.1/arch/arm/mach-omap2/board-n8x0-lcd.c 2011-10-30 00:48:48.205044041 +0200
133 + * linux/arch/arm/mach-omap2/board-n8x0.c
135 + * Copyright (C) 2005-2009 Nokia Corporation
136 + * Author: Juha Yrjola <juha.yrjola@nokia.com>
138 + * Modified from mach-omap2/board-generic.c
140 + * This program is free software; you can redistribute it and/or modify
141 + * it under the terms of the GNU General Public License version 2 as
142 + * published by the Free Software Foundation.
145 +#include <linux/clk.h>
146 +#include <linux/delay.h>
147 +#include <linux/gpio.h>
148 +#include <linux/omapfb.h>
150 +#include <plat/lcd_mipid.h>
151 +#include <plat/blizzard.h>
154 +#define N8X0_BLIZZARD_POWERDOWN_GPIO 15
158 +static void mipid_shutdown(struct mipid_platform_data *pdata)
160 + if (pdata->nreset_gpio != -1) {
161 + pr_info("shutdown LCD\n");
162 + gpio_set_value(pdata->nreset_gpio, 0);
167 +struct mipid_platform_data n8x0_mipid_platform_data = {
168 + .shutdown = mipid_shutdown,
171 +void __init n8x0_mipid_init(void)
173 + const struct omap_lcd_config *conf;
176 + conf = omap_get_config(OMAP_TAG_LCD, struct omap_lcd_config);
177 + if (conf != NULL) {
178 + n8x0_mipid_platform_data.nreset_gpio = conf->nreset_gpio;
179 + n8x0_mipid_platform_data.data_lines = conf->data_lines;
180 + if (conf->nreset_gpio != -1) {
181 + err = gpio_request(conf->nreset_gpio, "MIPID nreset");
183 + printk(KERN_ERR "N8x0 MIPID failed to request nreset GPIO %d\n",
184 + conf->nreset_gpio);
186 + err = gpio_direction_output(conf->nreset_gpio, 1);
188 + printk(KERN_ERR "N8x0 MIPID failed to set nreset GPIO %d\n",
189 + conf->nreset_gpio);
193 + printk(KERN_INFO "N8x0 MIPID config loaded");
196 + printk(KERN_INFO "N8x0 MIPID config not provided");
200 +// Epson Blizzard LCD Controller
203 + struct clk *sys_ck;
206 +static int blizzard_get_clocks(void)
208 + blizzard.sys_ck = clk_get(0, "osc_ck");
209 + if (IS_ERR(blizzard.sys_ck)) {
210 + printk(KERN_ERR "can't get Blizzard clock\n");
211 + return PTR_ERR(blizzard.sys_ck);
216 +static unsigned long blizzard_get_clock_rate(struct device *dev)
218 + return clk_get_rate(blizzard.sys_ck);
221 +static void blizzard_enable_clocks(int enable)
224 + clk_enable(blizzard.sys_ck);
226 + clk_disable(blizzard.sys_ck);
229 +static void blizzard_power_up(struct device *dev)
231 + /* Vcore to 1.475V */
232 +//FIXME tahvo_set_clear_reg_bits(0x07, 0, 0xf);
235 + blizzard_enable_clocks(1);
236 + gpio_set_value(N8X0_BLIZZARD_POWERDOWN_GPIO, 1);
239 +static void blizzard_power_down(struct device *dev)
241 + gpio_set_value(N8X0_BLIZZARD_POWERDOWN_GPIO, 0);
242 + blizzard_enable_clocks(0);
244 + /* Vcore to 1.005V */
245 +//FIXME tahvo_set_clear_reg_bits(0x07, 0xf, 0);
248 +static struct blizzard_platform_data n8x0_blizzard_data = {
249 + .power_up = blizzard_power_up,
250 + .power_down = blizzard_power_down,
251 + .get_clock_rate = blizzard_get_clock_rate,
255 +void __init n8x0_blizzard_init(void)
259 + r = gpio_request(N8X0_BLIZZARD_POWERDOWN_GPIO, "Blizzard pd");
262 + printk(KERN_ERR "Can't get N8x0 Blizzard powerdown GPIO %d\n", N8X0_BLIZZARD_POWERDOWN_GPIO);
265 + gpio_direction_output(N8X0_BLIZZARD_POWERDOWN_GPIO, 1);
267 + blizzard_get_clocks();
268 + omapfb_set_ctrl_platform_data(&n8x0_blizzard_data);
270 + printk(KERN_INFO "N8x0 Blizzard initialized");
272 Index: linux-3.1/arch/arm/mach-omap2/Makefile
273 ===================================================================
274 --- linux-3.1.orig/arch/arm/mach-omap2/Makefile 2011-10-30 00:48:29.461056893 +0200
275 +++ linux-3.1/arch/arm/mach-omap2/Makefile 2011-10-30 00:48:48.205044041 +0200
276 @@ -209,6 +209,7 @@ obj-$(CONFIG_MACH_OMAP_3430SDP) += boar
279 obj-$(CONFIG_MACH_NOKIA_N8X0) += board-n8x0.o
280 +obj-$(CONFIG_MACH_NOKIA_N8X0) += board-n8x0-lcd.o
281 obj-$(CONFIG_MACH_NOKIA_RM680) += board-rm680.o \
284 Index: linux-3.1/arch/arm/mach-omap2/omap_hwmod_2420_data.c
285 ===================================================================
286 --- linux-3.1.orig/arch/arm/mach-omap2/omap_hwmod_2420_data.c 2011-10-30 00:48:29.441056907 +0200
287 +++ linux-3.1/arch/arm/mach-omap2/omap_hwmod_2420_data.c 2011-10-30 00:48:48.205044041 +0200
288 @@ -1181,6 +1181,7 @@ static struct omap_hwmod_ocp_if *omap242
290 static struct omap_hwmod omap2420_gpio1_hwmod = {
292 + .flags = HWMOD_INIT_NO_RESET, /* Workaround: Don't reset the n810 MIPID */
293 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
294 .mpu_irqs = omap2_gpio1_irqs,
295 .main_clk = "gpios_fck",