Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
acd41d36
K
kernel_linux
项目概览
OpenHarmony
/
kernel_linux
上一次同步 3 年多
通知
13
Star
8
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kernel_linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
acd41d36
编写于
10月 22, 2008
作者:
L
Len Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'suspend' into test
上级
4dff4e7f
4fb507b6
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
76 addition
and
27 deletion
+76
-27
drivers/acpi/hardware/hwsleep.c
drivers/acpi/hardware/hwsleep.c
+18
-26
drivers/acpi/sleep/main.c
drivers/acpi/sleep/main.c
+58
-1
未找到文件。
drivers/acpi/hardware/hwsleep.c
浏览文件 @
acd41d36
...
...
@@ -78,19 +78,17 @@ acpi_set_firmware_waking_vector(acpi_physical_address physical_address)
return_ACPI_STATUS
(
status
);
}
/* Set the vector */
/*
* According to the ACPI specification 2.0c and later, the 64-bit
* waking vector should be cleared and the 32-bit waking vector should
* be used, unless we want the wake-up code to be called by the BIOS in
* Protected Mode. Some systems (for example HP dv5-1004nr) are known
* to fail to resume if the 64-bit vector is used.
*/
if
(
facs
->
version
>=
1
)
facs
->
xfirmware_waking_vector
=
0
;
if
((
facs
->
length
<
32
)
||
(
!
(
facs
->
xfirmware_waking_vector
)))
{
/*
* ACPI 1.0 FACS or short table or optional X_ field is zero
*/
facs
->
firmware_waking_vector
=
(
u32
)
physical_address
;
}
else
{
/*
* ACPI 2.0 FACS with valid X_ field
*/
facs
->
xfirmware_waking_vector
=
physical_address
;
}
facs
->
firmware_waking_vector
=
(
u32
)
physical_address
;
return_ACPI_STATUS
(
AE_OK
);
}
...
...
@@ -134,20 +132,7 @@ acpi_get_firmware_waking_vector(acpi_physical_address * physical_address)
}
/* Get the vector */
if
((
facs
->
length
<
32
)
||
(
!
(
facs
->
xfirmware_waking_vector
)))
{
/*
* ACPI 1.0 FACS or short table or optional X_ field is zero
*/
*
physical_address
=
(
acpi_physical_address
)
facs
->
firmware_waking_vector
;
}
else
{
/*
* ACPI 2.0 FACS with valid X_ field
*/
*
physical_address
=
(
acpi_physical_address
)
facs
->
xfirmware_waking_vector
;
}
*
physical_address
=
(
acpi_physical_address
)
facs
->
firmware_waking_vector
;
return_ACPI_STATUS
(
AE_OK
);
}
...
...
@@ -627,6 +612,13 @@ acpi_status acpi_leave_sleep_state(u8 sleep_state)
}
/* TBD: _WAK "sometimes" returns stuff - do we want to look at it? */
/*
* Some BIOSes assume that WAK_STS will be cleared on resume and use
* it to determine whether the system is rebooting or resuming. Clear
* it for compatibility.
*/
acpi_set_register
(
ACPI_BITREG_WAKE_STATUS
,
1
);
acpi_gbl_system_awake_and_running
=
TRUE
;
/* Enable power button */
...
...
drivers/acpi/sleep/main.c
浏览文件 @
acd41d36
...
...
@@ -15,6 +15,7 @@
#include <linux/dmi.h>
#include <linux/device.h>
#include <linux/suspend.h>
#include <linux/reboot.h>
#include <asm/io.h>
...
...
@@ -25,6 +26,36 @@
u8
sleep_states
[
ACPI_S_STATE_COUNT
];
static
u32
acpi_target_sleep_state
=
ACPI_STATE_S0
;
static
void
acpi_sleep_tts_switch
(
u32
acpi_state
)
{
union
acpi_object
in_arg
=
{
ACPI_TYPE_INTEGER
};
struct
acpi_object_list
arg_list
=
{
1
,
&
in_arg
};
acpi_status
status
=
AE_OK
;
in_arg
.
integer
.
value
=
acpi_state
;
status
=
acpi_evaluate_object
(
NULL
,
"
\\
_TTS"
,
&
arg_list
,
NULL
);
if
(
ACPI_FAILURE
(
status
)
&&
status
!=
AE_NOT_FOUND
)
{
/*
* OS can't evaluate the _TTS object correctly. Some warning
* message will be printed. But it won't break anything.
*/
printk
(
KERN_NOTICE
"Failure in evaluating _TTS object
\n
"
);
}
}
static
int
tts_notify_reboot
(
struct
notifier_block
*
this
,
unsigned
long
code
,
void
*
x
)
{
acpi_sleep_tts_switch
(
ACPI_STATE_S5
);
return
NOTIFY_DONE
;
}
static
struct
notifier_block
tts_notifier
=
{
.
notifier_call
=
tts_notify_reboot
,
.
next
=
NULL
,
.
priority
=
0
,
};
static
int
acpi_sleep_prepare
(
u32
acpi_state
)
{
#ifdef CONFIG_ACPI_SLEEP
...
...
@@ -130,6 +161,7 @@ static void acpi_pm_end(void)
* failing transition to a sleep state.
*/
acpi_target_sleep_state
=
ACPI_STATE_S0
;
acpi_sleep_tts_switch
(
acpi_target_sleep_state
);
}
#endif
/* CONFIG_ACPI_SLEEP */
...
...
@@ -154,6 +186,7 @@ static int acpi_suspend_begin(suspend_state_t pm_state)
if
(
sleep_states
[
acpi_state
])
{
acpi_target_sleep_state
=
acpi_state
;
acpi_sleep_tts_switch
(
acpi_target_sleep_state
);
}
else
{
printk
(
KERN_ERR
"ACPI does not support this state: %d
\n
"
,
pm_state
);
...
...
@@ -199,6 +232,8 @@ static int acpi_suspend_enter(suspend_state_t pm_state)
break
;
}
/* If ACPI is not enabled by the BIOS, we need to enable it here. */
acpi_enable
();
/* Reprogram control registers and execute _BFS */
acpi_leave_sleep_state_prep
(
acpi_state
);
...
...
@@ -295,6 +330,14 @@ static struct dmi_system_id __initdata acpisleep_dmi_table[] = {
DMI_MATCH
(
DMI_BOARD_NAME
,
"KN9 Series(NF-CK804)"
),
},
},
{
.
callback
=
init_old_suspend_ordering
,
.
ident
=
"HP xw4600 Workstation"
,
.
matches
=
{
DMI_MATCH
(
DMI_SYS_VENDOR
,
"Hewlett-Packard"
),
DMI_MATCH
(
DMI_PRODUCT_NAME
,
"HP xw4600 Workstation"
),
},
},
{},
};
#endif
/* CONFIG_SUSPEND */
...
...
@@ -312,6 +355,7 @@ void __init acpi_no_s4_hw_signature(void)
static
int
acpi_hibernation_begin
(
void
)
{
acpi_target_sleep_state
=
ACPI_STATE_S4
;
acpi_sleep_tts_switch
(
acpi_target_sleep_state
);
return
0
;
}
...
...
@@ -375,7 +419,15 @@ static struct platform_hibernation_ops acpi_hibernation_ops = {
*/
static
int
acpi_hibernation_begin_old
(
void
)
{
int
error
=
acpi_sleep_prepare
(
ACPI_STATE_S4
);
int
error
;
/*
* The _TTS object should always be evaluated before the _PTS object.
* When the old_suspended_ordering is true, the _PTS object is
* evaluated in the acpi_sleep_prepare.
*/
acpi_sleep_tts_switch
(
ACPI_STATE_S4
);
error
=
acpi_sleep_prepare
(
ACPI_STATE_S4
);
if
(
!
error
)
acpi_target_sleep_state
=
ACPI_STATE_S4
;
...
...
@@ -595,5 +647,10 @@ int __init acpi_sleep_init(void)
pm_power_off
=
acpi_power_off
;
}
printk
(
")
\n
"
);
/*
* Register the tts_notifier to reboot notifier list so that the _TTS
* object can also be evaluated when the system enters S5.
*/
register_reboot_notifier
(
&
tts_notifier
);
return
0
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录