Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
4ae8be8e
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
4ae8be8e
编写于
2月 19, 2017
作者:
M
Mark Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'asoc/topic/component' into asoc-next
上级
39bc30f2
96241bae
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
50 addition
and
44 deletion
+50
-44
include/sound/soc.h
include/sound/soc.h
+6
-12
sound/soc/soc-core.c
sound/soc/soc-core.c
+21
-0
sound/soc/soc-pcm.c
sound/soc/soc-pcm.c
+23
-32
未找到文件。
include/sound/soc.h
浏览文件 @
4ae8be8e
...
...
@@ -507,9 +507,6 @@ int snd_soc_params_to_bclk(struct snd_pcm_hw_params *parms);
int
snd_soc_set_runtime_hwparams
(
struct
snd_pcm_substream
*
substream
,
const
struct
snd_pcm_hardware
*
hw
);
int
snd_soc_platform_trigger
(
struct
snd_pcm_substream
*
substream
,
int
cmd
,
struct
snd_soc_platform
*
platform
);
int
soc_dai_hw_params
(
struct
snd_pcm_substream
*
substream
,
struct
snd_pcm_hw_params
*
params
,
struct
snd_soc_dai
*
dai
);
...
...
@@ -785,6 +782,10 @@ struct snd_soc_component_driver {
int
(
*
suspend
)(
struct
snd_soc_component
*
);
int
(
*
resume
)(
struct
snd_soc_component
*
);
/* pcm creation and destruction */
int
(
*
pcm_new
)(
struct
snd_soc_pcm_runtime
*
);
void
(
*
pcm_free
)(
struct
snd_pcm
*
);
/* DT */
int
(
*
of_xlate_dai_name
)(
struct
snd_soc_component
*
component
,
struct
of_phandle_args
*
args
,
...
...
@@ -859,6 +860,8 @@ struct snd_soc_component {
void
(
*
remove
)(
struct
snd_soc_component
*
);
int
(
*
suspend
)(
struct
snd_soc_component
*
);
int
(
*
resume
)(
struct
snd_soc_component
*
);
int
(
*
pcm_new
)(
struct
snd_soc_pcm_runtime
*
);
void
(
*
pcm_free
)(
struct
snd_pcm
*
);
/* machine specific init */
int
(
*
init
)(
struct
snd_soc_component
*
component
);
...
...
@@ -941,20 +944,11 @@ struct snd_soc_platform_driver {
int
(
*
pcm_new
)(
struct
snd_soc_pcm_runtime
*
);
void
(
*
pcm_free
)(
struct
snd_pcm
*
);
/*
* For platform caused delay reporting.
* Optional.
*/
snd_pcm_sframes_t
(
*
delay
)(
struct
snd_pcm_substream
*
,
struct
snd_soc_dai
*
);
/* platform stream pcm ops */
const
struct
snd_pcm_ops
*
ops
;
/* platform stream compress ops */
const
struct
snd_compr_ops
*
compr_ops
;
int
(
*
bespoke_trigger
)(
struct
snd_pcm_substream
*
,
int
);
};
struct
snd_soc_dai_link_component
{
...
...
sound/soc/soc-core.c
浏览文件 @
4ae8be8e
...
...
@@ -2976,6 +2976,8 @@ static int snd_soc_component_initialize(struct snd_soc_component *component,
component
->
remove
=
component
->
driver
->
remove
;
component
->
suspend
=
component
->
driver
->
suspend
;
component
->
resume
=
component
->
driver
->
resume
;
component
->
pcm_new
=
component
->
driver
->
pcm_new
;
component
->
pcm_free
=
component
->
driver
->
pcm_free
;
dapm
=
&
component
->
dapm
;
dapm
->
dev
=
dev
;
...
...
@@ -3158,6 +3160,21 @@ static void snd_soc_platform_drv_remove(struct snd_soc_component *component)
platform
->
driver
->
remove
(
platform
);
}
static
int
snd_soc_platform_drv_pcm_new
(
struct
snd_soc_pcm_runtime
*
rtd
)
{
struct
snd_soc_platform
*
platform
=
rtd
->
platform
;
return
platform
->
driver
->
pcm_new
(
rtd
);
}
static
void
snd_soc_platform_drv_pcm_free
(
struct
snd_pcm
*
pcm
)
{
struct
snd_soc_pcm_runtime
*
rtd
=
pcm
->
private_data
;
struct
snd_soc_platform
*
platform
=
rtd
->
platform
;
platform
->
driver
->
pcm_free
(
pcm
);
}
/**
* snd_soc_add_platform - Add a platform to the ASoC core
* @dev: The parent device for the platform
...
...
@@ -3181,6 +3198,10 @@ int snd_soc_add_platform(struct device *dev, struct snd_soc_platform *platform,
platform
->
component
.
probe
=
snd_soc_platform_drv_probe
;
if
(
platform_drv
->
remove
)
platform
->
component
.
remove
=
snd_soc_platform_drv_remove
;
if
(
platform_drv
->
pcm_new
)
platform
->
component
.
pcm_new
=
snd_soc_platform_drv_pcm_new
;
if
(
platform_drv
->
pcm_free
)
platform
->
component
.
pcm_free
=
snd_soc_platform_drv_pcm_free
;
#ifdef CONFIG_DEBUG_FS
platform
->
component
.
debugfs_prefix
=
"platform"
;
...
...
sound/soc/soc-pcm.c
浏览文件 @
4ae8be8e
...
...
@@ -1055,7 +1055,6 @@ static int soc_pcm_bespoke_trigger(struct snd_pcm_substream *substream,
int
cmd
)
{
struct
snd_soc_pcm_runtime
*
rtd
=
substream
->
private_data
;
struct
snd_soc_platform
*
platform
=
rtd
->
platform
;
struct
snd_soc_dai
*
cpu_dai
=
rtd
->
cpu_dai
;
struct
snd_soc_dai
*
codec_dai
;
int
i
,
ret
;
...
...
@@ -1071,12 +1070,6 @@ static int soc_pcm_bespoke_trigger(struct snd_pcm_substream *substream,
}
}
if
(
platform
->
driver
->
bespoke_trigger
)
{
ret
=
platform
->
driver
->
bespoke_trigger
(
substream
,
cmd
);
if
(
ret
<
0
)
return
ret
;
}
if
(
cpu_dai
->
driver
->
ops
&&
cpu_dai
->
driver
->
ops
->
bespoke_trigger
)
{
ret
=
cpu_dai
->
driver
->
ops
->
bespoke_trigger
(
substream
,
cmd
,
cpu_dai
);
if
(
ret
<
0
)
...
...
@@ -1116,13 +1109,6 @@ static snd_pcm_uframes_t soc_pcm_pointer(struct snd_pcm_substream *substream)
}
delay
+=
codec_delay
;
/*
* None of the existing platform drivers implement delay(), so
* for now the codec_dai of first multicodec entry is used
*/
if
(
platform
->
driver
->
delay
)
delay
+=
platform
->
driver
->
delay
(
substream
,
rtd
->
codec_dais
[
0
]);
runtime
->
delay
=
delay
;
return
offset
;
...
...
@@ -2642,12 +2628,25 @@ static int dpcm_fe_dai_close(struct snd_pcm_substream *fe_substream)
return
ret
;
}
static
void
soc_pcm_free
(
struct
snd_pcm
*
pcm
)
{
struct
snd_soc_pcm_runtime
*
rtd
=
pcm
->
private_data
;
struct
snd_soc_component
*
component
;
list_for_each_entry
(
component
,
&
rtd
->
card
->
component_dev_list
,
card_list
)
{
if
(
component
->
pcm_free
)
component
->
pcm_free
(
pcm
);
}
}
/* create a new pcm */
int
soc_new_pcm
(
struct
snd_soc_pcm_runtime
*
rtd
,
int
num
)
{
struct
snd_soc_platform
*
platform
=
rtd
->
platform
;
struct
snd_soc_dai
*
codec_dai
;
struct
snd_soc_dai
*
cpu_dai
=
rtd
->
cpu_dai
;
struct
snd_soc_component
*
component
;
struct
snd_pcm
*
pcm
;
char
new_name
[
64
];
int
ret
=
0
,
playback
=
0
,
capture
=
0
;
...
...
@@ -2756,17 +2755,18 @@ int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num)
if
(
capture
)
snd_pcm_set_ops
(
pcm
,
SNDRV_PCM_STREAM_CAPTURE
,
&
rtd
->
ops
);
if
(
platform
->
driver
->
pcm_new
)
{
ret
=
platform
->
driver
->
pcm_new
(
rtd
);
if
(
ret
<
0
)
{
dev_err
(
platform
->
dev
,
"ASoC: pcm constructor failed: %d
\n
"
,
ret
);
return
ret
;
list_for_each_entry
(
component
,
&
rtd
->
card
->
component_dev_list
,
card_list
)
{
if
(
component
->
pcm_new
)
{
ret
=
component
->
pcm_new
(
rtd
);
if
(
ret
<
0
)
{
dev_err
(
component
->
dev
,
"ASoC: pcm constructor failed: %d
\n
"
,
ret
);
return
ret
;
}
}
}
pcm
->
private_free
=
platform
->
driver
->
pcm_free
;
pcm
->
private_free
=
soc_pcm_free
;
out:
dev_info
(
rtd
->
card
->
dev
,
"%s <-> %s mapping ok
\n
"
,
(
rtd
->
num_codecs
>
1
)
?
"multicodec"
:
rtd
->
codec_dai
->
name
,
...
...
@@ -2874,15 +2874,6 @@ int snd_soc_dpcm_can_be_params(struct snd_soc_pcm_runtime *fe,
}
EXPORT_SYMBOL_GPL
(
snd_soc_dpcm_can_be_params
);
int
snd_soc_platform_trigger
(
struct
snd_pcm_substream
*
substream
,
int
cmd
,
struct
snd_soc_platform
*
platform
)
{
if
(
platform
->
driver
->
ops
&&
platform
->
driver
->
ops
->
trigger
)
return
platform
->
driver
->
ops
->
trigger
(
substream
,
cmd
);
return
0
;
}
EXPORT_SYMBOL_GPL
(
snd_soc_platform_trigger
);
#ifdef CONFIG_DEBUG_FS
static
const
char
*
dpcm_state_string
(
enum
snd_soc_dpcm_state
state
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录