| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
On Sun, 2009-12-06 at 15:01 +0800, Wu Zhangjin wrote:
> From: Wu Zhangjin <wuzhangjin@xxxxxxxxx>
>
> 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-laptop" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Site Home] [Linux ACPI] [Kernel Newbies] [Memory] [Security] [Netfilter] [Bugtraq] [Rubini] [Photo] [Yosemite] [Yosemite News] [MIPS Linux] [ARM Linux] [Linux Security] [Linux RAID] [Samba] [Video 4 Linux] [Linux Resources]
![]() |
![]() |