]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/video/aty/radeon_backlight.c
[PATCH] nvidiafb: Use generic DDC reading
[linux-2.6-omap-h63xx.git] / drivers / video / aty / radeon_backlight.c
index 7de66b855d4e4e292d13182c40fafe0a44ceddac..585eb7b9e63610f43b523cde48a3414c3d6b5e5f 100644 (file)
@@ -40,14 +40,14 @@ static int radeon_bl_get_level_brightness(struct radeon_bl_privdata *pdata,
 
        mutex_unlock(&info->bl_mutex);
 
-       if (pdata->negative)
-               rlevel = MAX_RADEON_LEVEL - rlevel;
-
        if (rlevel < 0)
                rlevel = 0;
        else if (rlevel > MAX_RADEON_LEVEL)
                rlevel = MAX_RADEON_LEVEL;
 
+       if (pdata->negative)
+               rlevel = MAX_RADEON_LEVEL - rlevel;
+
        return rlevel;
 }
 
@@ -195,11 +195,11 @@ void radeonfb_bl_init(struct radeonfb_info *rinfo)
                217 * FB_BACKLIGHT_MAX / MAX_RADEON_LEVEL);
        mutex_unlock(&rinfo->info->bl_mutex);
 
-       up(&bd->sem);
+       down(&bd->sem);
        bd->props->brightness = radeon_bl_data.max_brightness;
        bd->props->power = FB_BLANK_UNBLANK;
        bd->props->update_status(bd);
-       down(&bd->sem);
+       up(&bd->sem);
 
 #ifdef CONFIG_PMAC_BACKLIGHT
        mutex_lock(&pmac_backlight_mutex);