]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/video/pxafb.c
Merge branch 'for-rmk' of git://git.kernel.org/pub/scm/linux/kernel/git/ycmiao/pxa...
[linux-2.6-omap-h63xx.git] / drivers / video / pxafb.c
index 97204497d9f7ed10de17f6290c7ac047fd6fabef..afe7a65c5603b1a88c4555edd559f47f50a10ed2 100644 (file)
@@ -69,9 +69,6 @@
 #define LCCR3_INVALID_CONFIG_MASK      (LCCR3_HSP | LCCR3_VSP |\
                                         LCCR3_PCD | LCCR3_BPP)
 
-static void (*pxafb_backlight_power)(int);
-static void (*pxafb_lcd_power)(int, struct fb_var_screeninfo *);
-
 static int pxafb_activate_var(struct fb_var_screeninfo *var,
                                struct pxafb_info *);
 static void set_ctrlr_state(struct pxafb_info *fbi, u_int state);
@@ -804,6 +801,9 @@ static int pxafb_smart_thread(void *arg)
 
 static int pxafb_smart_init(struct pxafb_info *fbi)
 {
+       if (!(fbi->lccr0 | LCCR0_LCDT))
+               return 0;
+
        fbi->smart_thread = kthread_run(pxafb_smart_thread, fbi,
                                        "lcd_refresh");
        if (IS_ERR(fbi->smart_thread)) {
@@ -811,6 +811,7 @@ static int pxafb_smart_init(struct pxafb_info *fbi)
                                __func__);
                return PTR_ERR(fbi->smart_thread);
        }
+
        return 0;
 }
 #else
@@ -973,16 +974,16 @@ static inline void __pxafb_backlight_power(struct pxafb_info *fbi, int on)
 {
        pr_debug("pxafb: backlight o%s\n", on ? "n" : "ff");
 
-       if (pxafb_backlight_power)
-               pxafb_backlight_power(on);
+       if (fbi->backlight_power)
+               fbi->backlight_power(on);
 }
 
 static inline void __pxafb_lcd_power(struct pxafb_info *fbi, int on)
 {
        pr_debug("pxafb: LCD power o%s\n", on ? "n" : "ff");
 
-       if (pxafb_lcd_power)
-               pxafb_lcd_power(on, &fbi->fb.var);
+       if (fbi->lcd_power)
+               fbi->lcd_power(on, &fbi->fb.var);
 }
 
 static void pxafb_setup_gpio(struct pxafb_info *fbi)
@@ -1372,7 +1373,7 @@ static void pxafb_decode_mach_info(struct pxafb_info *fbi,
        fbi->cmap_inverse       = inf->cmap_inverse;
        fbi->cmap_static        = inf->cmap_static;
 
-       switch (lcd_conn & 0xf) {
+       switch (lcd_conn & LCD_TYPE_MASK) {
        case LCD_TYPE_MONO_STN:
                fbi->lccr0 = LCCR0_CMS;
                break;
@@ -1426,7 +1427,7 @@ static struct pxafb_info * __devinit pxafb_init_fbinfo(struct device *dev)
        memset(fbi, 0, sizeof(struct pxafb_info));
        fbi->dev = dev;
 
-       fbi->clk = clk_get(dev, "LCDCLK");
+       fbi->clk = clk_get(dev, NULL);
        if (IS_ERR(fbi->clk)) {
                kfree(fbi);
                return NULL;
@@ -1745,8 +1746,7 @@ static int __devinit pxafb_probe(struct platform_device *dev)
                ret = -EINVAL;
                goto failed;
        }
-       pxafb_backlight_power = inf->pxafb_backlight_power;
-       pxafb_lcd_power = inf->pxafb_lcd_power;
+
        fbi = pxafb_init_fbinfo(&dev->dev);
        if (!fbi) {
                /* only reason for pxafb_init_fbinfo to fail is kmalloc */
@@ -1755,6 +1755,9 @@ static int __devinit pxafb_probe(struct platform_device *dev)
                goto failed;
        }
 
+       fbi->backlight_power = inf->pxafb_backlight_power;
+       fbi->lcd_power = inf->pxafb_lcd_power;
+
        r = platform_get_resource(dev, IORESOURCE_MEM, 0);
        if (r == NULL) {
                dev_err(&dev->dev, "no I/O memory resource defined\n");