Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
2d405707
Commit
2d405707
authored
Apr 24, 2009
by
Len Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'bugzilla-12249' into release
parents
04a2e629
e047cca6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
21 deletions
+22
-21
drivers/acpi/video.c
drivers/acpi/video.c
+22
-21
No files found.
drivers/acpi/video.c
View file @
2d405707
...
...
@@ -809,12 +809,19 @@ 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
=
max_level
;
br
->
curr
=
level_old
=
max_level
;
if
(
!
device
->
cap
.
_BQC
)
goto
set_level
;
result
=
acpi_video_device_lcd_get_level_current
(
device
,
&
level_old
);
if
(
result
)
goto
out_free_levels
;
result
=
acpi_video_device_lcd_set_level
(
device
,
br
->
curr
);
/*
* Set the level to maximum and check if _BQC uses indexed value
*/
result
=
acpi_video_device_lcd_set_level
(
device
,
max_level
);
if
(
result
)
goto
out_free_levels
;
...
...
@@ -822,25 +829,19 @@ acpi_video_init_brightness(struct acpi_video_device *device)
if
(
result
)
goto
out_free_levels
;
if
((
level
!=
level_old
)
&&
!
br
->
flags
.
_BCM_use_index
)
{
/* Note:
* This piece of code does not work correctly if the current
* brightness levels is 0.
* But I guess boxes that boot with such a dark screen are rare
* and no more code is needed to cover this specifial case.
*/
if
(
level_ac_battery
!=
2
)
{
/*
* For now, we don't support the _BCL like this:
* 16, 15, 0, 1, 2, 3, ..., 14, 15, 16
* because we may mess up the index returned by _BQC.
* Plus: we have not got a box like this.
*/
ACPI_ERROR
((
AE_INFO
,
"_BCL not supported
\n
"
));
}
br
->
flags
.
_BQC_use_index
=
1
;
}
br
->
flags
.
_BQC_use_index
=
(
level
==
max_level
?
0
:
1
);
if
(
!
br
->
flags
.
_BQC_use_index
)
goto
set_level
;
if
(
br
->
flags
.
_BCL_reversed
)
level_old
=
(
br
->
count
-
1
)
-
level_old
;
level_old
=
br
->
levels
[
level_old
];
set_level:
result
=
acpi_video_device_lcd_set_level
(
device
,
level_old
);
if
(
result
)
goto
out_free_levels
;
ACPI_DEBUG_PRINT
((
ACPI_DB_INFO
,
"found %d brightness levels
\n
"
,
count
-
2
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment