[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1260258764.3315.82.camel@falcon.domain.org>
Date: Tue, 08 Dec 2009 15:52:44 +0800
From: Wu Zhangjin <wuzhangjin@...il.com>
To: Ralf Baechle <ralf@...ux-mips.org>
Cc: akpm@...ux-foundation.org, linux-mips@...ux-mips.org,
linux-kernel@...r.kernel.org,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
"Rafael J . Wysocki" <rjw@...k.pl>, zhangfx@...ote.com,
linux-laptop@...r.kernel.org,
Stephen Rothwell <sfr@...b.auug.org.au>,
Pavel Machek <pavel@....cz>
Subject: Re: [PATCH v8 3/8] Loongson: YeeLoong: add backlight driver
On Sun, 2009-12-06 at 15:01 +0800, Wu Zhangjin wrote:
> From: Wu Zhangjin <wuzhangjin@...il.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists