diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-01-18 15:10:10 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-02-19 06:09:18 -0500 |
commit | 9dfec4fe6d2eb5580e5adcee8827dee3a16be49d (patch) | |
tree | 102f671cb6f9a00fb149445b3cb09e9aa207e177 /arch | |
parent | 420c34e4ccbbacab56d199e90a214e24380077dd (diff) |
ARM: integrator: switch Integrator platforms to use consolidated CLCD
This switches integrator platforms to use the consolidated CLCD
panel support, including the display capabilities. These capabilities
prevent the unsupported BGR565 mode being selected, while still
allowing RGB5551, BGR5551 and RGB565 modes.
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-integrator/Kconfig | 1 | ||||
-rw-r--r-- | arch/arm/mach-integrator/impd1.c | 5 | ||||
-rw-r--r-- | arch/arm/mach-integrator/integrator_cp.c | 65 |
3 files changed, 15 insertions, 56 deletions
diff --git a/arch/arm/mach-integrator/Kconfig b/arch/arm/mach-integrator/Kconfig index 769b0f10c834..d701d32a07f1 100644 --- a/arch/arm/mach-integrator/Kconfig +++ b/arch/arm/mach-integrator/Kconfig | |||
@@ -13,6 +13,7 @@ config ARCH_INTEGRATOR_CP | |||
13 | bool "Support Integrator/CP platform" | 13 | bool "Support Integrator/CP platform" |
14 | select ARCH_CINTEGRATOR | 14 | select ARCH_CINTEGRATOR |
15 | select ARM_TIMER_SP804 | 15 | select ARM_TIMER_SP804 |
16 | select PLAT_VERSATILE_CLCD | ||
16 | help | 17 | help |
17 | Include support for the ARM(R) Integrator CP platform. | 18 | Include support for the ARM(R) Integrator CP platform. |
18 | 19 | ||
diff --git a/arch/arm/mach-integrator/impd1.c b/arch/arm/mach-integrator/impd1.c index 5db574f8ae3f..8cbb75a96bd4 100644 --- a/arch/arm/mach-integrator/impd1.c +++ b/arch/arm/mach-integrator/impd1.c | |||
@@ -121,6 +121,7 @@ static struct clcd_panel vga = { | |||
121 | .height = -1, | 121 | .height = -1, |
122 | .tim2 = TIM2_BCD | TIM2_IPC, | 122 | .tim2 = TIM2_BCD | TIM2_IPC, |
123 | .cntl = CNTL_LCDTFT | CNTL_LCDVCOMP(1), | 123 | .cntl = CNTL_LCDTFT | CNTL_LCDVCOMP(1), |
124 | .caps = CLCD_CAP_5551, | ||
124 | .connector = IMPD1_CTRL_DISP_VGA, | 125 | .connector = IMPD1_CTRL_DISP_VGA, |
125 | .bpp = 16, | 126 | .bpp = 16, |
126 | .grayscale = 0, | 127 | .grayscale = 0, |
@@ -149,6 +150,7 @@ static struct clcd_panel svga = { | |||
149 | .tim2 = TIM2_BCD, | 150 | .tim2 = TIM2_BCD, |
150 | .cntl = CNTL_LCDTFT | CNTL_LCDVCOMP(1), | 151 | .cntl = CNTL_LCDTFT | CNTL_LCDVCOMP(1), |
151 | .connector = IMPD1_CTRL_DISP_VGA, | 152 | .connector = IMPD1_CTRL_DISP_VGA, |
153 | .caps = CLCD_CAP_5551, | ||
152 | .bpp = 16, | 154 | .bpp = 16, |
153 | .grayscale = 0, | 155 | .grayscale = 0, |
154 | }; | 156 | }; |
@@ -175,6 +177,7 @@ static struct clcd_panel prospector = { | |||
175 | .height = -1, | 177 | .height = -1, |
176 | .tim2 = TIM2_BCD, | 178 | .tim2 = TIM2_BCD, |
177 | .cntl = CNTL_LCDTFT | CNTL_LCDVCOMP(1), | 179 | .cntl = CNTL_LCDTFT | CNTL_LCDVCOMP(1), |
180 | .caps = CLCD_CAP_5551, | ||
178 | .fixedtimings = 1, | 181 | .fixedtimings = 1, |
179 | .connector = IMPD1_CTRL_DISP_LCD, | 182 | .connector = IMPD1_CTRL_DISP_LCD, |
180 | .bpp = 16, | 183 | .bpp = 16, |
@@ -206,6 +209,7 @@ static struct clcd_panel ltm10c209 = { | |||
206 | .height = -1, | 209 | .height = -1, |
207 | .tim2 = TIM2_BCD, | 210 | .tim2 = TIM2_BCD, |
208 | .cntl = CNTL_LCDTFT | CNTL_LCDVCOMP(1), | 211 | .cntl = CNTL_LCDTFT | CNTL_LCDVCOMP(1), |
212 | .caps = CLCD_CAP_5551, | ||
209 | .fixedtimings = 1, | 213 | .fixedtimings = 1, |
210 | .connector = IMPD1_CTRL_DISP_LCD, | 214 | .connector = IMPD1_CTRL_DISP_LCD, |
211 | .bpp = 16, | 215 | .bpp = 16, |
@@ -279,6 +283,7 @@ static void impd1fb_clcd_remove(struct clcd_fb *fb) | |||
279 | 283 | ||
280 | static struct clcd_board impd1_clcd_data = { | 284 | static struct clcd_board impd1_clcd_data = { |
281 | .name = "IM-PD/1", | 285 | .name = "IM-PD/1", |
286 | .caps = CLCD_CAP_5551 | CLCD_CAP_888, | ||
282 | .check = clcdfb_check, | 287 | .check = clcdfb_check, |
283 | .decode = clcdfb_decode, | 288 | .decode = clcdfb_decode, |
284 | .disable = impd1fb_clcd_disable, | 289 | .disable = impd1fb_clcd_disable, |
diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c index 860090247b3b..9c0203738aae 100644 --- a/arch/arm/mach-integrator/integrator_cp.c +++ b/arch/arm/mach-integrator/integrator_cp.c | |||
@@ -42,6 +42,8 @@ | |||
42 | 42 | ||
43 | #include <asm/hardware/timer-sp.h> | 43 | #include <asm/hardware/timer-sp.h> |
44 | 44 | ||
45 | #include <plat/clcd.h> | ||
46 | |||
45 | #include "common.h" | 47 | #include "common.h" |
46 | 48 | ||
47 | #define INTCP_PA_FLASH_BASE 0x24000000 | 49 | #define INTCP_PA_FLASH_BASE 0x24000000 |
@@ -449,30 +451,6 @@ static struct amba_device aaci_device = { | |||
449 | /* | 451 | /* |
450 | * CLCD support | 452 | * CLCD support |
451 | */ | 453 | */ |
452 | static struct clcd_panel vga = { | ||
453 | .mode = { | ||
454 | .name = "VGA", | ||
455 | .refresh = 60, | ||
456 | .xres = 640, | ||
457 | .yres = 480, | ||
458 | .pixclock = 39721, | ||
459 | .left_margin = 40, | ||
460 | .right_margin = 24, | ||
461 | .upper_margin = 32, | ||
462 | .lower_margin = 11, | ||
463 | .hsync_len = 96, | ||
464 | .vsync_len = 2, | ||
465 | .sync = 0, | ||
466 | .vmode = FB_VMODE_NONINTERLACED, | ||
467 | }, | ||
468 | .width = -1, | ||
469 | .height = -1, | ||
470 | .tim2 = TIM2_BCD | TIM2_IPC, | ||
471 | .cntl = CNTL_LCDTFT | CNTL_LCDVCOMP(1), | ||
472 | .bpp = 16, | ||
473 | .grayscale = 0, | ||
474 | }; | ||
475 | |||
476 | /* | 454 | /* |
477 | * Ensure VGA is selected. | 455 | * Ensure VGA is selected. |
478 | */ | 456 | */ |
@@ -500,49 +478,24 @@ static void cp_clcd_enable(struct clcd_fb *fb) | |||
500 | CM_CTRL_n24BITEN, val); | 478 | CM_CTRL_n24BITEN, val); |
501 | } | 479 | } |
502 | 480 | ||
503 | static unsigned long framesize = SZ_1M; | ||
504 | |||
505 | static int cp_clcd_setup(struct clcd_fb *fb) | 481 | static int cp_clcd_setup(struct clcd_fb *fb) |
506 | { | 482 | { |
507 | dma_addr_t dma; | 483 | fb->panel = versatile_clcd_get_panel("VGA"); |
508 | 484 | if (!fb->panel) | |
509 | fb->panel = &vga; | 485 | return -EINVAL; |
510 | |||
511 | fb->fb.screen_base = dma_alloc_writecombine(&fb->dev->dev, framesize, | ||
512 | &dma, GFP_KERNEL); | ||
513 | if (!fb->fb.screen_base) { | ||
514 | printk(KERN_ERR "CLCD: unable to map framebuffer\n"); | ||
515 | return -ENOMEM; | ||
516 | } | ||
517 | |||
518 | fb->fb.fix.smem_start = dma; | ||
519 | fb->fb.fix.smem_len = framesize; | ||
520 | |||
521 | return 0; | ||
522 | } | ||
523 | |||
524 | static int cp_clcd_mmap(struct clcd_fb *fb, struct vm_area_struct *vma) | ||
525 | { | ||
526 | return dma_mmap_writecombine(&fb->dev->dev, vma, | ||
527 | fb->fb.screen_base, | ||
528 | fb->fb.fix.smem_start, | ||
529 | fb->fb.fix.smem_len); | ||
530 | } | ||
531 | 486 | ||
532 | static void cp_clcd_remove(struct clcd_fb *fb) | 487 | return versatile_clcd_setup_dma(fb, SZ_1M); |
533 | { | ||
534 | dma_free_writecombine(&fb->dev->dev, fb->fb.fix.smem_len, | ||
535 | fb->fb.screen_base, fb->fb.fix.smem_start); | ||
536 | } | 488 | } |
537 | 489 | ||
538 | static struct clcd_board clcd_data = { | 490 | static struct clcd_board clcd_data = { |
539 | .name = "Integrator/CP", | 491 | .name = "Integrator/CP", |
492 | .caps = CLCD_CAP_5551 | CLCD_CAP_RGB565 | CLCD_CAP_888, | ||
540 | .check = clcdfb_check, | 493 | .check = clcdfb_check, |
541 | .decode = clcdfb_decode, | 494 | .decode = clcdfb_decode, |
542 | .enable = cp_clcd_enable, | 495 | .enable = cp_clcd_enable, |
543 | .setup = cp_clcd_setup, | 496 | .setup = cp_clcd_setup, |
544 | .mmap = cp_clcd_mmap, | 497 | .mmap = versatile_clcd_mmap_dma, |
545 | .remove = cp_clcd_remove, | 498 | .remove = versatile_clcd_remove_dma, |
546 | }; | 499 | }; |
547 | 500 | ||
548 | static struct amba_device clcd_device = { | 501 | static struct amba_device clcd_device = { |