Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 141915
b: refs/heads/master
c: d80fb99
h: refs/heads/master
i:
  141913: 5a0e6f7
  141911: e7d9b5d
v: v3
  • Loading branch information
Zhang Rui authored and Len Brown committed Mar 28, 2009
1 parent 900a3e5 commit 43b3d6e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 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: d32f69470c2081ffdfd82740ac19f940790f9e93
refs/heads/master: d80fb99fdcd56f4934f11cc44ca016463842dc8b
12 changes: 9 additions & 3 deletions trunk/drivers/acpi/video.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ struct acpi_video_device_cap {

struct acpi_video_brightness_flags {
u8 _BCL_no_ac_battery_levels:1; /* no AC/Battery levels in _BCL */
u8 _BCL_reversed:1; /* _BCL package is in a reversed order*/
};

struct acpi_video_device_brightness {
Expand Down Expand Up @@ -744,9 +745,14 @@ acpi_video_init_brightness(struct acpi_video_device *device)
} else if (level_ac_battery > 2)
ACPI_ERROR((AE_INFO, "Too many duplicates in _BCL package\n"));

/* sort all the supported brightness levels */
sort(&br->levels[2], count - 2, sizeof(br->levels[2]),
acpi_video_cmp_level, NULL);
/* Check if the _BCL package is in a reversed order */
if (max_level == br->levels[2]) {
br->flags._BCL_reversed = 1;
sort(&br->levels[2], count - 2, sizeof(br->levels[2]),
acpi_video_cmp_level, NULL);
} else if (max_level != br->levels[count - 1])
ACPI_ERROR((AE_INFO,
"Found unordered _BCL package\n"));

br->count = count;
device->brightness = br;
Expand Down

0 comments on commit 43b3d6e

Please sign in to comment.