]> err.no Git - linux-2.6/blobdiff - drivers/video/aty/radeon_backlight.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland...
[linux-2.6] / drivers / video / aty / radeon_backlight.c
index f94e4616788d9761c78ad554f72631474d7d6065..1a056adb61c836784fce99d1c0314e710f4948e8 100644 (file)
@@ -19,8 +19,6 @@
 
 #define MAX_RADEON_LEVEL 0xFF
 
-static struct backlight_properties radeon_bl_data;
-
 struct radeon_bl_privdata {
        struct radeonfb_info *rinfo;
        uint8_t negative;
@@ -49,7 +47,7 @@ static int radeon_bl_get_level_brightness(struct radeon_bl_privdata *pdata,
 
 static int radeon_bl_update_status(struct backlight_device *bd)
 {
-       struct radeon_bl_privdata *pdata = class_get_devdata(&bd->class_dev);
+       struct radeon_bl_privdata *pdata = bl_get_data(bd);
        struct radeonfb_info *rinfo = pdata->rinfo;
        u32 lvds_gen_cntl, tmpPixclksCntl;
        int level;
@@ -61,11 +59,11 @@ static int radeon_bl_update_status(struct backlight_device *bd)
         * backlight. This provides some greater power saving and the display
         * is useless without backlight anyway.
         */
-        if (bd->props->power != FB_BLANK_UNBLANK ||
-           bd->props->fb_blank != FB_BLANK_UNBLANK)
+        if (bd->props.power != FB_BLANK_UNBLANK ||
+           bd->props.fb_blank != FB_BLANK_UNBLANK)
                level = 0;
        else
-               level = bd->props->brightness;
+               level = bd->props.brightness;
 
        del_timer_sync(&rinfo->lvds_timer);
        radeon_engine_idle();
@@ -126,13 +124,12 @@ static int radeon_bl_update_status(struct backlight_device *bd)
 
 static int radeon_bl_get_brightness(struct backlight_device *bd)
 {
-       return bd->props->brightness;
+       return bd->props.brightness;
 }
 
-static struct backlight_properties radeon_bl_data = {
+static struct backlight_ops radeon_bl_data = {
        .get_brightness = radeon_bl_get_brightness,
        .update_status  = radeon_bl_update_status,
-       .max_brightness = (FB_BACKLIGHT_LEVELS - 1),
 };
 
 void radeonfb_bl_init(struct radeonfb_info *rinfo)
@@ -188,17 +185,11 @@ void radeonfb_bl_init(struct radeonfb_info *rinfo)
                 63 * FB_BACKLIGHT_MAX / MAX_RADEON_LEVEL,
                217 * FB_BACKLIGHT_MAX / MAX_RADEON_LEVEL);
 
-       bd->props->brightness = radeon_bl_data.max_brightness;
-       bd->props->power = FB_BLANK_UNBLANK;
+       bd->props.max_brightness = FB_BACKLIGHT_LEVELS - 1;
+       bd->props.brightness = bd->props.max_brightness;
+       bd->props.power = FB_BLANK_UNBLANK;
        backlight_update_status(bd);
 
-#ifdef CONFIG_PMAC_BACKLIGHT
-       mutex_lock(&pmac_backlight_mutex);
-       if (!pmac_backlight)
-               pmac_backlight = bd;
-       mutex_unlock(&pmac_backlight_mutex);
-#endif
-
        printk("radeonfb: Backlight initialized (%s)\n", name);
 
        return;
@@ -215,13 +206,7 @@ void radeonfb_bl_exit(struct radeonfb_info *rinfo)
        if (bd) {
                struct radeon_bl_privdata *pdata;
 
-#ifdef CONFIG_PMAC_BACKLIGHT
-               mutex_lock(&pmac_backlight_mutex);
-               if (pmac_backlight == bd)
-                       pmac_backlight = NULL;
-               mutex_unlock(&pmac_backlight_mutex);
-#endif
-               pdata = class_get_devdata(&bd->class_dev);
+               pdata = bl_get_data(bd);
                backlight_device_unregister(bd);
                kfree(pdata);
                rinfo->info->bl_dev = NULL;