diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-01-14 06:50:04 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-02-21 06:56:19 -0500 |
commit | e1b7a72aeb8292502c97b43eceb01aea47ded40f (patch) | |
tree | e3932a7b52a5805cfff785ca9162925e34eb3095 | |
parent | 9e6720fb0cfd6edda12b408a66f4ac88e8a82e32 (diff) |
FB: sa1100: move platform data to platform files
Move platform data out of the sa1100fb driver into the various
platform files themselves.
Acked-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r-- | arch/arm/mach-sa1100/assabet.c | 40 | ||||
-rw-r--r-- | arch/arm/mach-sa1100/collie.c | 17 | ||||
-rw-r--r-- | arch/arm/mach-sa1100/generic.c | 8 | ||||
-rw-r--r-- | arch/arm/mach-sa1100/generic.h | 3 | ||||
-rw-r--r-- | arch/arm/mach-sa1100/h3100.c | 22 | ||||
-rw-r--r-- | arch/arm/mach-sa1100/h3600.c | 31 | ||||
-rw-r--r-- | arch/arm/mach-sa1100/lart.c | 79 | ||||
-rw-r--r-- | arch/arm/mach-sa1100/shannon.c | 17 | ||||
-rw-r--r-- | drivers/video/sa1100fb.c | 239 |
9 files changed, 218 insertions, 238 deletions
diff --git a/arch/arm/mach-sa1100/assabet.c b/arch/arm/mach-sa1100/assabet.c index 0c4b76ab4d8e..37fb0cd1a296 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> |
@@ -204,6 +206,39 @@ static struct mcp_plat_data assabet_mcp_data = { | |||
204 | .sclk_rate = 11981000, | 206 | .sclk_rate = 11981000, |
205 | }; | 207 | }; |
206 | 208 | ||
209 | #ifndef ASSABET_PAL_VIDEO | ||
210 | /* | ||
211 | * The assabet uses a sharp LQ039Q2DS54 LCD module. It is actually | ||
212 | * takes an RGB666 signal, but we provide it with an RGB565 signal | ||
213 | * instead (def_rgb_16). | ||
214 | */ | ||
215 | static struct sa1100fb_mach_info lq039q2ds54_info = { | ||
216 | .pixclock = 171521, .bpp = 16, | ||
217 | .xres = 320, .yres = 240, | ||
218 | |||
219 | .hsync_len = 5, .vsync_len = 1, | ||
220 | .left_margin = 61, .upper_margin = 3, | ||
221 | .right_margin = 9, .lower_margin = 0, | ||
222 | |||
223 | .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, | ||
224 | |||
225 | .lccr0 = LCCR0_Color | LCCR0_Sngl | LCCR0_Act, | ||
226 | .lccr3 = LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(2), | ||
227 | }; | ||
228 | #else | ||
229 | static struct sa1100fb_mach_info pal_info = { | ||
230 | .pixclock = 67797, .bpp = 16, | ||
231 | .xres = 640, .yres = 512, | ||
232 | |||
233 | .hsync_len = 64, .vsync_len = 6, | ||
234 | .left_margin = 125, .upper_margin = 70, | ||
235 | .right_margin = 115, .lower_margin = 36, | ||
236 | |||
237 | .lccr0 = LCCR0_Color | LCCR0_Sngl | LCCR0_Act, | ||
238 | .lccr3 = LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(512), | ||
239 | }; | ||
240 | #endif | ||
241 | |||
207 | static void __init assabet_init(void) | 242 | static void __init assabet_init(void) |
208 | { | 243 | { |
209 | /* | 244 | /* |
@@ -249,6 +284,11 @@ static void __init assabet_init(void) | |||
249 | #endif | 284 | #endif |
250 | } | 285 | } |
251 | 286 | ||
287 | #ifndef ASSABET_PAL_VIDEO | ||
288 | sa11x0_register_lcd(&lq039q2ds54_info); | ||
289 | #else | ||
290 | sa11x0_register_lcd(&pal_video); | ||
291 | #endif | ||
252 | sa11x0_register_mtd(&assabet_flash_data, assabet_flash_resources, | 292 | sa11x0_register_mtd(&assabet_flash_data, assabet_flash_resources, |
253 | ARRAY_SIZE(assabet_flash_resources)); | 293 | ARRAY_SIZE(assabet_flash_resources)); |
254 | sa11x0_register_irda(&assabet_irda_data); | 294 | sa11x0_register_irda(&assabet_irda_data); |
diff --git a/arch/arm/mach-sa1100/collie.c b/arch/arm/mach-sa1100/collie.c index fd5652118ed1..70f6cdc9e63d 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> |
@@ -310,6 +312,20 @@ static struct resource collie_flash_resources[] = { | |||
310 | } | 312 | } |
311 | }; | 313 | }; |
312 | 314 | ||
315 | static struct sa1100fb_mach_info collie_lcd_info = { | ||
316 | .pixclock = 171521, .bpp = 16, | ||
317 | .xres = 320, .yres = 240, | ||
318 | |||
319 | .hsync_len = 5, .vsync_len = 1, | ||
320 | .left_margin = 11, .upper_margin = 2, | ||
321 | .right_margin = 30, .lower_margin = 0, | ||
322 | |||
323 | .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, | ||
324 | |||
325 | .lccr0 = LCCR0_Color | LCCR0_Sngl | LCCR0_Act, | ||
326 | .lccr3 = LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(2), | ||
327 | }; | ||
328 | |||
313 | static void __init collie_init(void) | 329 | static void __init collie_init(void) |
314 | { | 330 | { |
315 | int ret = 0; | 331 | int ret = 0; |
@@ -348,6 +364,7 @@ static void __init collie_init(void) | |||
348 | printk(KERN_WARNING "collie: Unable to register LoCoMo device\n"); | 364 | printk(KERN_WARNING "collie: Unable to register LoCoMo device\n"); |
349 | } | 365 | } |
350 | 366 | ||
367 | sa11x0_register_lcd(&collie_lcd_info); | ||
351 | sa11x0_register_mtd(&collie_flash_data, collie_flash_resources, | 368 | sa11x0_register_mtd(&collie_flash_data, collie_flash_resources, |
352 | ARRAY_SIZE(collie_flash_resources)); | 369 | ARRAY_SIZE(collie_flash_resources)); |
353 | sa11x0_register_mcp(&collie_mcp_data); | 370 | sa11x0_register_mcp(&collie_mcp_data); |
diff --git a/arch/arm/mach-sa1100/generic.c b/arch/arm/mach-sa1100/generic.c index bb10ee2cb89f..f57808fb1827 100644 --- a/arch/arm/mach-sa1100/generic.c +++ b/arch/arm/mach-sa1100/generic.c | |||
@@ -19,6 +19,8 @@ | |||
19 | #include <linux/ioport.h> | 19 | #include <linux/ioport.h> |
20 | #include <linux/platform_device.h> | 20 | #include <linux/platform_device.h> |
21 | 21 | ||
22 | #include <video/sa1100fb.h> | ||
23 | |||
22 | #include <asm/div64.h> | 24 | #include <asm/div64.h> |
23 | #include <mach/hardware.h> | 25 | #include <mach/hardware.h> |
24 | #include <asm/system.h> | 26 | #include <asm/system.h> |
@@ -294,6 +296,11 @@ static struct platform_device sa11x0fb_device = { | |||
294 | .resource = sa11x0fb_resources, | 296 | .resource = sa11x0fb_resources, |
295 | }; | 297 | }; |
296 | 298 | ||
299 | void sa11x0_register_lcd(struct sa1100fb_mach_info *inf) | ||
300 | { | ||
301 | sa11x0_register_device(&sa11x0fb_device, inf); | ||
302 | } | ||
303 | |||
297 | static struct platform_device sa11x0pcmcia_device = { | 304 | static struct platform_device sa11x0pcmcia_device = { |
298 | .name = "sa11x0-pcmcia", | 305 | .name = "sa11x0-pcmcia", |
299 | .id = -1, | 306 | .id = -1, |
@@ -356,7 +363,6 @@ static struct platform_device *sa11x0_devices[] __initdata = { | |||
356 | &sa11x0uart3_device, | 363 | &sa11x0uart3_device, |
357 | &sa11x0ssp_device, | 364 | &sa11x0ssp_device, |
358 | &sa11x0pcmcia_device, | 365 | &sa11x0pcmcia_device, |
359 | &sa11x0fb_device, | ||
360 | &sa11x0rtc_device, | 366 | &sa11x0rtc_device, |
361 | }; | 367 | }; |
362 | 368 | ||
diff --git a/arch/arm/mach-sa1100/generic.h b/arch/arm/mach-sa1100/generic.h index 33268cf6be36..3b903f42464d 100644 --- a/arch/arm/mach-sa1100/generic.h +++ b/arch/arm/mach-sa1100/generic.h | |||
@@ -40,3 +40,6 @@ void sa11x0_register_irda(struct irda_platform_data *irda); | |||
40 | 40 | ||
41 | struct mcp_plat_data; | 41 | struct mcp_plat_data; |
42 | void sa11x0_register_mcp(struct mcp_plat_data *data); | 42 | void sa11x0_register_mcp(struct mcp_plat_data *data); |
43 | |||
44 | struct sa1100fb_mach_info; | ||
45 | void 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..1f8a271dc668 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,26 @@ static void h3100_lcd_power(int enable) | |||
36 | } | 38 | } |
37 | } | 39 | } |
38 | 40 | ||
41 | static 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 | }; | ||
39 | 56 | ||
40 | static void __init h3100_map_io(void) | 57 | static void __init h3100_map_io(void) |
41 | { | 58 | { |
42 | h3xxx_map_io(); | 59 | h3xxx_map_io(); |
43 | 60 | ||
44 | sa1100fb_lcd_power = h3100_lcd_power; | ||
45 | |||
46 | /* Older bootldrs put GPIO2-9 in alternate mode on the | 61 | /* Older bootldrs put GPIO2-9 in alternate mode on the |
47 | assumption that they are used for video */ | 62 | assumption that they are used for video */ |
48 | GAFR &= ~0x000001fb; | 63 | GAFR &= ~0x000001fb; |
@@ -80,6 +95,9 @@ static void __init h3100_mach_init(void) | |||
80 | { | 95 | { |
81 | h3xxx_init_gpio(h3100_default_gpio, ARRAY_SIZE(h3100_default_gpio)); | 96 | h3xxx_init_gpio(h3100_default_gpio, ARRAY_SIZE(h3100_default_gpio)); |
82 | h3xxx_mach_init(); | 97 | h3xxx_mach_init(); |
98 | |||
99 | sa1100fb_lcd_power = h3100_lcd_power; | ||
100 | sa11x0_register_lcd(&h3100_lcd_info); | ||
83 | sa11x0_register_irda(&h3100_irda_data); | 101 | sa11x0_register_irda(&h3100_irda_data); |
84 | } | 102 | } |
85 | 103 | ||
diff --git a/arch/arm/mach-sa1100/h3600.c b/arch/arm/mach-sa1100/h3600.c index 6b58e7460ecf..3dd39bfe348d 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,33 @@ err2: gpio_free(H3XXX_EGPIO_LCD_ON); | |||
56 | err1: return; | 58 | err1: return; |
57 | } | 59 | } |
58 | 60 | ||
61 | static 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 | |||
68 | static 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 | |||
84 | |||
59 | static void __init h3600_map_io(void) | 85 | static void __init h3600_map_io(void) |
60 | { | 86 | { |
61 | h3xxx_map_io(); | 87 | h3xxx_map_io(); |
62 | |||
63 | sa1100fb_lcd_power = h3600_lcd_power; | ||
64 | } | 88 | } |
65 | 89 | ||
66 | /* | 90 | /* |
@@ -121,6 +145,9 @@ static void __init h3600_mach_init(void) | |||
121 | { | 145 | { |
122 | h3xxx_init_gpio(h3600_default_gpio, ARRAY_SIZE(h3600_default_gpio)); | 146 | h3xxx_init_gpio(h3600_default_gpio, ARRAY_SIZE(h3600_default_gpio)); |
123 | h3xxx_mach_init(); | 147 | h3xxx_mach_init(); |
148 | |||
149 | sa1100fb_lcd_power = h3600_lcd_power; | ||
150 | sa11x0_register_lcd(&h3600_lcd_info); | ||
124 | sa11x0_register_irda(&h3600_irda_data); | 151 | sa11x0_register_irda(&h3600_irda_data); |
125 | } | 152 | } |
126 | 153 | ||
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 | ||
32 | static 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 | ||
48 | static 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 | ||
61 | static 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 | ||
77 | static 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 | |||
29 | static void __init lart_init(void) | 90 | static 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 318b2b766a0b..c695b730bd69 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> |
@@ -57,8 +59,23 @@ static struct mcp_plat_data shannon_mcp_data = { | |||
57 | .sclk_rate = 11981000, | 59 | .sclk_rate = 11981000, |
58 | }; | 60 | }; |
59 | 61 | ||
62 | static struct sa1100fb_mach_info shannon_lcd_info = { | ||
63 | .pixclock = 152500, .bpp = 8, | ||
64 | .xres = 640, .yres = 480, | ||
65 | |||
66 | .hsync_len = 4, .vsync_len = 3, | ||
67 | .left_margin = 2, .upper_margin = 0, | ||
68 | .right_margin = 1, .lower_margin = 0, | ||
69 | |||
70 | .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, | ||
71 | |||
72 | .lccr0 = LCCR0_Color | LCCR0_Dual | LCCR0_Pas, | ||
73 | .lccr3 = LCCR3_ACBsDiv(512), | ||
74 | }; | ||
75 | |||
60 | static void __init shannon_init(void) | 76 | static void __init shannon_init(void) |
61 | { | 77 | { |
78 | sa11x0_register_lcd(&shannon_lcd_info); | ||
62 | sa11x0_register_mtd(&shannon_flash_data, &shannon_flash_resource, 1); | 79 | sa11x0_register_mtd(&shannon_flash_data, &shannon_flash_resource, 1); |
63 | sa11x0_register_mcp(&shannon_mcp_data); | 80 | sa11x0_register_mcp(&shannon_mcp_data); |
64 | } | 81 | } |
diff --git a/drivers/video/sa1100fb.c b/drivers/video/sa1100fb.c index 8f5557a12ff8..d645c6d5fd9f 100644 --- a/drivers/video/sa1100fb.c +++ b/drivers/video/sa1100fb.c | |||
@@ -218,235 +218,7 @@ static const struct sa1100fb_rgb def_rgb_16 = { | |||
218 | .transp = { .offset = 0, .length = 0, }, | 218 | .transp = { .offset = 0, .length = 0, }, |
219 | }; | 219 | }; |
220 | 220 | ||
221 | #ifdef CONFIG_SA1100_ASSABET | ||
222 | #ifndef ASSABET_PAL_VIDEO | ||
223 | /* | ||
224 | * The assabet uses a sharp LQ039Q2DS54 LCD module. It is actually | ||
225 | * takes an RGB666 signal, but we provide it with an RGB565 signal | ||
226 | * instead (def_rgb_16). | ||
227 | */ | ||
228 | static struct sa1100fb_mach_info lq039q2ds54_info __devinitdata = { | ||
229 | .pixclock = 171521, .bpp = 16, | ||
230 | .xres = 320, .yres = 240, | ||
231 | |||
232 | .hsync_len = 5, .vsync_len = 1, | ||
233 | .left_margin = 61, .upper_margin = 3, | ||
234 | .right_margin = 9, .lower_margin = 0, | ||
235 | |||
236 | .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, | ||
237 | |||
238 | .lccr0 = LCCR0_Color | LCCR0_Sngl | LCCR0_Act, | ||
239 | .lccr3 = LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(2), | ||
240 | }; | ||
241 | #else | ||
242 | static struct sa1100fb_mach_info pal_info __devinitdata = { | ||
243 | .pixclock = 67797, .bpp = 16, | ||
244 | .xres = 640, .yres = 512, | ||
245 | |||
246 | .hsync_len = 64, .vsync_len = 6, | ||
247 | .left_margin = 125, .upper_margin = 70, | ||
248 | .right_margin = 115, .lower_margin = 36, | ||
249 | |||
250 | .lccr0 = LCCR0_Color | LCCR0_Sngl | LCCR0_Act, | ||
251 | .lccr3 = LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(512), | ||
252 | }; | ||
253 | #endif | ||
254 | #endif | ||
255 | |||
256 | #ifdef CONFIG_SA1100_H3600 | ||
257 | static const struct sa1100fb_rgb h3600_rgb_16 = { | ||
258 | .red = { .offset = 12, .length = 4, }, | ||
259 | .green = { .offset = 7, .length = 4, }, | ||
260 | .blue = { .offset = 1, .length = 4, }, | ||
261 | .transp = { .offset = 0, .length = 0, }, | ||
262 | }; | ||
263 | |||
264 | static struct sa1100fb_mach_info h3600_info __devinitdata = { | ||
265 | .pixclock = 174757, .bpp = 16, | ||
266 | .xres = 320, .yres = 240, | ||
267 | |||
268 | .hsync_len = 3, .vsync_len = 3, | ||
269 | .left_margin = 12, .upper_margin = 10, | ||
270 | .right_margin = 17, .lower_margin = 1, | ||
271 | |||
272 | .cmap_static = 1, | ||
273 | |||
274 | .lccr0 = LCCR0_Color | LCCR0_Sngl | LCCR0_Act, | ||
275 | .lccr3 = LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(2), | ||
276 | |||
277 | .rgb[RGB_16] = &h3600_rgb_16, | ||
278 | }; | ||
279 | #endif | ||
280 | |||
281 | #ifdef CONFIG_SA1100_H3100 | ||
282 | static struct sa1100fb_mach_info h3100_info __devinitdata = { | ||
283 | .pixclock = 406977, .bpp = 4, | ||
284 | .xres = 320, .yres = 240, | ||
285 | 221 | ||
286 | .hsync_len = 26, .vsync_len = 41, | ||
287 | .left_margin = 4, .upper_margin = 0, | ||
288 | .right_margin = 4, .lower_margin = 0, | ||
289 | |||
290 | .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, | ||
291 | .cmap_greyscale = 1, | ||
292 | .cmap_inverse = 1, | ||
293 | |||
294 | .lccr0 = LCCR0_Mono | LCCR0_4PixMono | LCCR0_Sngl | LCCR0_Pas, | ||
295 | .lccr3 = LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(2), | ||
296 | }; | ||
297 | #endif | ||
298 | |||
299 | #ifdef CONFIG_SA1100_COLLIE | ||
300 | static struct sa1100fb_mach_info collie_info __devinitdata = { | ||
301 | .pixclock = 171521, .bpp = 16, | ||
302 | .xres = 320, .yres = 240, | ||
303 | |||
304 | .hsync_len = 5, .vsync_len = 1, | ||
305 | .left_margin = 11, .upper_margin = 2, | ||
306 | .right_margin = 30, .lower_margin = 0, | ||
307 | |||
308 | .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, | ||
309 | |||
310 | .lccr0 = LCCR0_Color | LCCR0_Sngl | LCCR0_Act, | ||
311 | .lccr3 = LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(2), | ||
312 | }; | ||
313 | #endif | ||
314 | |||
315 | #ifdef LART_GREY_LCD | ||
316 | static struct sa1100fb_mach_info lart_grey_info __devinitdata = { | ||
317 | .pixclock = 150000, .bpp = 4, | ||
318 | .xres = 320, .yres = 240, | ||
319 | |||
320 | .hsync_len = 1, .vsync_len = 1, | ||
321 | .left_margin = 4, .upper_margin = 0, | ||
322 | .right_margin = 2, .lower_margin = 0, | ||
323 | |||
324 | .cmap_greyscale = 1, | ||
325 | .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, | ||
326 | |||
327 | .lccr0 = LCCR0_Mono | LCCR0_Sngl | LCCR0_Pas | LCCR0_4PixMono, | ||
328 | .lccr3 = LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(512), | ||
329 | }; | ||
330 | #endif | ||
331 | #ifdef LART_COLOR_LCD | ||
332 | static struct sa1100fb_mach_info lart_color_info __devinitdata = { | ||
333 | .pixclock = 150000, .bpp = 16, | ||
334 | .xres = 320, .yres = 240, | ||
335 | |||
336 | .hsync_len = 2, .vsync_len = 3, | ||
337 | .left_margin = 69, .upper_margin = 14, | ||
338 | .right_margin = 8, .lower_margin = 4, | ||
339 | |||
340 | .lccr0 = LCCR0_Color | LCCR0_Sngl | LCCR0_Act, | ||
341 | .lccr3 = LCCR3_OutEnH | LCCR3_PixFlEdg | LCCR3_ACBsDiv(512), | ||
342 | }; | ||
343 | #endif | ||
344 | #ifdef LART_VIDEO_OUT | ||
345 | static struct sa1100fb_mach_info lart_video_info __devinitdata = { | ||
346 | .pixclock = 39721, .bpp = 16, | ||
347 | .xres = 640, .yres = 480, | ||
348 | |||
349 | .hsync_len = 95, .vsync_len = 2, | ||
350 | .left_margin = 40, .upper_margin = 32, | ||
351 | .right_margin = 24, .lower_margin = 11, | ||
352 | |||
353 | .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, | ||
354 | |||
355 | .lccr0 = LCCR0_Color | LCCR0_Sngl | LCCR0_Act, | ||
356 | .lccr3 = LCCR3_OutEnL | LCCR3_PixFlEdg | LCCR3_ACBsDiv(512), | ||
357 | }; | ||
358 | #endif | ||
359 | |||
360 | #ifdef LART_KIT01_LCD | ||
361 | static struct sa1100fb_mach_info lart_kit01_info __devinitdata = { | ||
362 | .pixclock = 63291, .bpp = 16, | ||
363 | .xres = 640, .yres = 480, | ||
364 | |||
365 | .hsync_len = 64, .vsync_len = 3, | ||
366 | .left_margin = 122, .upper_margin = 45, | ||
367 | .right_margin = 10, .lower_margin = 10, | ||
368 | |||
369 | .lccr0 = LCCR0_Color | LCCR0_Sngl | LCCR0_Act, | ||
370 | .lccr3 = LCCR3_OutEnH | LCCR3_PixFlEdg | ||
371 | }; | ||
372 | #endif | ||
373 | |||
374 | #ifdef CONFIG_SA1100_SHANNON | ||
375 | static struct sa1100fb_mach_info shannon_info __devinitdata = { | ||
376 | .pixclock = 152500, .bpp = 8, | ||
377 | .xres = 640, .yres = 480, | ||
378 | |||
379 | .hsync_len = 4, .vsync_len = 3, | ||
380 | .left_margin = 2, .upper_margin = 0, | ||
381 | .right_margin = 1, .lower_margin = 0, | ||
382 | |||
383 | .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, | ||
384 | |||
385 | .lccr0 = LCCR0_Color | LCCR0_Dual | LCCR0_Pas, | ||
386 | .lccr3 = LCCR3_ACBsDiv(512), | ||
387 | }; | ||
388 | #endif | ||
389 | |||
390 | |||
391 | |||
392 | static struct sa1100fb_mach_info * __devinit | ||
393 | sa1100fb_get_machine_info(struct sa1100fb_info *fbi) | ||
394 | { | ||
395 | struct sa1100fb_mach_info *inf = NULL; | ||
396 | |||
397 | /* | ||
398 | * R G B T | ||
399 | * default {11,5}, { 5,6}, { 0,5}, { 0,0} | ||
400 | * h3600 {12,4}, { 7,4}, { 1,4}, { 0,0} | ||
401 | * freebird { 8,4}, { 4,4}, { 0,4}, {12,4} | ||
402 | */ | ||
403 | #ifdef CONFIG_SA1100_ASSABET | ||
404 | if (machine_is_assabet()) { | ||
405 | #ifndef ASSABET_PAL_VIDEO | ||
406 | inf = &lq039q2ds54_info; | ||
407 | #else | ||
408 | inf = &pal_info; | ||
409 | #endif | ||
410 | } | ||
411 | #endif | ||
412 | #ifdef CONFIG_SA1100_H3100 | ||
413 | if (machine_is_h3100()) { | ||
414 | inf = &h3100_info; | ||
415 | } | ||
416 | #endif | ||
417 | #ifdef CONFIG_SA1100_H3600 | ||
418 | if (machine_is_h3600()) { | ||
419 | inf = &h3600_info; | ||
420 | } | ||
421 | #endif | ||
422 | #ifdef CONFIG_SA1100_COLLIE | ||
423 | if (machine_is_collie()) { | ||
424 | inf = &collie_info; | ||
425 | } | ||
426 | #endif | ||
427 | #ifdef CONFIG_SA1100_LART | ||
428 | if (machine_is_lart()) { | ||
429 | #ifdef LART_GREY_LCD | ||
430 | inf = &lart_grey_info; | ||
431 | #endif | ||
432 | #ifdef LART_COLOR_LCD | ||
433 | inf = &lart_color_info; | ||
434 | #endif | ||
435 | #ifdef LART_VIDEO_OUT | ||
436 | inf = &lart_video_info; | ||
437 | #endif | ||
438 | #ifdef LART_KIT01_LCD | ||
439 | inf = &lart_kit01_info; | ||
440 | #endif | ||
441 | } | ||
442 | #endif | ||
443 | #ifdef CONFIG_SA1100_SHANNON | ||
444 | if (machine_is_shannon()) { | ||
445 | inf = &shannon_info; | ||
446 | } | ||
447 | #endif | ||
448 | return inf; | ||
449 | } | ||
450 | 222 | ||
451 | static int sa1100fb_activate_var(struct fb_var_screeninfo *var, struct sa1100fb_info *); | 223 | static int sa1100fb_activate_var(struct fb_var_screeninfo *var, struct sa1100fb_info *); |
452 | static void set_ctrlr_state(struct sa1100fb_info *fbi, u_int state); | 224 | static void set_ctrlr_state(struct sa1100fb_info *fbi, u_int state); |
@@ -1353,7 +1125,7 @@ static struct fb_monspecs monspecs __devinitdata = { | |||
1353 | 1125 | ||
1354 | static struct sa1100fb_info * __devinit sa1100fb_init_fbinfo(struct device *dev) | 1126 | static struct sa1100fb_info * __devinit sa1100fb_init_fbinfo(struct device *dev) |
1355 | { | 1127 | { |
1356 | struct sa1100fb_mach_info *inf; | 1128 | struct sa1100fb_mach_info *inf = dev->platform_data; |
1357 | struct sa1100fb_info *fbi; | 1129 | struct sa1100fb_info *fbi; |
1358 | unsigned i; | 1130 | unsigned i; |
1359 | 1131 | ||
@@ -1390,10 +1162,6 @@ static struct sa1100fb_info * __devinit sa1100fb_init_fbinfo(struct device *dev) | |||
1390 | fbi->rgb[RGB_8] = &rgb_8; | 1162 | fbi->rgb[RGB_8] = &rgb_8; |
1391 | fbi->rgb[RGB_16] = &def_rgb_16; | 1163 | fbi->rgb[RGB_16] = &def_rgb_16; |
1392 | 1164 | ||
1393 | inf = dev->platform_data; | ||
1394 | if (!inf) | ||
1395 | inf = sa1100fb_get_machine_info(fbi); | ||
1396 | |||
1397 | /* | 1165 | /* |
1398 | * People just don't seem to get this. We don't support | 1166 | * People just don't seem to get this. We don't support |
1399 | * anything but correct entries now, so panic if someone | 1167 | * anything but correct entries now, so panic if someone |
@@ -1447,6 +1215,11 @@ static int __devinit sa1100fb_probe(struct platform_device *pdev) | |||
1447 | struct sa1100fb_info *fbi; | 1215 | struct sa1100fb_info *fbi; |
1448 | int ret, irq; | 1216 | int ret, irq; |
1449 | 1217 | ||
1218 | if (!pdev->dev.platform_data) { | ||
1219 | dev_err(&pdev->dev, "no platform LCD data\n"); | ||
1220 | return -EINVAL; | ||
1221 | } | ||
1222 | |||
1450 | irq = platform_get_irq(pdev, 0); | 1223 | irq = platform_get_irq(pdev, 0); |
1451 | if (irq < 0) | 1224 | if (irq < 0) |
1452 | return -EINVAL; | 1225 | return -EINVAL; |