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
27345a51
Commit
27345a51
authored
Oct 10, 2007
by
Len Brown
Browse files
Options
Browse Files
Download
Plain Diff
Pull bugzilla-292300 into release branch
parents
e270051d
9b039330
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
80 deletions
+40
-80
drivers/acpi/sleep/main.c
drivers/acpi/sleep/main.c
+0
-1
drivers/acpi/sleep/sleep.h
drivers/acpi/sleep/sleep.h
+0
-1
drivers/acpi/sleep/wakeup.c
drivers/acpi/sleep/wakeup.c
+40
-77
include/acpi/acpi_bus.h
include/acpi/acpi_bus.h
+0
-1
No files found.
drivers/acpi/sleep/main.c
View file @
27345a51
...
...
@@ -44,7 +44,6 @@ int acpi_sleep_prepare(u32 acpi_state)
ACPI_FLUSH_CPU_CACHE
();
acpi_enable_wakeup_device_prep
(
acpi_state
);
#endif
acpi_gpe_sleep_prepare
(
acpi_state
);
acpi_enter_sleep_state_prep
(
acpi_state
);
return
0
;
}
...
...
drivers/acpi/sleep/sleep.h
View file @
27345a51
...
...
@@ -5,6 +5,5 @@ extern int acpi_suspend (u32 state);
extern
void
acpi_enable_wakeup_device_prep
(
u8
sleep_state
);
extern
void
acpi_enable_wakeup_device
(
u8
sleep_state
);
extern
void
acpi_disable_wakeup_device
(
u8
sleep_state
);
extern
void
acpi_gpe_sleep_prepare
(
u32
sleep_state
);
extern
int
acpi_sleep_prepare
(
u32
acpi_state
);
drivers/acpi/sleep/wakeup.c
View file @
27345a51
...
...
@@ -64,36 +64,29 @@ void acpi_enable_wakeup_device(u8 sleep_state)
ACPI_FUNCTION_TRACE
(
"acpi_enable_wakeup_device"
);
spin_lock
(
&
acpi_device_lock
);
list_for_each_safe
(
node
,
next
,
&
acpi_wakeup_device_list
)
{
struct
acpi_device
*
dev
=
container_of
(
node
,
struct
acpi_device
,
wakeup_list
);
struct
acpi_device
*
dev
=
container_of
(
node
,
struct
acpi_device
,
wakeup_list
);
if
(
!
dev
->
wakeup
.
flags
.
valid
)
continue
;
/* If users want to disable run-wake GPE,
* we only disable it for wake and leave it for runtime
*/
if
(
dev
->
wakeup
.
flags
.
run_wake
&&
!
dev
->
wakeup
.
state
.
enabled
)
{
if
(
!
dev
->
wakeup
.
state
.
enabled
||
sleep_state
>
(
u32
)
dev
->
wakeup
.
sleep_state
)
{
if
(
dev
->
wakeup
.
flags
.
run_wake
)
{
spin_unlock
(
&
acpi_device_lock
);
/* set_gpe_type will disable GPE, leave it like that */
acpi_set_gpe_type
(
dev
->
wakeup
.
gpe_device
,
dev
->
wakeup
.
gpe_number
,
ACPI_GPE_TYPE_RUNTIME
);
/* Re-enable it, since set_gpe_type will disable it */
acpi_enable_gpe
(
dev
->
wakeup
.
gpe_device
,
dev
->
wakeup
.
gpe_number
,
ACPI_ISR
);
spin_lock
(
&
acpi_device_lock
);
continue
;
}
if
(
!
dev
->
wakeup
.
flags
.
valid
||
!
dev
->
wakeup
.
state
.
enabled
||
(
sleep_state
>
(
u32
)
dev
->
wakeup
.
sleep_state
))
continue
;
}
spin_unlock
(
&
acpi_device_lock
);
/* run-wake GPE has been enabled */
if
(
!
dev
->
wakeup
.
flags
.
run_wake
)
acpi_enable_gpe
(
dev
->
wakeup
.
gpe_device
,
dev
->
wakeup
.
gpe_number
,
ACPI_ISR
);
dev
->
wakeup
.
state
.
active
=
1
;
spin_lock
(
&
acpi_device_lock
);
}
spin_unlock
(
&
acpi_device_lock
);
...
...
@@ -112,11 +105,14 @@ void acpi_disable_wakeup_device(u8 sleep_state)
spin_lock
(
&
acpi_device_lock
);
list_for_each_safe
(
node
,
next
,
&
acpi_wakeup_device_list
)
{
struct
acpi_device
*
dev
=
container_of
(
node
,
struct
acpi_device
,
wakeup_list
);
struct
acpi_device
*
dev
=
container_of
(
node
,
struct
acpi_device
,
wakeup_list
);
if
(
dev
->
wakeup
.
flags
.
run_wake
&&
!
dev
->
wakeup
.
state
.
enabled
)
{
if
(
!
dev
->
wakeup
.
flags
.
valid
)
continue
;
if
(
!
dev
->
wakeup
.
state
.
enabled
||
sleep_state
>
(
u32
)
dev
->
wakeup
.
sleep_state
)
{
if
(
dev
->
wakeup
.
flags
.
run_wake
)
{
spin_unlock
(
&
acpi_device_lock
);
acpi_set_gpe_type
(
dev
->
wakeup
.
gpe_device
,
dev
->
wakeup
.
gpe_number
,
...
...
@@ -125,13 +121,9 @@ void acpi_disable_wakeup_device(u8 sleep_state)
acpi_enable_gpe
(
dev
->
wakeup
.
gpe_device
,
dev
->
wakeup
.
gpe_number
,
ACPI_NOT_ISR
);
spin_lock
(
&
acpi_device_lock
);
continue
;
}
if
(
!
dev
->
wakeup
.
flags
.
valid
||
!
dev
->
wakeup
.
state
.
active
||
(
sleep_state
>
(
u32
)
dev
->
wakeup
.
sleep_state
))
continue
;
}
spin_unlock
(
&
acpi_device_lock
);
acpi_disable_wakeup_device_power
(
dev
);
...
...
@@ -142,7 +134,6 @@ void acpi_disable_wakeup_device(u8 sleep_state)
acpi_clear_gpe
(
dev
->
wakeup
.
gpe_device
,
dev
->
wakeup
.
gpe_number
,
ACPI_NOT_ISR
);
}
dev
->
wakeup
.
state
.
active
=
0
;
spin_lock
(
&
acpi_device_lock
);
}
spin_unlock
(
&
acpi_device_lock
);
...
...
@@ -160,9 +151,9 @@ static int __init acpi_wakeup_device_init(void)
struct
acpi_device
*
dev
=
container_of
(
node
,
struct
acpi_device
,
wakeup_list
);
/* In case user doesn't load button driver */
if
(
dev
->
wakeup
.
flags
.
run_wake
&&
!
dev
->
wakeup
.
state
.
enabled
)
{
if
(
!
dev
->
wakeup
.
flags
.
run_wake
||
dev
->
wakeup
.
state
.
enabled
)
continue
;
spin_unlock
(
&
acpi_device_lock
);
acpi_set_gpe_type
(
dev
->
wakeup
.
gpe_device
,
dev
->
wakeup
.
gpe_number
,
...
...
@@ -172,36 +163,8 @@ static int __init acpi_wakeup_device_init(void)
dev
->
wakeup
.
state
.
enabled
=
1
;
spin_lock
(
&
acpi_device_lock
);
}
}
spin_unlock
(
&
acpi_device_lock
);
return
0
;
}
late_initcall
(
acpi_wakeup_device_init
);
/*
* Disable all wakeup GPEs before entering requested sleep state.
* @sleep_state: ACPI state
* Since acpi_enter_sleep_state() will disable all
* RUNTIME GPEs, we simply mark all GPES that
* are not enabled for wakeup from requested state as RUNTIME.
*/
void
acpi_gpe_sleep_prepare
(
u32
sleep_state
)
{
struct
list_head
*
node
,
*
next
;
list_for_each_safe
(
node
,
next
,
&
acpi_wakeup_device_list
)
{
struct
acpi_device
*
dev
=
container_of
(
node
,
struct
acpi_device
,
wakeup_list
);
/* The GPE can wakeup system from this state, don't touch it */
if
((
u32
)
dev
->
wakeup
.
sleep_state
>=
sleep_state
)
continue
;
/* acpi_set_gpe_type will automatically disable GPE */
acpi_set_gpe_type
(
dev
->
wakeup
.
gpe_device
,
dev
->
wakeup
.
gpe_number
,
ACPI_GPE_TYPE_RUNTIME
);
}
}
include/acpi/acpi_bus.h
View file @
27345a51
...
...
@@ -264,7 +264,6 @@ struct acpi_device_wakeup_flags {
struct
acpi_device_wakeup_state
{
u8
enabled
:
1
;
u8
active
:
1
;
};
struct
acpi_device_wakeup
{
...
...
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