aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2012-03-25 18:55:54 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2012-03-25 18:55:54 -0400
commit18bbff9f679cd470db66402fdb9c577b34324183 (patch)
treef8e90adadfde630368034268de8cc5763898ab37 /arch/arm
parente7d863d0f42e2cf19a13c867bfcab7424388bff8 (diff)
parent7cb66dcc828662c8cacb74af08478433cef102b1 (diff)
Merge branch 'sa11x0-lcd' into sa11x0
Conflicts: arch/arm/mach-sa1100/assabet.c
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-sa1100/assabet.c130
-rw-r--r--arch/arm/mach-sa1100/collie.c17
-rw-r--r--arch/arm/mach-sa1100/generic.c14
-rw-r--r--arch/arm/mach-sa1100/generic.h6
-rw-r--r--arch/arm/mach-sa1100/h3100.c23
-rw-r--r--arch/arm/mach-sa1100/h3600.c32
-rw-r--r--arch/arm/mach-sa1100/include/mach/SA-1100.h10
-rw-r--r--arch/arm/mach-sa1100/include/mach/shannon.h2
-rw-r--r--arch/arm/mach-sa1100/lart.c79
-rw-r--r--arch/arm/mach-sa1100/shannon.c17
10 files changed, 275 insertions, 55 deletions
diff --git a/arch/arm/mach-sa1100/assabet.c b/arch/arm/mach-sa1100/assabet.c
index e2d411a8d4ce..c3f5064df4bf 100644
--- a/arch/arm/mach-sa1100/assabet.c
+++ b/arch/arm/mach-sa1100/assabet.c
@@ -20,6 +20,8 @@
20#include <linux/delay.h> 20#include <linux/delay.h>
21#include <linux/mm.h> 21#include <linux/mm.h>
22 22
23#include <video/sa1100fb.h>
24
23#include <mach/hardware.h> 25#include <mach/hardware.h>
24#include <asm/mach-types.h> 26#include <asm/mach-types.h>
25#include <asm/irq.h> 27#include <asm/irq.h>
@@ -69,33 +71,6 @@ void ASSABET_BCR_frob(unsigned int mask, unsigned int val)
69 71
70EXPORT_SYMBOL(ASSABET_BCR_frob); 72EXPORT_SYMBOL(ASSABET_BCR_frob);
71 73
72static void assabet_backlight_power(int on)
73{
74#ifndef ASSABET_PAL_VIDEO
75 if (on)
76 ASSABET_BCR_set(ASSABET_BCR_LIGHT_ON);
77 else
78#endif
79 ASSABET_BCR_clear(ASSABET_BCR_LIGHT_ON);
80}
81
82/*
83 * Turn on/off the backlight. When turning the backlight on,
84 * we wait 500us after turning it on so we don't cause the
85 * supplies to droop when we enable the LCD controller (and
86 * cause a hard reset.)
87 */
88static void assabet_lcd_power(int on)
89{
90#ifndef ASSABET_PAL_VIDEO
91 if (on) {
92 ASSABET_BCR_set(ASSABET_BCR_LCD_ON);
93 udelay(500);
94 } else
95#endif
96 ASSABET_BCR_clear(ASSABET_BCR_LCD_ON);
97}
98
99 74
100/* 75/*
101 * Assabet flash support code. 76 * Assabet flash support code.
@@ -197,6 +172,99 @@ static struct mcp_plat_data assabet_mcp_data = {
197 .sclk_rate = 11981000, 172 .sclk_rate = 11981000,
198}; 173};
199 174
175static void assabet_lcd_set_visual(u32 visual)
176{
177 u_int is_true_color = visual == FB_VISUAL_TRUECOLOR;
178
179 if (machine_is_assabet()) {
180#if 1 // phase 4 or newer Assabet's
181 if (is_true_color)
182 ASSABET_BCR_set(ASSABET_BCR_LCD_12RGB);
183 else
184 ASSABET_BCR_clear(ASSABET_BCR_LCD_12RGB);
185#else
186 // older Assabet's
187 if (is_true_color)
188 ASSABET_BCR_clear(ASSABET_BCR_LCD_12RGB);
189 else
190 ASSABET_BCR_set(ASSABET_BCR_LCD_12RGB);
191#endif
192 }
193}
194
195#ifndef ASSABET_PAL_VIDEO
196static void assabet_lcd_backlight_power(int on)
197{
198 if (on)
199 ASSABET_BCR_set(ASSABET_BCR_LIGHT_ON);
200 else
201 ASSABET_BCR_clear(ASSABET_BCR_LIGHT_ON);
202}
203
204/*
205 * Turn on/off the backlight. When turning the backlight on, we wait
206 * 500us after turning it on so we don't cause the supplies to droop
207 * when we enable the LCD controller (and cause a hard reset.)
208 */
209static void assabet_lcd_power(int on)
210{
211 if (on) {
212 ASSABET_BCR_set(ASSABET_BCR_LCD_ON);
213 udelay(500);
214 } else
215 ASSABET_BCR_clear(ASSABET_BCR_LCD_ON);
216}
217
218/*
219 * The assabet uses a sharp LQ039Q2DS54 LCD module. It is actually
220 * takes an RGB666 signal, but we provide it with an RGB565 signal
221 * instead (def_rgb_16).
222 */
223static struct sa1100fb_mach_info lq039q2ds54_info = {
224 .pixclock = 171521, .bpp = 16,
225 .xres = 320, .yres = 240,
226
227 .hsync_len = 5, .vsync_len = 1,
228 .left_margin = 61, .upper_margin = 3,
229 .right_margin = 9, .lower_margin = 0,
230
231 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
232
233 .lccr0 = LCCR0_Color | LCCR0_Sngl | LCCR0_Act,
234 .lccr3 = LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(2),
235
236 .backlight_power = assabet_lcd_backlight_power,
237 .lcd_power = assabet_lcd_power,
238 .set_visual = assabet_lcd_set_visual,
239};
240#else
241static void assabet_pal_backlight_power(int on)
242{
243 ASSABET_BCR_clear(ASSABET_BCR_LIGHT_ON);
244}
245
246static void assabet_pal_power(int on)
247{
248 ASSABET_BCR_clear(ASSABET_BCR_LCD_ON);
249}
250
251static struct sa1100fb_mach_info pal_info = {
252 .pixclock = 67797, .bpp = 16,
253 .xres = 640, .yres = 512,
254
255 .hsync_len = 64, .vsync_len = 6,
256 .left_margin = 125, .upper_margin = 70,
257 .right_margin = 115, .lower_margin = 36,
258
259 .lccr0 = LCCR0_Color | LCCR0_Sngl | LCCR0_Act,
260 .lccr3 = LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(512),
261
262 .backlight_power = assabet_pal_backlight_power,
263 .lcd_power = assabet_pal_power,
264 .set_visual = assabet_lcd_set_visual,
265};
266#endif
267
200#ifdef CONFIG_ASSABET_NEPONSET 268#ifdef CONFIG_ASSABET_NEPONSET
201static struct resource neponset_resources[] = { 269static struct resource neponset_resources[] = {
202 DEFINE_RES_MEM(0x10000000, 0x08000000), 270 DEFINE_RES_MEM(0x10000000, 0x08000000),
@@ -241,9 +309,6 @@ static void __init assabet_init(void)
241 PPDR |= PPC_TXD3 | PPC_TXD1; 309 PPDR |= PPC_TXD3 | PPC_TXD1;
242 PPSR |= PPC_TXD3 | PPC_TXD1; 310 PPSR |= PPC_TXD3 | PPC_TXD1;
243 311
244 sa1100fb_lcd_power = assabet_lcd_power;
245 sa1100fb_backlight_power = assabet_backlight_power;
246
247 if (machine_has_neponset()) { 312 if (machine_has_neponset()) {
248 /* 313 /*
249 * Angel sets this, but other bootloaders may not. 314 * Angel sets this, but other bootloaders may not.
@@ -262,6 +327,11 @@ static void __init assabet_init(void)
262#endif 327#endif
263 } 328 }
264 329
330#ifndef ASSABET_PAL_VIDEO
331 sa11x0_register_lcd(&lq039q2ds54_info);
332#else
333 sa11x0_register_lcd(&pal_video);
334#endif
265 sa11x0_register_mtd(&assabet_flash_data, assabet_flash_resources, 335 sa11x0_register_mtd(&assabet_flash_data, assabet_flash_resources,
266 ARRAY_SIZE(assabet_flash_resources)); 336 ARRAY_SIZE(assabet_flash_resources));
267 sa11x0_register_irda(&assabet_irda_data); 337 sa11x0_register_irda(&assabet_irda_data);
diff --git a/arch/arm/mach-sa1100/collie.c b/arch/arm/mach-sa1100/collie.c
index dbe5cf719f7e..841041e11815 100644
--- a/arch/arm/mach-sa1100/collie.c
+++ b/arch/arm/mach-sa1100/collie.c
@@ -28,6 +28,8 @@
28#include <linux/gpio.h> 28#include <linux/gpio.h>
29#include <linux/pda_power.h> 29#include <linux/pda_power.h>
30 30
31#include <video/sa1100fb.h>
32
31#include <mach/hardware.h> 33#include <mach/hardware.h>
32#include <asm/mach-types.h> 34#include <asm/mach-types.h>
33#include <asm/irq.h> 35#include <asm/irq.h>
@@ -294,6 +296,20 @@ static struct resource collie_flash_resources[] = {
294 DEFINE_RES_MEM(SA1100_CS0_PHYS, SZ_32M), 296 DEFINE_RES_MEM(SA1100_CS0_PHYS, SZ_32M),
295}; 297};
296 298
299static struct sa1100fb_mach_info collie_lcd_info = {
300 .pixclock = 171521, .bpp = 16,
301 .xres = 320, .yres = 240,
302
303 .hsync_len = 5, .vsync_len = 1,
304 .left_margin = 11, .upper_margin = 2,
305 .right_margin = 30, .lower_margin = 0,
306
307 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
308
309 .lccr0 = LCCR0_Color | LCCR0_Sngl | LCCR0_Act,
310 .lccr3 = LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(2),
311};
312
297static void __init collie_init(void) 313static void __init collie_init(void)
298{ 314{
299 int ret = 0; 315 int ret = 0;
@@ -332,6 +348,7 @@ static void __init collie_init(void)
332 printk(KERN_WARNING "collie: Unable to register LoCoMo device\n"); 348 printk(KERN_WARNING "collie: Unable to register LoCoMo device\n");
333 } 349 }
334 350
351 sa11x0_register_lcd(&collie_lcd_info);
335 sa11x0_register_mtd(&collie_flash_data, collie_flash_resources, 352 sa11x0_register_mtd(&collie_flash_data, collie_flash_resources,
336 ARRAY_SIZE(collie_flash_resources)); 353 ARRAY_SIZE(collie_flash_resources));
337 sa11x0_register_mcp(&collie_mcp_data); 354 sa11x0_register_mcp(&collie_mcp_data);
diff --git a/arch/arm/mach-sa1100/generic.c b/arch/arm/mach-sa1100/generic.c
index 01a20ea35b53..0296d69622ac 100644
--- a/arch/arm/mach-sa1100/generic.c
+++ b/arch/arm/mach-sa1100/generic.c
@@ -20,6 +20,8 @@
20#include <linux/ioport.h> 20#include <linux/ioport.h>
21#include <linux/platform_device.h> 21#include <linux/platform_device.h>
22 22
23#include <video/sa1100fb.h>
24
23#include <asm/div64.h> 25#include <asm/div64.h>
24#include <mach/hardware.h> 26#include <mach/hardware.h>
25#include <asm/system.h> 27#include <asm/system.h>
@@ -247,6 +249,11 @@ static struct platform_device sa11x0fb_device = {
247 .resource = sa11x0fb_resources, 249 .resource = sa11x0fb_resources,
248}; 250};
249 251
252void sa11x0_register_lcd(struct sa1100fb_mach_info *inf)
253{
254 sa11x0_register_device(&sa11x0fb_device, inf);
255}
256
250static struct platform_device sa11x0pcmcia_device = { 257static struct platform_device sa11x0pcmcia_device = {
251 .name = "sa11x0-pcmcia", 258 .name = "sa11x0-pcmcia",
252 .id = -1, 259 .id = -1,
@@ -319,7 +326,6 @@ static struct platform_device *sa11x0_devices[] __initdata = {
319 &sa11x0uart3_device, 326 &sa11x0uart3_device,
320 &sa11x0ssp_device, 327 &sa11x0ssp_device,
321 &sa11x0pcmcia_device, 328 &sa11x0pcmcia_device,
322 &sa11x0fb_device,
323 &sa11x0rtc_device, 329 &sa11x0rtc_device,
324 &sa11x0dma_device, 330 &sa11x0dma_device,
325}; 331};
@@ -332,12 +338,6 @@ static int __init sa1100_init(void)
332 338
333arch_initcall(sa1100_init); 339arch_initcall(sa1100_init);
334 340
335void (*sa1100fb_backlight_power)(int on);
336void (*sa1100fb_lcd_power)(int on);
337
338EXPORT_SYMBOL(sa1100fb_backlight_power);
339EXPORT_SYMBOL(sa1100fb_lcd_power);
340
341 341
342/* 342/*
343 * Common I/O mapping: 343 * Common I/O mapping:
diff --git a/arch/arm/mach-sa1100/generic.h b/arch/arm/mach-sa1100/generic.h
index 33268cf6be36..5c68be858e0c 100644
--- a/arch/arm/mach-sa1100/generic.h
+++ b/arch/arm/mach-sa1100/generic.h
@@ -16,9 +16,6 @@ extern void sa11x0_restart(char, const char *);
16 mi->bank[__nr].start = (__start), \ 16 mi->bank[__nr].start = (__start), \
17 mi->bank[__nr].size = (__size) 17 mi->bank[__nr].size = (__size)
18 18
19extern void (*sa1100fb_backlight_power)(int on);
20extern void (*sa1100fb_lcd_power)(int on);
21
22extern void sa1110_mb_enable(void); 19extern void sa1110_mb_enable(void);
23extern void sa1110_mb_disable(void); 20extern void sa1110_mb_disable(void);
24 21
@@ -40,3 +37,6 @@ void sa11x0_register_irda(struct irda_platform_data *irda);
40 37
41struct mcp_plat_data; 38struct mcp_plat_data;
42void sa11x0_register_mcp(struct mcp_plat_data *data); 39void sa11x0_register_mcp(struct mcp_plat_data *data);
40
41struct sa1100fb_mach_info;
42void sa11x0_register_lcd(struct sa1100fb_mach_info *inf);
diff --git a/arch/arm/mach-sa1100/h3100.c b/arch/arm/mach-sa1100/h3100.c
index 1e6b3c105ba6..f23e7d0b2fba 100644
--- a/arch/arm/mach-sa1100/h3100.c
+++ b/arch/arm/mach-sa1100/h3100.c
@@ -14,6 +14,8 @@
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/gpio.h> 15#include <linux/gpio.h>
16 16
17#include <video/sa1100fb.h>
18
17#include <asm/mach-types.h> 19#include <asm/mach-types.h>
18#include <asm/mach/arch.h> 20#include <asm/mach/arch.h>
19#include <asm/mach/irda.h> 21#include <asm/mach/irda.h>
@@ -36,13 +38,28 @@ static void h3100_lcd_power(int enable)
36 } 38 }
37} 39}
38 40
41static struct sa1100fb_mach_info h3100_lcd_info = {
42 .pixclock = 406977, .bpp = 4,
43 .xres = 320, .yres = 240,
44
45 .hsync_len = 26, .vsync_len = 41,
46 .left_margin = 4, .upper_margin = 0,
47 .right_margin = 4, .lower_margin = 0,
48
49 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
50 .cmap_greyscale = 1,
51 .cmap_inverse = 1,
52
53 .lccr0 = LCCR0_Mono | LCCR0_4PixMono | LCCR0_Sngl | LCCR0_Pas,
54 .lccr3 = LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(2),
55
56 .lcd_power = h3100_lcd_power,
57};
39 58
40static void __init h3100_map_io(void) 59static void __init h3100_map_io(void)
41{ 60{
42 h3xxx_map_io(); 61 h3xxx_map_io();
43 62
44 sa1100fb_lcd_power = h3100_lcd_power;
45
46 /* Older bootldrs put GPIO2-9 in alternate mode on the 63 /* Older bootldrs put GPIO2-9 in alternate mode on the
47 assumption that they are used for video */ 64 assumption that they are used for video */
48 GAFR &= ~0x000001fb; 65 GAFR &= ~0x000001fb;
@@ -80,6 +97,8 @@ static void __init h3100_mach_init(void)
80{ 97{
81 h3xxx_init_gpio(h3100_default_gpio, ARRAY_SIZE(h3100_default_gpio)); 98 h3xxx_init_gpio(h3100_default_gpio, ARRAY_SIZE(h3100_default_gpio));
82 h3xxx_mach_init(); 99 h3xxx_mach_init();
100
101 sa11x0_register_lcd(&h3100_lcd_info);
83 sa11x0_register_irda(&h3100_irda_data); 102 sa11x0_register_irda(&h3100_irda_data);
84} 103}
85 104
diff --git a/arch/arm/mach-sa1100/h3600.c b/arch/arm/mach-sa1100/h3600.c
index 6b58e7460ecf..2feac56ec90d 100644
--- a/arch/arm/mach-sa1100/h3600.c
+++ b/arch/arm/mach-sa1100/h3600.c
@@ -14,6 +14,8 @@
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/gpio.h> 15#include <linux/gpio.h>
16 16
17#include <video/sa1100fb.h>
18
17#include <asm/mach-types.h> 19#include <asm/mach-types.h>
18#include <asm/mach/arch.h> 20#include <asm/mach/arch.h>
19#include <asm/mach/irda.h> 21#include <asm/mach/irda.h>
@@ -56,11 +58,35 @@ err2: gpio_free(H3XXX_EGPIO_LCD_ON);
56err1: return; 58err1: return;
57} 59}
58 60
61static const struct sa1100fb_rgb h3600_rgb_16 = {
62 .red = { .offset = 12, .length = 4, },
63 .green = { .offset = 7, .length = 4, },
64 .blue = { .offset = 1, .length = 4, },
65 .transp = { .offset = 0, .length = 0, },
66};
67
68static struct sa1100fb_mach_info h3600_lcd_info = {
69 .pixclock = 174757, .bpp = 16,
70 .xres = 320, .yres = 240,
71
72 .hsync_len = 3, .vsync_len = 3,
73 .left_margin = 12, .upper_margin = 10,
74 .right_margin = 17, .lower_margin = 1,
75
76 .cmap_static = 1,
77
78 .lccr0 = LCCR0_Color | LCCR0_Sngl | LCCR0_Act,
79 .lccr3 = LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(2),
80
81 .rgb[RGB_16] = &h3600_rgb_16,
82
83 .lcd_power = h3600_lcd_power,
84};
85
86
59static void __init h3600_map_io(void) 87static void __init h3600_map_io(void)
60{ 88{
61 h3xxx_map_io(); 89 h3xxx_map_io();
62
63 sa1100fb_lcd_power = h3600_lcd_power;
64} 90}
65 91
66/* 92/*
@@ -121,6 +147,8 @@ static void __init h3600_mach_init(void)
121{ 147{
122 h3xxx_init_gpio(h3600_default_gpio, ARRAY_SIZE(h3600_default_gpio)); 148 h3xxx_init_gpio(h3600_default_gpio, ARRAY_SIZE(h3600_default_gpio));
123 h3xxx_mach_init(); 149 h3xxx_mach_init();
150
151 sa11x0_register_lcd(&h3600_lcd_info);
124 sa11x0_register_irda(&h3600_irda_data); 152 sa11x0_register_irda(&h3600_irda_data);
125} 153}
126 154
diff --git a/arch/arm/mach-sa1100/include/mach/SA-1100.h b/arch/arm/mach-sa1100/include/mach/SA-1100.h
index 335a1ff21faf..3f2d1b60188c 100644
--- a/arch/arm/mach-sa1100/include/mach/SA-1100.h
+++ b/arch/arm/mach-sa1100/include/mach/SA-1100.h
@@ -1688,16 +1688,6 @@
1688#define LCD_Int100_0A 0xF /* LCD Intensity = 100.0% = 1 */ 1688#define LCD_Int100_0A 0xF /* LCD Intensity = 100.0% = 1 */
1689 /* (Alternative) */ 1689 /* (Alternative) */
1690 1690
1691#define LCCR0 __REG(0xB0100000) /* LCD Control Reg. 0 */
1692#define LCSR __REG(0xB0100004) /* LCD Status Reg. */
1693#define DBAR1 __REG(0xB0100010) /* LCD DMA Base Address Reg. channel 1 */
1694#define DCAR1 __REG(0xB0100014) /* LCD DMA Current Address Reg. channel 1 */
1695#define DBAR2 __REG(0xB0100018) /* LCD DMA Base Address Reg. channel 2 */
1696#define DCAR2 __REG(0xB010001C) /* LCD DMA Current Address Reg. channel 2 */
1697#define LCCR1 __REG(0xB0100020) /* LCD Control Reg. 1 */
1698#define LCCR2 __REG(0xB0100024) /* LCD Control Reg. 2 */
1699#define LCCR3 __REG(0xB0100028) /* LCD Control Reg. 3 */
1700
1701#define LCCR0_LEN 0x00000001 /* LCD ENable */ 1691#define LCCR0_LEN 0x00000001 /* LCD ENable */
1702#define LCCR0_CMS 0x00000002 /* Color/Monochrome display Select */ 1692#define LCCR0_CMS 0x00000002 /* Color/Monochrome display Select */
1703#define LCCR0_Color (LCCR0_CMS*0) /* Color display */ 1693#define LCCR0_Color (LCCR0_CMS*0) /* Color display */
diff --git a/arch/arm/mach-sa1100/include/mach/shannon.h b/arch/arm/mach-sa1100/include/mach/shannon.h
index ec27d6e12140..a0d1114c45ed 100644
--- a/arch/arm/mach-sa1100/include/mach/shannon.h
+++ b/arch/arm/mach-sa1100/include/mach/shannon.h
@@ -21,7 +21,7 @@
21#define SHANNON_GPIO_U3_RTS GPIO_GPIO (19) /* ?? */ 21#define SHANNON_GPIO_U3_RTS GPIO_GPIO (19) /* ?? */
22#define SHANNON_GPIO_U3_CTS GPIO_GPIO (20) /* ?? */ 22#define SHANNON_GPIO_U3_CTS GPIO_GPIO (20) /* ?? */
23#define SHANNON_GPIO_SENSE_12V GPIO_GPIO (21) /* Input, 12v flash unprotect detected */ 23#define SHANNON_GPIO_SENSE_12V GPIO_GPIO (21) /* Input, 12v flash unprotect detected */
24#define SHANNON_GPIO_DISP_EN GPIO_GPIO (22) /* out */ 24#define SHANNON_GPIO_DISP_EN 22 /* out */
25/* XXX GPIO 23 unaccounted for */ 25/* XXX GPIO 23 unaccounted for */
26#define SHANNON_GPIO_EJECT_0 GPIO_GPIO (24) /* in */ 26#define SHANNON_GPIO_EJECT_0 GPIO_GPIO (24) /* in */
27#define SHANNON_IRQ_GPIO_EJECT_0 IRQ_GPIO24 27#define SHANNON_IRQ_GPIO_EJECT_0 IRQ_GPIO24
diff --git a/arch/arm/mach-sa1100/lart.c b/arch/arm/mach-sa1100/lart.c
index af4e2761f3db..463a322a425b 100644
--- a/arch/arm/mach-sa1100/lart.c
+++ b/arch/arm/mach-sa1100/lart.c
@@ -6,6 +6,8 @@
6#include <linux/kernel.h> 6#include <linux/kernel.h>
7#include <linux/tty.h> 7#include <linux/tty.h>
8 8
9#include <video/sa1100fb.h>
10
9#include <mach/hardware.h> 11#include <mach/hardware.h>
10#include <asm/setup.h> 12#include <asm/setup.h>
11#include <asm/mach-types.h> 13#include <asm/mach-types.h>
@@ -26,8 +28,85 @@ static struct mcp_plat_data lart_mcp_data = {
26 .sclk_rate = 11981000, 28 .sclk_rate = 11981000,
27}; 29};
28 30
31#ifdef LART_GREY_LCD
32static struct sa1100fb_mach_info lart_grey_info = {
33 .pixclock = 150000, .bpp = 4,
34 .xres = 320, .yres = 240,
35
36 .hsync_len = 1, .vsync_len = 1,
37 .left_margin = 4, .upper_margin = 0,
38 .right_margin = 2, .lower_margin = 0,
39
40 .cmap_greyscale = 1,
41 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
42
43 .lccr0 = LCCR0_Mono | LCCR0_Sngl | LCCR0_Pas | LCCR0_4PixMono,
44 .lccr3 = LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(512),
45};
46#endif
47#ifdef LART_COLOR_LCD
48static struct sa1100fb_mach_info lart_color_info = {
49 .pixclock = 150000, .bpp = 16,
50 .xres = 320, .yres = 240,
51
52 .hsync_len = 2, .vsync_len = 3,
53 .left_margin = 69, .upper_margin = 14,
54 .right_margin = 8, .lower_margin = 4,
55
56 .lccr0 = LCCR0_Color | LCCR0_Sngl | LCCR0_Act,
57 .lccr3 = LCCR3_OutEnH | LCCR3_PixFlEdg | LCCR3_ACBsDiv(512),
58};
59#endif
60#ifdef LART_VIDEO_OUT
61static struct sa1100fb_mach_info lart_video_info = {
62 .pixclock = 39721, .bpp = 16,
63 .xres = 640, .yres = 480,
64
65 .hsync_len = 95, .vsync_len = 2,
66 .left_margin = 40, .upper_margin = 32,
67 .right_margin = 24, .lower_margin = 11,
68
69 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
70
71 .lccr0 = LCCR0_Color | LCCR0_Sngl | LCCR0_Act,
72 .lccr3 = LCCR3_OutEnL | LCCR3_PixFlEdg | LCCR3_ACBsDiv(512),
73};
74#endif
75
76#ifdef LART_KIT01_LCD
77static struct sa1100fb_mach_info lart_kit01_info = {
78 .pixclock = 63291, .bpp = 16,
79 .xres = 640, .yres = 480,
80
81 .hsync_len = 64, .vsync_len = 3,
82 .left_margin = 122, .upper_margin = 45,
83 .right_margin = 10, .lower_margin = 10,
84
85 .lccr0 = LCCR0_Color | LCCR0_Sngl | LCCR0_Act,
86 .lccr3 = LCCR3_OutEnH | LCCR3_PixFlEdg
87};
88#endif
89
29static void __init lart_init(void) 90static void __init lart_init(void)
30{ 91{
92 struct sa1100fb_mach_info *inf = NULL;
93
94#ifdef LART_GREY_LCD
95 inf = &lart_grey_info;
96#endif
97#ifdef LART_COLOR_LCD
98 inf = &lart_color_info;
99#endif
100#ifdef LART_VIDEO_OUT
101 inf = &lart_video_info;
102#endif
103#ifdef LART_KIT01_LCD
104 inf = &lart_kit01_info;
105#endif
106
107 if (inf)
108 sa11x0_register_lcd(inf);
109
31 sa11x0_register_mcp(&lart_mcp_data); 110 sa11x0_register_mcp(&lart_mcp_data);
32} 111}
33 112
diff --git a/arch/arm/mach-sa1100/shannon.c b/arch/arm/mach-sa1100/shannon.c
index 5fd615649847..77b2b9b522ac 100644
--- a/arch/arm/mach-sa1100/shannon.c
+++ b/arch/arm/mach-sa1100/shannon.c
@@ -9,6 +9,8 @@
9#include <linux/mtd/mtd.h> 9#include <linux/mtd/mtd.h>
10#include <linux/mtd/partitions.h> 10#include <linux/mtd/partitions.h>
11 11
12#include <video/sa1100fb.h>
13
12#include <mach/hardware.h> 14#include <mach/hardware.h>
13#include <asm/mach-types.h> 15#include <asm/mach-types.h>
14#include <asm/setup.h> 16#include <asm/setup.h>
@@ -54,8 +56,23 @@ static struct mcp_plat_data shannon_mcp_data = {
54 .sclk_rate = 11981000, 56 .sclk_rate = 11981000,
55}; 57};
56 58
59static struct sa1100fb_mach_info shannon_lcd_info = {
60 .pixclock = 152500, .bpp = 8,
61 .xres = 640, .yres = 480,
62
63 .hsync_len = 4, .vsync_len = 3,
64 .left_margin = 2, .upper_margin = 0,
65 .right_margin = 1, .lower_margin = 0,
66
67 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
68
69 .lccr0 = LCCR0_Color | LCCR0_Dual | LCCR0_Pas,
70 .lccr3 = LCCR3_ACBsDiv(512),
71};
72
57static void __init shannon_init(void) 73static void __init shannon_init(void)
58{ 74{
75 sa11x0_register_lcd(&shannon_lcd_info);
59 sa11x0_register_mtd(&shannon_flash_data, &shannon_flash_resource, 1); 76 sa11x0_register_mtd(&shannon_flash_data, &shannon_flash_resource, 1);
60 sa11x0_register_mcp(&shannon_mcp_data); 77 sa11x0_register_mcp(&shannon_mcp_data);
61} 78}