Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
2924c962
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
2924c962
编写于
6月 22, 2015
作者:
M
Mark Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'asoc/topic/davinci' into asoc-next
上级
95baa281
9fbd58cf
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
66 addition
and
11 deletion
+66
-11
sound/soc/davinci/davinci-mcasp.c
sound/soc/davinci/davinci-mcasp.c
+62
-10
sound/soc/davinci/davinci-mcasp.h
sound/soc/davinci/davinci-mcasp.h
+4
-1
未找到文件。
sound/soc/davinci/davinci-mcasp.c
浏览文件 @
2924c962
...
...
@@ -686,6 +686,8 @@ static int mcasp_common_hw_param(struct davinci_mcasp *mcasp, int stream,
if
(
mcasp
->
serial_dir
[
i
]
==
TX_MODE
&&
tx_ser
<
max_active_serializers
)
{
mcasp_set_bits
(
mcasp
,
DAVINCI_MCASP_PDIR_REG
,
AXR
(
i
));
mcasp_mod_bits
(
mcasp
,
DAVINCI_MCASP_XRSRCTL_REG
(
i
),
DISMOD_LOW
,
DISMOD_MASK
);
tx_ser
++
;
}
else
if
(
mcasp
->
serial_dir
[
i
]
==
RX_MODE
&&
rx_ser
<
max_active_serializers
)
{
...
...
@@ -1565,6 +1567,49 @@ static int davinci_mcasp_init_ch_constraints(struct davinci_mcasp *mcasp)
return
ret
;
}
enum
{
PCM_EDMA
,
PCM_SDMA
,
};
static
const
char
*
sdma_prefix
=
"ti,omap"
;
static
int
davinci_mcasp_get_dma_type
(
struct
davinci_mcasp
*
mcasp
)
{
struct
dma_chan
*
chan
;
const
char
*
tmp
;
int
ret
=
PCM_EDMA
;
if
(
!
mcasp
->
dev
->
of_node
)
return
PCM_EDMA
;
tmp
=
mcasp
->
dma_data
[
SNDRV_PCM_STREAM_PLAYBACK
].
filter_data
;
chan
=
dma_request_slave_channel_reason
(
mcasp
->
dev
,
tmp
);
if
(
IS_ERR
(
chan
))
{
if
(
PTR_ERR
(
chan
)
!=
-
EPROBE_DEFER
)
dev_err
(
mcasp
->
dev
,
"Can't verify DMA configuration (%ld)
\n
"
,
PTR_ERR
(
chan
));
return
PTR_ERR
(
chan
);
}
BUG_ON
(
!
chan
->
device
||
!
chan
->
device
->
dev
);
if
(
chan
->
device
->
dev
->
of_node
)
ret
=
of_property_read_string
(
chan
->
device
->
dev
->
of_node
,
"compatible"
,
&
tmp
);
else
dev_dbg
(
mcasp
->
dev
,
"DMA controller has no of-node
\n
"
);
dma_release_channel
(
chan
);
if
(
ret
)
return
ret
;
dev_dbg
(
mcasp
->
dev
,
"DMA controller compatible =
\"
%s
\"\n
"
,
tmp
);
if
(
!
strncmp
(
tmp
,
sdma_prefix
,
strlen
(
sdma_prefix
)))
return
PCM_SDMA
;
return
PCM_EDMA
;
}
static
int
davinci_mcasp_probe
(
struct
platform_device
*
pdev
)
{
struct
snd_dmaengine_dai_dma_data
*
dma_data
;
...
...
@@ -1763,27 +1808,34 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
if
(
ret
!=
0
)
goto
err
;
switch
(
mcasp
->
version
)
{
ret
=
davinci_mcasp_get_dma_type
(
mcasp
);
switch
(
ret
)
{
case
PCM_EDMA
:
#if IS_BUILTIN(CONFIG_SND_EDMA_SOC) || \
(IS_MODULE(CONFIG_SND_DAVINCI_SOC_MCASP) && \
IS_MODULE(CONFIG_SND_EDMA_SOC))
case
MCASP_VERSION_1
:
case
MCASP_VERSION_2
:
case
MCASP_VERSION_3
:
ret
=
edma_pcm_platform_register
(
&
pdev
->
dev
);
break
;
#else
dev_err
(
&
pdev
->
dev
,
"Missing SND_EDMA_SOC
\n
"
);
ret
=
-
EINVAL
;
goto
err
;
#endif
break
;
case
PCM_SDMA
:
#if IS_BUILTIN(CONFIG_SND_OMAP_SOC) || \
(IS_MODULE(CONFIG_SND_DAVINCI_SOC_MCASP) && \
IS_MODULE(CONFIG_SND_OMAP_SOC))
case
MCASP_VERSION_4
:
ret
=
omap_pcm_platform_register
(
&
pdev
->
dev
);
break
;
#else
dev_err
(
&
pdev
->
dev
,
"Missing SND_SDMA_SOC
\n
"
);
ret
=
-
EINVAL
;
goto
err
;
#endif
break
;
default:
dev_err
(
&
pdev
->
dev
,
"
Invalid McASP version: %d
\n
"
,
mcasp
->
version
);
ret
=
-
EINVAL
;
dev_err
(
&
pdev
->
dev
,
"
No DMA controller found (%d)
\n
"
,
ret
);
case
-
EPROBE_DEFER
:
goto
err
;
break
;
}
...
...
sound/soc/davinci/davinci-mcasp.h
浏览文件 @
2924c962
...
...
@@ -215,7 +215,10 @@
* DAVINCI_MCASP_XRSRCTL_BASE_REG - Serializer Control Register Bits
*/
#define MODE(val) (val)
#define DISMOD (val)(val<<2)
#define DISMOD_3STATE (0x0)
#define DISMOD_LOW (0x2 << 2)
#define DISMOD_HIGH (0x3 << 2)
#define DISMOD_MASK DISMOD_HIGH
#define TXSTATE BIT(4)
#define RXSTATE BIT(5)
#define SRMOD_MASK 3
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录