Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
30010a27
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看板
提交
30010a27
编写于
1月 02, 2014
作者:
M
Mark Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'asoc/fix/fsl' into asoc-linus
上级
802eee95
14c3aa98
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
21 addition
and
64 deletion
+21
-64
sound/soc/fsl/Kconfig
sound/soc/fsl/Kconfig
+0
-1
sound/soc/fsl/imx-spdif.c
sound/soc/fsl/imx-spdif.c
+21
-63
未找到文件。
sound/soc/fsl/Kconfig
浏览文件 @
30010a27
...
...
@@ -197,7 +197,6 @@ config SND_SOC_IMX_SPDIF
tristate "SoC Audio support for i.MX boards with S/PDIF"
select SND_SOC_IMX_PCM_DMA
select SND_SOC_FSL_SPDIF
select SND_SOC_SPDIF
select REGMAP_MMIO
help
SoC Audio support for i.MX boards with S/PDIF
...
...
sound/soc/fsl/imx-spdif.c
浏览文件 @
30010a27
...
...
@@ -14,17 +14,15 @@
#include <sound/soc.h>
struct
imx_spdif_data
{
struct
snd_soc_dai_link
dai
[
2
]
;
struct
snd_soc_dai_link
dai
;
struct
snd_soc_card
card
;
struct
platform_device
*
txdev
;
struct
platform_device
*
rxdev
;
};
static
int
imx_spdif_audio_probe
(
struct
platform_device
*
pdev
)
{
struct
device_node
*
spdif_np
,
*
np
=
pdev
->
dev
.
of_node
;
struct
imx_spdif_data
*
data
;
int
ret
=
0
,
num_links
=
0
;
int
ret
=
0
;
spdif_np
=
of_parse_phandle
(
np
,
"spdif-controller"
,
0
);
if
(
!
spdif_np
)
{
...
...
@@ -40,69 +38,42 @@ static int imx_spdif_audio_probe(struct platform_device *pdev)
goto
end
;
}
if
(
of_property_read_bool
(
np
,
"spdif-out"
))
{
data
->
dai
[
num_links
].
name
=
"S/PDIF TX"
;
data
->
dai
[
num_links
].
stream_name
=
"S/PDIF PCM Playback"
;
data
->
dai
[
num_links
].
codec_dai_name
=
"dit-hifi"
;
data
->
dai
[
num_links
].
codec_name
=
"spdif-dit"
;
data
->
dai
[
num_links
].
cpu_of_node
=
spdif_np
;
data
->
dai
[
num_links
].
platform_of_node
=
spdif_np
;
num_links
++
;
data
->
txdev
=
platform_device_register_simple
(
"spdif-dit"
,
-
1
,
NULL
,
0
);
if
(
IS_ERR
(
data
->
txdev
))
{
ret
=
PTR_ERR
(
data
->
txdev
);
dev_err
(
&
pdev
->
dev
,
"register dit failed: %d
\n
"
,
ret
);
goto
end
;
}
}
data
->
dai
.
name
=
"S/PDIF PCM"
;
data
->
dai
.
stream_name
=
"S/PDIF PCM"
;
data
->
dai
.
codec_dai_name
=
"snd-soc-dummy-dai"
;
data
->
dai
.
codec_name
=
"snd-soc-dummy"
;
data
->
dai
.
cpu_of_node
=
spdif_np
;
data
->
dai
.
platform_of_node
=
spdif_np
;
data
->
dai
.
playback_only
=
true
;
data
->
dai
.
capture_only
=
true
;
if
(
of_property_read_bool
(
np
,
"spdif-in"
))
{
data
->
dai
[
num_links
].
name
=
"S/PDIF RX"
;
data
->
dai
[
num_links
].
stream_name
=
"S/PDIF PCM Capture"
;
data
->
dai
[
num_links
].
codec_dai_name
=
"dir-hifi"
;
data
->
dai
[
num_links
].
codec_name
=
"spdif-dir"
;
data
->
dai
[
num_links
].
cpu_of_node
=
spdif_np
;
data
->
dai
[
num_links
].
platform_of_node
=
spdif_np
;
num_links
++
;
data
->
rxdev
=
platform_device_register_simple
(
"spdif-dir"
,
-
1
,
NULL
,
0
);
if
(
IS_ERR
(
data
->
rxdev
))
{
ret
=
PTR_ERR
(
data
->
rxdev
);
dev_err
(
&
pdev
->
dev
,
"register dir failed: %d
\n
"
,
ret
);
goto
error_dit
;
}
}
if
(
of_property_read_bool
(
np
,
"spdif-out"
))
data
->
dai
.
capture_only
=
false
;
if
(
of_property_read_bool
(
np
,
"spdif-in"
))
data
->
dai
.
playback_only
=
false
;
if
(
!
num_links
)
{
if
(
data
->
dai
.
playback_only
&&
data
->
dai
.
capture_only
)
{
dev_err
(
&
pdev
->
dev
,
"no enabled S/PDIF DAI link
\n
"
);
goto
e
rror_dir
;
goto
e
nd
;
}
data
->
card
.
dev
=
&
pdev
->
dev
;
data
->
card
.
num_links
=
num_links
;
data
->
card
.
dai_link
=
data
->
dai
;
data
->
card
.
dai_link
=
&
data
->
dai
;
data
->
card
.
num_links
=
1
;
ret
=
snd_soc_of_parse_card_name
(
&
data
->
card
,
"model"
);
if
(
ret
)
goto
e
rror_dir
;
goto
e
nd
;
ret
=
devm_snd_soc_register_card
(
&
pdev
->
dev
,
&
data
->
card
);
if
(
ret
)
{
dev_err
(
&
pdev
->
dev
,
"snd_soc_register_card failed: %d
\n
"
,
ret
);
goto
e
rror_dir
;
goto
e
nd
;
}
platform_set_drvdata
(
pdev
,
data
);
goto
end
;
error_dir:
if
(
data
->
rxdev
)
platform_device_unregister
(
data
->
rxdev
);
error_dit:
if
(
data
->
txdev
)
platform_device_unregister
(
data
->
txdev
);
end:
if
(
spdif_np
)
of_node_put
(
spdif_np
);
...
...
@@ -110,18 +81,6 @@ static int imx_spdif_audio_probe(struct platform_device *pdev)
return
ret
;
}
static
int
imx_spdif_audio_remove
(
struct
platform_device
*
pdev
)
{
struct
imx_spdif_data
*
data
=
platform_get_drvdata
(
pdev
);
if
(
data
->
rxdev
)
platform_device_unregister
(
data
->
rxdev
);
if
(
data
->
txdev
)
platform_device_unregister
(
data
->
txdev
);
return
0
;
}
static
const
struct
of_device_id
imx_spdif_dt_ids
[]
=
{
{
.
compatible
=
"fsl,imx-audio-spdif"
,
},
{
/* sentinel */
}
...
...
@@ -135,7 +94,6 @@ static struct platform_driver imx_spdif_driver = {
.
of_match_table
=
imx_spdif_dt_ids
,
},
.
probe
=
imx_spdif_audio_probe
,
.
remove
=
imx_spdif_audio_remove
,
};
module_platform_driver
(
imx_spdif_driver
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录