Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 165300
b: refs/heads/master
c: 90c53ca
h: refs/heads/master
v: v3
  • Loading branch information
Zhang Rui authored and Len Brown committed Aug 31, 2009
1 parent c1a0eae commit 340888b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4a703a8fe562824f269943d995ddff35077253a9
refs/heads/master: 90c53ca426cb93d15eefea79dcf6bd15ad3ffeb4
18 changes: 14 additions & 4 deletions trunk/drivers/acpi/video.c
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ acpi_video_init_brightness(struct acpi_video_device *device)
br->flags._BCM_use_index = br->flags._BCL_use_index;

/* _BQC uses INDEX while _BCL uses VALUE in some laptops */
br->curr = level_old = max_level;
br->curr = level = max_level;

if (!device->cap._BQC)
goto set_level;
Expand All @@ -900,15 +900,25 @@ acpi_video_init_brightness(struct acpi_video_device *device)

br->flags._BQC_use_index = (level == max_level ? 0 : 1);

if (!br->flags._BQC_use_index)
if (!br->flags._BQC_use_index) {
/*
* Set the backlight to the initial state.
* On some buggy laptops, _BQC returns an uninitialized value
* when invoked for the first time, i.e. level_old is invalid.
* set the backlight to max_level in this case
*/
for (i = 2; i < br->count; i++)
if (level_old == br->levels[i])
level = level_old;
goto set_level;
}

if (br->flags._BCL_reversed)
level_old = (br->count - 1) - level_old;
level_old = br->levels[level_old];
level = br->levels[level_old];

set_level:
result = acpi_video_device_lcd_set_level(device, level_old);
result = acpi_video_device_lcd_set_level(device, level);
if (result)
goto out_free_levels;

Expand Down

0 comments on commit 340888b

Please sign in to comment.