Revert to Fedora kernel-2.6.17-1.2187_FC5 patched with vs2.0.2.1; there are too many...
[linux-2.6.git] / drivers / video / chipsfb.c
index 73cb426..72ff6bf 100644 (file)
  *  more details.
  */
 
+#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/string.h>
 #include <linux/mm.h>
+#include <linux/tty.h>
 #include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/delay.h>
@@ -146,23 +148,9 @@ static int chipsfb_set_par(struct fb_info *info)
 static int chipsfb_blank(int blank, struct fb_info *info)
 {
 #ifdef CONFIG_PMAC_BACKLIGHT
-       mutex_lock(&pmac_backlight_mutex);
-
-       if (pmac_backlight) {
-               /* used to disable backlight only for blank > 1, but it seems
-                * useful at blank = 1 too (saves battery, extends backlight
-                * life)
-                */
-               down(&pmac_backlight->sem);
-               if (blank)
-                       pmac_backlight->props->power = FB_BLANK_POWERDOWN;
-               else
-                       pmac_backlight->props->power = FB_BLANK_UNBLANK;
-               pmac_backlight->props->update_status(pmac_backlight);
-               up(&pmac_backlight->sem);
-       }
-
-       mutex_unlock(&pmac_backlight_mutex);
+       // used to disable backlight only for blank > 1, but it seems
+       // useful at blank = 1 too (saves battery, extends backlight life)
+       set_backlight_enable(!blank);
 #endif /* CONFIG_PMAC_BACKLIGHT */
 
        return 1;       /* get fb_blank to set the colormap to all black */
@@ -413,14 +401,7 @@ chipsfb_pci_init(struct pci_dev *dp, const struct pci_device_id *ent)
 
 #ifdef CONFIG_PMAC_BACKLIGHT
        /* turn on the backlight */
-       mutex_lock(&pmac_backlight_mutex);
-       if (pmac_backlight) {
-               down(&pmac_backlight->sem);
-               pmac_backlight->props->power = FB_BLANK_UNBLANK;
-               pmac_backlight->props->update_status(pmac_backlight);
-               up(&pmac_backlight->sem);
-       }
-       mutex_unlock(&pmac_backlight_mutex);
+       set_backlight_enable(1);
 #endif /* CONFIG_PMAC_BACKLIGHT */
 
 #ifdef CONFIG_PPC