atmel_lcdfb: fix initialization of a pre-allocated framebuffer
authorNicolas Ferre <nicolas.ferre@atmel.com>
Wed, 14 May 2008 23:05:38 +0000 (16:05 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 15 May 2008 02:11:13 +0000 (19:11 -0700)
Fix initialization of framebuffer not calling ioremap_writecombine() function
and not using internal SRAM for at91sam9rl.

This is a little rework of the "Don't initialize a pre-allocated framebuffer"
patch that corrects the call to ioremap_writecombine() function.

It also cuts the use of internal SRAM for at91sam9rl : it is a bit small
for a framebuffer.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Andrew Victor <linux@maxim.org.za>
Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/arm/mach-at91/at91sam9261_devices.c
arch/arm/mach-at91/at91sam9rl_devices.c

index 728bb8f394415fc683d3e8b4620cdaec984992a8..0babb645b83c055ea1120706b2344c9c286d3ca2 100644 (file)
@@ -544,10 +544,10 @@ void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data)
                struct resource *fb_res = &lcdc_resources[2];
                size_t fb_len = fb_res->end - fb_res->start + 1;
 
-               fb = ioremap_writecombine(fb_res->start, fb_len);
+               fb = ioremap(fb_res->start, fb_len);
                if (fb) {
                        memset(fb, 0, fb_len);
-                       iounmap(fb, fb_len);
+                       iounmap(fb);
                }
        }
        lcdc_data = *data;
index 054689804e77571213012852f4dc771f5f70501e..450db304936ffea07453e4319d51fa7b5eb2244b 100644 (file)
@@ -332,13 +332,6 @@ static struct resource lcdc_resources[] = {
                .end    = AT91SAM9RL_ID_LCDC,
                .flags  = IORESOURCE_IRQ,
        },
-#if defined(CONFIG_FB_INTSRAM)
-       [2] = {
-               .start  = AT91SAM9RL_SRAM_BASE,
-               .end    = AT91SAM9RL_SRAM_BASE + AT91SAM9RL_SRAM_SIZE - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-#endif
 };
 
 static struct platform_device at91_lcdc_device = {
@@ -381,20 +374,6 @@ void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data)
        at91_set_B_periph(AT91_PIN_PC24, 0);    /* LCDD22 */
        at91_set_B_periph(AT91_PIN_PC25, 0);    /* LCDD23 */
 
-#ifdef CONFIG_FB_INTSRAM
-       {
-               void __iomem *fb;
-               struct resource *fb_res = &lcdc_resources[2];
-               size_t fb_len = fb_res->end - fb_res->start + 1;
-
-               fb = ioremap_writecombine(fb_res->start, fb_len);
-               if (fb) {
-                       memset(fb, 0, fb_len);
-                       iounmap(fb, fb_len);
-               }
-       }
-#endif
-
        lcdc_data = *data;
        platform_device_register(&at91_lcdc_device);
 }