Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
416356fc
cloud-kernel
项目概览
openanolis
/
cloud-kernel
12 个月 前同步成功
通知
152
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
416356fc
编写于
6月 30, 2009
作者:
M
Mark Brown
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ASoC: Convert to dev_pm_ops
Signed-off-by:
N
Mark Brown
<
broonie@opensource.wolfsonmicro.com
>
上级
9ea21ebc
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
19 addition
and
11 deletion
+19
-11
sound/soc/soc-core.c
sound/soc/soc-core.c
+19
-11
未找到文件。
sound/soc/soc-core.c
浏览文件 @
416356fc
...
...
@@ -619,8 +619,9 @@ static struct snd_pcm_ops soc_pcm_ops = {
#ifdef CONFIG_PM
/* powers down audio subsystem for suspend */
static
int
soc_suspend
(
struct
platform_device
*
pdev
,
pm_message_t
state
)
static
int
soc_suspend
(
struct
device
*
dev
)
{
struct
platform_device
*
pdev
=
to_platform_device
(
dev
);
struct
snd_soc_device
*
socdev
=
platform_get_drvdata
(
pdev
);
struct
snd_soc_card
*
card
=
socdev
->
card
;
struct
snd_soc_platform
*
platform
=
card
->
platform
;
...
...
@@ -656,7 +657,7 @@ static int soc_suspend(struct platform_device *pdev, pm_message_t state)
snd_pcm_suspend_all
(
card
->
dai_link
[
i
].
pcm
);
if
(
card
->
suspend_pre
)
card
->
suspend_pre
(
pdev
,
state
);
card
->
suspend_pre
(
pdev
,
PMSG_SUSPEND
);
for
(
i
=
0
;
i
<
card
->
num_links
;
i
++
)
{
struct
snd_soc_dai
*
cpu_dai
=
card
->
dai_link
[
i
].
cpu_dai
;
...
...
@@ -682,7 +683,7 @@ static int soc_suspend(struct platform_device *pdev, pm_message_t state)
}
if
(
codec_dev
->
suspend
)
codec_dev
->
suspend
(
pdev
,
state
);
codec_dev
->
suspend
(
pdev
,
PMSG_SUSPEND
);
for
(
i
=
0
;
i
<
card
->
num_links
;
i
++
)
{
struct
snd_soc_dai
*
cpu_dai
=
card
->
dai_link
[
i
].
cpu_dai
;
...
...
@@ -691,7 +692,7 @@ static int soc_suspend(struct platform_device *pdev, pm_message_t state)
}
if
(
card
->
suspend_post
)
card
->
suspend_post
(
pdev
,
state
);
card
->
suspend_post
(
pdev
,
PMSG_SUSPEND
);
return
0
;
}
...
...
@@ -765,8 +766,9 @@ static void soc_resume_deferred(struct work_struct *work)
}
/* powers up audio subsystem after a suspend */
static
int
soc_resume
(
struct
platform_device
*
p
dev
)
static
int
soc_resume
(
struct
device
*
dev
)
{
struct
platform_device
*
pdev
=
to_platform_device
(
dev
);
struct
snd_soc_device
*
socdev
=
platform_get_drvdata
(
pdev
);
struct
snd_soc_card
*
card
=
socdev
->
card
;
struct
snd_soc_dai
*
cpu_dai
=
card
->
dai_link
[
0
].
cpu_dai
;
...
...
@@ -826,7 +828,6 @@ int snd_soc_resume_device(struct device *dev)
return
0
;
}
EXPORT_SYMBOL_GPL
(
snd_soc_resume_device
);
#else
#define soc_suspend NULL
#define soc_resume NULL
...
...
@@ -1020,32 +1021,39 @@ static int soc_remove(struct platform_device *pdev)
return
0
;
}
static
void
soc_shutdown
(
struct
platform_device
*
p
dev
)
static
int
soc_poweroff
(
struct
device
*
dev
)
{
struct
platform_device
*
pdev
=
to_platform_device
(
dev
);
struct
snd_soc_device
*
socdev
=
platform_get_drvdata
(
pdev
);
struct
snd_soc_card
*
card
=
socdev
->
card
;
if
(
!
card
->
instantiated
)
return
;
return
0
;
/* Flush out pmdown_time work - we actually do want to run it
* now, we're shutting down so no imminent restart. */
run_delayed_work
(
&
card
->
delayed_work
);
snd_soc_dapm_shutdown
(
socdev
);
return
0
;
}
static
struct
dev_pm_ops
soc_pm_ops
=
{
.
suspend
=
soc_suspend
,
.
resume
=
soc_resume
,
.
poweroff
=
soc_poweroff
,
};
/* ASoC platform driver */
static
struct
platform_driver
soc_driver
=
{
.
driver
=
{
.
name
=
"soc-audio"
,
.
owner
=
THIS_MODULE
,
.
pm
=
&
soc_pm_ops
,
},
.
probe
=
soc_probe
,
.
remove
=
soc_remove
,
.
suspend
=
soc_suspend
,
.
resume
=
soc_resume
,
.
shutdown
=
soc_shutdown
,
};
/* create a new pcm */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录