Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
3645ca83
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
3645ca83
编写于
1月 23, 2008
作者:
L
Len Brown
浏览文件
操作
浏览文件
下载
差异文件
Pull bugzilla-9798 into release branch
上级
0f23a6b0
ec68373c
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
43 addition
and
2 deletion
+43
-2
drivers/acpi/bus.c
drivers/acpi/bus.c
+1
-1
drivers/acpi/fan.c
drivers/acpi/fan.c
+40
-0
include/acpi/acpi_bus.h
include/acpi/acpi_bus.h
+2
-1
未找到文件。
drivers/acpi/bus.c
浏览文件 @
3645ca83
...
...
@@ -200,7 +200,7 @@ int acpi_bus_set_power(acpi_handle handle, int state)
* Get device's current power state
*/
acpi_bus_get_power
(
device
->
handle
,
&
device
->
power
.
state
);
if
(
state
==
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
;
...
...
drivers/acpi/fan.c
浏览文件 @
3645ca83
...
...
@@ -47,6 +47,8 @@ MODULE_LICENSE("GPL");
static
int
acpi_fan_add
(
struct
acpi_device
*
device
);
static
int
acpi_fan_remove
(
struct
acpi_device
*
device
,
int
type
);
static
int
acpi_fan_suspend
(
struct
acpi_device
*
device
,
pm_message_t
state
);
static
int
acpi_fan_resume
(
struct
acpi_device
*
device
);
static
const
struct
acpi_device_id
fan_device_ids
[]
=
{
{
"PNP0C0B"
,
0
},
...
...
@@ -61,6 +63,8 @@ static struct acpi_driver acpi_fan_driver = {
.
ops
=
{
.
add
=
acpi_fan_add
,
.
remove
=
acpi_fan_remove
,
.
suspend
=
acpi_fan_suspend
,
.
resume
=
acpi_fan_resume
,
},
};
...
...
@@ -191,6 +195,10 @@ static int acpi_fan_add(struct acpi_device *device)
goto
end
;
}
device
->
flags
.
force_power_state
=
1
;
acpi_bus_set_power
(
device
->
handle
,
state
);
device
->
flags
.
force_power_state
=
0
;
result
=
acpi_fan_add_fs
(
device
);
if
(
result
)
goto
end
;
...
...
@@ -216,6 +224,38 @@ static int acpi_fan_remove(struct acpi_device *device, int type)
return
0
;
}
static
int
acpi_fan_suspend
(
struct
acpi_device
*
device
,
pm_message_t
state
)
{
if
(
!
device
)
return
-
EINVAL
;
acpi_bus_set_power
(
device
->
handle
,
ACPI_STATE_D0
);
return
AE_OK
;
}
static
int
acpi_fan_resume
(
struct
acpi_device
*
device
)
{
int
result
=
0
;
int
power_state
=
0
;
if
(
!
device
)
return
-
EINVAL
;
result
=
acpi_bus_get_power
(
device
->
handle
,
&
power_state
);
if
(
result
)
{
ACPI_DEBUG_PRINT
((
ACPI_DB_ERROR
,
"Error reading fan power state
\n
"
));
return
result
;
}
device
->
flags
.
force_power_state
=
1
;
acpi_bus_set_power
(
device
->
handle
,
power_state
);
device
->
flags
.
force_power_state
=
0
;
return
result
;
}
static
int
__init
acpi_fan_init
(
void
)
{
int
result
=
0
;
...
...
include/acpi/acpi_bus.h
浏览文件 @
3645ca83
...
...
@@ -168,7 +168,8 @@ struct acpi_device_flags {
u32
power_manageable
:
1
;
u32
performance_manageable
:
1
;
u32
wake_capable
:
1
;
/* Wakeup(_PRW) supported? */
u32
reserved
:
20
;
u32
force_power_state
:
1
;
u32
reserved
:
19
;
};
/* File System */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录