aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-at91/at91sam9261_devices.c
diff options
context:
space:
mode:
authorHaavard Skinnemoen <hskinnemoen@atmel.com>2008-04-28 05:15:19 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-28 11:58:38 -0400
commit01d3a5e7fab7732cfc5d5d4533e9378ea435295a (patch)
tree3bf547f6eaeec9c69f78e1b70cb66f67399d1abd /arch/arm/mach-at91/at91sam9261_devices.c
parent20e061fb750d36ec0ffcb2e44ed7dafa9018223b (diff)
atmel_lcdfb: don't initialize a pre-allocated framebuffer
If the user specified a fixed framebuffer address on the command line, it may have been initialized already with a splash image or something, so we shouldn't clear it. Therefore, we should only initialize the framebuffer if we allocated it ourselves. This patch also updates the AVR32 setup code to clear the framebuffer if it allocated it itself, i.e. the user didn't provide a fixed address or the reservation failed. I've updated the at91 platform code as well so that it initializes the framebuffer if it is located in SRAM, but I haven't tested that it actually works. Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com> Cc: "Antonino A. Daplas" <adaplas@pol.net> Cc: Nicolas FERRE <nicolas.ferre@rfo.atmel.com> Cc: Andrew Victor <andrew@sanpeople.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/arm/mach-at91/at91sam9261_devices.c')
-rw-r--r--arch/arm/mach-at91/at91sam9261_devices.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c
index 37cd547855b..728bb8f3944 100644
--- a/arch/arm/mach-at91/at91sam9261_devices.c
+++ b/arch/arm/mach-at91/at91sam9261_devices.c
@@ -539,6 +539,17 @@ void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data)
539 at91_set_B_periph(AT91_PIN_PB28, 0); /* LCDD23 */ 539 at91_set_B_periph(AT91_PIN_PB28, 0); /* LCDD23 */
540#endif 540#endif
541 541
542 if (ARRAY_SIZE(lcdc_resources) > 2) {
543 void __iomem *fb;
544 struct resource *fb_res = &lcdc_resources[2];
545 size_t fb_len = fb_res->end - fb_res->start + 1;
546
547 fb = ioremap_writecombine(fb_res->start, fb_len);
548 if (fb) {
549 memset(fb, 0, fb_len);
550 iounmap(fb, fb_len);
551 }
552 }
542 lcdc_data = *data; 553 lcdc_data = *data;
543 platform_device_register(&at91_lcdc_device); 554 platform_device_register(&at91_lcdc_device);
544} 555}