backlight: Fix backlight limiting on spitz/corgi devices
authorPavel Machek <pavel@ucw.cz>
Fri, 6 Nov 2009 15:58:31 +0000 (15:58 +0000)
committerRichard Purdie <rpurdie@linux.intel.com>
Mon, 16 Nov 2009 11:50:41 +0000 (11:50 +0000)
On spitz (& similar) machines, if battery is running low, backlight
needs
to be limited to lower step.  Unfortunately, current code uses &= for
limiting, turning backlight off completely for some backlight settings.
Fix that.

Signed-off-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
drivers/video/backlight/corgi_lcd.c

index 2211a852af9cfbfa01bb0af08fd88d492456afdb..96774949cd30ba3964ea1340e47a3524f841c08b 100644 (file)
@@ -433,8 +433,9 @@ static int corgi_bl_update_status(struct backlight_device *bd)
 
        if (corgibl_flags & CORGIBL_SUSPENDED)
                intensity = 0;
-       if (corgibl_flags & CORGIBL_BATTLOW)
-               intensity &= lcd->limit_mask;
+
+       if ((corgibl_flags & CORGIBL_BATTLOW) && intensity > lcd->limit_mask)
+               intensity = lcd->limit_mask;
 
        return corgi_bl_set_intensity(lcd, intensity);
 }