Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
ebd7768d
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
161
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看板
提交
ebd7768d
编写于
7月 22, 2009
作者:
D
Dmitry Torokhov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Input: i8042 - switch to using dev_pm_ops
Signed-off-by:
N
Dmitry Torokhov
<
dtor@mail.ru
>
上级
ae78e0e0
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
18 addition
and
26 deletion
+18
-26
drivers/input/serio/i8042.c
drivers/input/serio/i8042.c
+18
-26
未找到文件。
drivers/input/serio/i8042.c
浏览文件 @
ebd7768d
...
...
@@ -923,41 +923,27 @@ static void i8042_dritek_enable(void)
#ifdef CONFIG_PM
static
bool
i8042_suspended
;
/*
* Here we try to restore the original BIOS settings. We only want to
* do that once, when we really suspend, not when we taking memory
* snapshot for swsusp (in this case we'll perform required cleanup
* as part of shutdown process).
* Here we try to restore the original BIOS settings to avoid
* upsetting it.
*/
static
int
i8042_
suspend
(
struct
platform_device
*
dev
,
pm_message_t
state
)
static
int
i8042_
pm_reset
(
struct
device
*
dev
)
{
if
(
!
i8042_suspended
&&
state
.
event
==
PM_EVENT_SUSPEND
)
i8042_controller_reset
();
i8042_suspended
=
state
.
event
==
PM_EVENT_SUSPEND
||
state
.
event
==
PM_EVENT_FREEZE
;
i8042_controller_reset
();
return
0
;
}
/*
* Here we try to reset everything back to a state in which suspended
* Here we try to reset everything back to a state we had
* before suspending.
*/
static
int
i8042_
resume
(
struct
platform_
device
*
dev
)
static
int
i8042_
pm_restore
(
struct
device
*
dev
)
{
int
error
;
/*
* Do not bother with restoring state if we haven't suspened yet
*/
if
(
!
i8042_suspended
)
return
0
;
error
=
i8042_controller_check
();
if
(
error
)
return
error
;
...
...
@@ -1001,11 +987,18 @@ static int i8042_resume(struct platform_device *dev)
if
(
i8042_ports
[
I8042_KBD_PORT_NO
].
serio
)
i8042_enable_kbd_port
();
i8042_suspended
=
false
;
i8042_interrupt
(
0
,
NULL
);
return
0
;
}
static
const
struct
dev_pm_ops
i8042_pm_ops
=
{
.
suspend
=
i8042_pm_reset
,
.
resume
=
i8042_pm_restore
,
.
poweroff
=
i8042_pm_reset
,
.
restore
=
i8042_pm_restore
,
};
#endif
/* CONFIG_PM */
/*
...
...
@@ -1251,14 +1244,13 @@ static struct platform_driver i8042_driver = {
.
driver
=
{
.
name
=
"i8042"
,
.
owner
=
THIS_MODULE
,
#ifdef CONFIG_PM
.
pm
=
&
i8042_pm_ops
,
#endif
},
.
probe
=
i8042_probe
,
.
remove
=
__devexit_p
(
i8042_remove
),
.
shutdown
=
i8042_shutdown
,
#ifdef CONFIG_PM
.
suspend
=
i8042_suspend
,
.
resume
=
i8042_resume
,
#endif
};
static
int
__init
i8042_init
(
void
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录