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
Kirill Smelkov
linux
Commits
08e4a10e
Commit
08e4a10e
authored
Feb 16, 2007
by
Len Brown
Browse files
Options
Browse Files
Download
Plain Diff
Pull bugzilla-7570 into release branch
parents
4559b438
b1028c54
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
20 deletions
+27
-20
drivers/acpi/bus.c
drivers/acpi/bus.c
+7
-8
drivers/acpi/power.c
drivers/acpi/power.c
+4
-0
drivers/acpi/thermal.c
drivers/acpi/thermal.c
+16
-12
No files found.
drivers/acpi/bus.c
View file @
08e4a10e
...
...
@@ -199,15 +199,14 @@ int acpi_bus_set_power(acpi_handle handle, int state)
* Get device's current power state if it's unknown
* This means device power state isn't initialized or previous setting failed
*/
if
(
!
device
->
flags
.
force_power_state
)
{
if
(
device
->
power
.
state
==
ACPI_STATE_UNKNOWN
)
acpi_bus_get_power
(
device
->
handle
,
&
device
->
power
.
state
);
if
(
state
==
device
->
power
.
state
)
{
ACPI_DEBUG_PRINT
((
ACPI_DB_INFO
,
"Device is already at D%d
\n
"
,
state
));
return
0
;
}
if
((
device
->
power
.
state
==
ACPI_STATE_UNKNOWN
)
||
device
->
flags
.
force_power_state
)
acpi_bus_get_power
(
device
->
handle
,
&
device
->
power
.
state
);
if
((
state
==
device
->
power
.
state
)
&&
!
device
->
flags
.
force_power_state
)
{
ACPI_DEBUG_PRINT
((
ACPI_DB_INFO
,
"Device is already at D%d
\n
"
,
state
));
return
0
;
}
if
(
!
device
->
power
.
states
[
state
].
flags
.
valid
)
{
printk
(
KERN_WARNING
PREFIX
"Device does not support D%d
\n
"
,
state
);
return
-
ENODEV
;
...
...
drivers/acpi/power.c
View file @
08e4a10e
...
...
@@ -455,6 +455,10 @@ int acpi_power_transition(struct acpi_device *device, int state)
goto
end
;
}
if
(
device
->
power
.
state
==
state
)
{
goto
end
;
}
/*
* Then we dereference all power resources used in the current list.
*/
...
...
drivers/acpi/thermal.c
View file @
08e4a10e
...
...
@@ -1356,28 +1356,32 @@ static int acpi_thermal_remove(struct acpi_device *device, int type)
static
int
acpi_thermal_resume
(
struct
acpi_device
*
device
)
{
struct
acpi_thermal
*
tz
=
NULL
;
int
i
;
int
i
,
j
,
power_state
,
result
;
if
(
!
device
||
!
acpi_driver_data
(
device
))
return
-
EINVAL
;
tz
=
acpi_driver_data
(
device
);
acpi_thermal_get_temperature
(
tz
);
for
(
i
=
0
;
i
<
ACPI_THERMAL_MAX_ACTIVE
;
i
++
)
{
if
(
tz
->
trips
.
active
[
i
].
flags
.
valid
)
{
tz
->
temperature
=
tz
->
trips
.
active
[
i
].
temperature
;
tz
->
trips
.
active
[
i
].
flags
.
enabled
=
0
;
acpi_thermal_active
(
tz
);
tz
->
state
.
active
|=
tz
->
trips
.
active
[
i
].
flags
.
enabled
;
tz
->
state
.
active_index
=
i
;
if
(
!
(
&
tz
->
trips
.
active
[
i
]))
break
;
if
(
!
tz
->
trips
.
active
[
i
].
flags
.
valid
)
break
;
tz
->
trips
.
active
[
i
].
flags
.
enabled
=
1
;
for
(
j
=
0
;
j
<
tz
->
trips
.
active
[
i
].
devices
.
count
;
j
++
)
{
result
=
acpi_bus_get_power
(
tz
->
trips
.
active
[
i
].
devices
.
handles
[
j
],
&
power_state
);
if
(
result
||
(
power_state
!=
ACPI_STATE_D0
))
{
tz
->
trips
.
active
[
i
].
flags
.
enabled
=
0
;
break
;
}
}
tz
->
state
.
active
|=
tz
->
trips
.
active
[
i
].
flags
.
enabled
;
}
acpi_thermal_check
(
tz
);
acpi_thermal_check
(
tz
);
return
AE_OK
;
}
...
...
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