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
63dbb867
Commit
63dbb867
authored
Jul 15, 2004
by
Len Brown
Committed by
Len Brown
Jul 15, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ACPI] Enable run-time CM button/LID events (David Shaohua Li)
http://bugzilla.kernel.org/show_bug.cgi?id=1415
parent
78fbd8ba
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
9 deletions
+52
-9
drivers/acpi/acpi_ksyms.c
drivers/acpi/acpi_ksyms.c
+2
-0
drivers/acpi/button.c
drivers/acpi/button.c
+9
-0
drivers/acpi/sleep/wakeup.c
drivers/acpi/sleep/wakeup.c
+41
-9
No files found.
drivers/acpi/acpi_ksyms.c
View file @
63dbb867
...
...
@@ -84,6 +84,8 @@ EXPORT_SYMBOL(acpi_resource_to_address64);
EXPORT_SYMBOL
(
acpi_enable_event
);
EXPORT_SYMBOL
(
acpi_disable_event
);
EXPORT_SYMBOL
(
acpi_clear_event
);
EXPORT_SYMBOL
(
acpi_set_gpe_type
);
EXPORT_SYMBOL
(
acpi_enable_gpe
);
EXPORT_SYMBOL
(
acpi_get_timer_duration
);
EXPORT_SYMBOL
(
acpi_get_timer
);
EXPORT_SYMBOL
(
acpi_get_sleep_type_data
);
...
...
drivers/acpi/button.c
View file @
63dbb867
...
...
@@ -456,6 +456,15 @@ acpi_button_add (
goto
end
;
}
if
(
device
->
wakeup
.
flags
.
valid
)
{
/* Button's GPE is run-wake GPE */
acpi_set_gpe_type
(
device
->
wakeup
.
gpe_device
,
device
->
wakeup
.
gpe_number
,
ACPI_GPE_TYPE_WAKE_RUN
);
acpi_enable_gpe
(
device
->
wakeup
.
gpe_device
,
device
->
wakeup
.
gpe_number
,
ACPI_NOT_ISR
);
device
->
wakeup
.
state
.
enabled
=
1
;
}
printk
(
KERN_INFO
PREFIX
"%s [%s]
\n
"
,
acpi_device_name
(
device
),
acpi_device_bid
(
device
));
...
...
drivers/acpi/sleep/wakeup.c
View file @
63dbb867
...
...
@@ -68,12 +68,28 @@ acpi_enable_wakeup_device(
struct
acpi_device
*
dev
=
container_of
(
node
,
struct
acpi_device
,
wakeup_list
);
/* 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
)
{
spin_unlock
(
&
acpi_device_lock
);
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
;
...
...
@@ -100,6 +116,17 @@ acpi_disable_wakeup_device (
struct
acpi_device
*
dev
=
container_of
(
node
,
struct
acpi_device
,
wakeup_list
);
if
(
dev
->
wakeup
.
flags
.
run_wake
&&
!
dev
->
wakeup
.
state
.
enabled
)
{
spin_unlock
(
&
acpi_device_lock
);
acpi_set_gpe_type
(
dev
->
wakeup
.
gpe_device
,
dev
->
wakeup
.
gpe_number
,
ACPI_GPE_TYPE_WAKE_RUN
);
/* Re-enable it, since set_gpe_type will disable it */
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
))
...
...
@@ -107,10 +134,13 @@ acpi_disable_wakeup_device (
spin_unlock
(
&
acpi_device_lock
);
acpi_disable_wakeup_device_power
(
dev
);
/* Never disable run-wake GPE */
if
(
!
dev
->
wakeup
.
flags
.
run_wake
)
{
acpi_disable_gpe
(
dev
->
wakeup
.
gpe_device
,
dev
->
wakeup
.
gpe_number
,
ACPI_NOT_ISR
);
acpi_clear_gpe
(
dev
->
wakeup
.
gpe_device
,
dev
->
wakeup
.
gpe_number
,
ACPI_NOT_ISR
);
}
dev
->
wakeup
.
state
.
active
=
0
;
spin_lock
(
&
acpi_device_lock
);
}
...
...
@@ -128,11 +158,13 @@ static int __init acpi_wakeup_device_init(void)
struct
acpi_device
*
dev
=
container_of
(
node
,
struct
acpi_device
,
wakeup_list
);
/*
Enable wakeup GPE for Lid/sleep button by default
*/
if
(
dev
->
wakeup
.
flags
.
run_wake
)
{
/*
In case user doesn't load button driver
*/
if
(
dev
->
wakeup
.
flags
.
run_wake
&&
!
dev
->
wakeup
.
state
.
enabled
)
{
spin_unlock
(
&
acpi_device_lock
);
acpi_set_gpe_type
(
dev
->
wakeup
.
gpe_device
,
dev
->
wakeup
.
gpe_number
,
ACPI_GPE_TYPE_WAKE_RUN
);
acpi_enable_gpe
(
dev
->
wakeup
.
gpe_device
,
dev
->
wakeup
.
gpe_number
,
ACPI_NOT_ISR
);
dev
->
wakeup
.
state
.
enabled
=
1
;
spin_lock
(
&
acpi_device_lock
);
}
...
...
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