lkml.org 
[lkml]   [2009]   [Dec]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v8 3/8] Loongson: YeeLoong: add backlight driver
From
Date
On Sun, 2009-12-06 at 15:01 +0800, Wu Zhangjin wrote:
> From: Wu Zhangjin <wuzhangjin@gmail.com>
>
> This patch adds YeeLoong Backlight Driver, it provides standard
> interface(/sys/class/backlight/) for user-space applications(e.g.
> kpowersave, gnome-power-manager) to control the brightness of the
> backlight.
[...]
> +static int yeeloong_set_brightness(struct backlight_device *bd)
> +{
> + unsigned int level, current_level;
> + static unsigned int old_level;
> +
> + level = (bd->props.fb_blank == FB_BLANK_UNBLANK &&
> + bd->props.power == FB_BLANK_UNBLANK) ?
> + bd->props.brightness : 0;
> +
> + if (level > MAX_BRIGHTNESS)
> + level = MAX_BRIGHTNESS;
> + else if (level < 0)
> + level = 0;
> +
> + /* Avoid to modify the brightness when EC is tuning it */
> + if (old_level != level) {
> + current_level = ec_read(REG_DISPLAY_BRIGHTNESS);
> + if (old_level == current_level)
> + ec_write(REG_DISPLAY_BRIGHTNESS, level);
> + }
> + old_level = level;

Will move the above line into the end of "if { ... }".

Regards,
Wu Zhangjin



\
 
 \ /
  Last update: 2009-12-08 08:55    [W:0.127 / U:20.028 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site