]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] ARM: 2687/1: i.MX framebuffer: make dmacr register platform configurable
authorSascha Hauer <sascha@saschahauer.de>
Sun, 17 Jul 2005 19:15:36 +0000 (20:15 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Sun, 17 Jul 2005 19:15:36 +0000 (20:15 +0100)
Patch from Sascha Hauer

The dmacr needs different settings on some boards. This patch makes the
register configurable by the platform part.
Also we have imxfb_disable_controller(), so lets use it.

Signed-off-by: Steven Scholz
Signed-off-by: Sascha Hauer
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
drivers/video/imxfb.c
drivers/video/imxfb.h
include/asm-arm/arch-imx/imxfb.h

index 8fe1c12a17bdd9393e4a3d298cbf311000e743bc..cabd53cec9913884981ddb38b05487d85e78e17f 100644 (file)
@@ -249,9 +249,6 @@ static void imxfb_enable_controller(struct imxfb_info *fbi)
        /* disable hardware cursor */
        LCDC_CPOS       &= ~(CPOS_CC0 | CPOS_CC1);
 
-       /* fixed burst length (see erratum 11) */
-       LCDC_DMACR = DMACR_BURST | DMACR_HM(8) | DMACR_TM(2);
-
        LCDC_RMCR = RMCR_LCDC_EN;
 
        if(fbi->backlight_power)
@@ -359,6 +356,7 @@ static int imxfb_activate_var(struct fb_var_screeninfo *var, struct fb_info *inf
        LCDC_PCR        = fbi->pcr;
        LCDC_PWMR       = fbi->pwmr;
        LCDC_LSCR1      = fbi->lscr1;
+       LCDC_DMACR      = fbi->dmacr;
 
        return 0;
 }
@@ -509,6 +507,7 @@ static int __init imxfb_init_fbinfo(struct device *dev)
        fbi->cmap_inverse               = inf->cmap_inverse;
        fbi->pcr                        = inf->pcr;
        fbi->lscr1                      = inf->lscr1;
+       fbi->dmacr                      = inf->dmacr;
        fbi->pwmr                       = inf->pwmr;
        fbi->lcd_power                  = inf->lcd_power;
        fbi->backlight_power            = inf->backlight_power;
@@ -642,12 +641,12 @@ static int imxfb_remove(struct device *dev)
 {
        struct platform_device *pdev = to_platform_device(dev);
        struct fb_info *info = dev_get_drvdata(dev);
+       struct imxfb_info *fbi = info->par;
        struct resource *res;
 
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 
-       /* disable LCD controller */
-       LCDC_RMCR &= ~RMCR_LCDC_EN;
+       imxfb_disable_controller(fbi);
 
        unregister_framebuffer(info);
 
@@ -663,8 +662,9 @@ static int imxfb_remove(struct device *dev)
 
 void  imxfb_shutdown(struct device * dev)
 {
-       /* disable LCD Controller */
-       LCDC_RMCR &= ~RMCR_LCDC_EN;
+       struct fb_info *info = dev_get_drvdata(dev);
+       struct imxfb_info *fbi = info->par;
+       imxfb_disable_controller(fbi);
 }
 
 static struct device_driver imxfb_driver = {
index 128c3ee515c7542483dead4072db2a6c7a52f0ee..e837a8b48eb833477fb38984bc2b1dfb75596059 100644 (file)
@@ -54,6 +54,7 @@ struct imxfb_info {
        u_int                   pcr;
        u_int                   pwmr;
        u_int                   lscr1;
+       u_int                   dmacr;
        u_int                   cmap_inverse:1,
                                cmap_static:1,
                                unused:30;
index 2346d454ab9ca2255ae3dc8cc555b5666d4fcc90..7dbc7bbba65d781c7b92de91268aa342824436f7 100644 (file)
@@ -25,6 +25,7 @@ struct imxfb_mach_info {
        u_int           pcr;
        u_int           pwmr;
        u_int           lscr1;
+       u_int           dmacr;
 
        u_char * fixed_screen_cpu;
        dma_addr_t fixed_screen_dma;