Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
b9b5cc26
K
Kernel
项目概览
openeuler
/
Kernel
大约 1 年 前同步成功
通知
6
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b9b5cc26
编写于
8月 07, 2009
作者:
M
Mark Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'for-2.6.31' into for-2.6.32
上级
6a90d536
c12abc01
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
39 addition
and
25 deletion
+39
-25
arch/arm/plat-omap/include/mach/mcbsp.h
arch/arm/plat-omap/include/mach/mcbsp.h
+2
-2
arch/arm/plat-omap/mcbsp.c
arch/arm/plat-omap/mcbsp.c
+32
-18
sound/soc/omap/omap-mcbsp.c
sound/soc/omap/omap-mcbsp.c
+5
-5
未找到文件。
arch/arm/plat-omap/include/mach/mcbsp.h
浏览文件 @
b9b5cc26
...
...
@@ -387,8 +387,8 @@ void omap_mcbsp_register_board_cfg(struct omap_mcbsp_platform_data *config,
void
omap_mcbsp_config
(
unsigned
int
id
,
const
struct
omap_mcbsp_reg_cfg
*
config
);
int
omap_mcbsp_request
(
unsigned
int
id
);
void
omap_mcbsp_free
(
unsigned
int
id
);
void
omap_mcbsp_start
(
unsigned
int
id
);
void
omap_mcbsp_stop
(
unsigned
int
id
);
void
omap_mcbsp_start
(
unsigned
int
id
,
int
tx
,
int
rx
);
void
omap_mcbsp_stop
(
unsigned
int
id
,
int
tx
,
int
rx
);
void
omap_mcbsp_xmit_word
(
unsigned
int
id
,
u32
word
);
u32
omap_mcbsp_recv_word
(
unsigned
int
id
);
...
...
arch/arm/plat-omap/mcbsp.c
浏览文件 @
b9b5cc26
...
...
@@ -328,14 +328,15 @@ void omap_mcbsp_free(unsigned int id)
EXPORT_SYMBOL
(
omap_mcbsp_free
);
/*
* Here we start the McBSP, by enabling t
he sample
*
generator, both transmitter and receivers,
*
and the frame sync
.
* Here we start the McBSP, by enabling t
ransmitter, receiver or both.
*
If no transmitter or receiver is active prior calling, then sample-rate
*
generator and frame sync are started
.
*/
void
omap_mcbsp_start
(
unsigned
int
id
)
void
omap_mcbsp_start
(
unsigned
int
id
,
int
tx
,
int
rx
)
{
struct
omap_mcbsp
*
mcbsp
;
void
__iomem
*
io_base
;
int
idle
;
u16
w
;
if
(
!
omap_mcbsp_check_valid_id
(
id
))
{
...
...
@@ -348,32 +349,40 @@ void omap_mcbsp_start(unsigned int id)
mcbsp
->
rx_word_length
=
(
OMAP_MCBSP_READ
(
io_base
,
RCR1
)
>>
5
)
&
0x7
;
mcbsp
->
tx_word_length
=
(
OMAP_MCBSP_READ
(
io_base
,
XCR1
)
>>
5
)
&
0x7
;
/* Start the sample generator */
w
=
OMAP_MCBSP_READ
(
io_base
,
SPCR2
);
OMAP_MCBSP_WRITE
(
io_base
,
SPCR2
,
w
|
(
1
<<
6
));
idle
=
!
((
OMAP_MCBSP_READ
(
io_base
,
SPCR2
)
|
OMAP_MCBSP_READ
(
io_base
,
SPCR1
))
&
1
);
if
(
idle
)
{
/* Start the sample generator */
w
=
OMAP_MCBSP_READ
(
io_base
,
SPCR2
);
OMAP_MCBSP_WRITE
(
io_base
,
SPCR2
,
w
|
(
1
<<
6
));
}
/* Enable transmitter and receiver */
w
=
OMAP_MCBSP_READ
(
io_base
,
SPCR2
);
OMAP_MCBSP_WRITE
(
io_base
,
SPCR2
,
w
|
1
);
OMAP_MCBSP_WRITE
(
io_base
,
SPCR2
,
w
|
(
tx
&
1
)
);
w
=
OMAP_MCBSP_READ
(
io_base
,
SPCR1
);
OMAP_MCBSP_WRITE
(
io_base
,
SPCR1
,
w
|
1
);
OMAP_MCBSP_WRITE
(
io_base
,
SPCR1
,
w
|
(
rx
&
1
)
);
udelay
(
100
);
/* Start frame sync */
w
=
OMAP_MCBSP_READ
(
io_base
,
SPCR2
);
OMAP_MCBSP_WRITE
(
io_base
,
SPCR2
,
w
|
(
1
<<
7
));
if
(
idle
)
{
/* Start frame sync */
w
=
OMAP_MCBSP_READ
(
io_base
,
SPCR2
);
OMAP_MCBSP_WRITE
(
io_base
,
SPCR2
,
w
|
(
1
<<
7
));
}
/* Dump McBSP Regs */
omap_mcbsp_dump_reg
(
id
);
}
EXPORT_SYMBOL
(
omap_mcbsp_start
);
void
omap_mcbsp_stop
(
unsigned
int
id
)
void
omap_mcbsp_stop
(
unsigned
int
id
,
int
tx
,
int
rx
)
{
struct
omap_mcbsp
*
mcbsp
;
void
__iomem
*
io_base
;
int
idle
;
u16
w
;
if
(
!
omap_mcbsp_check_valid_id
(
id
))
{
...
...
@@ -386,15 +395,20 @@ void omap_mcbsp_stop(unsigned int id)
/* Reset transmitter */
w
=
OMAP_MCBSP_READ
(
io_base
,
SPCR2
);
OMAP_MCBSP_WRITE
(
io_base
,
SPCR2
,
w
&
~
(
1
));
OMAP_MCBSP_WRITE
(
io_base
,
SPCR2
,
w
&
~
(
tx
&
1
));
/* Reset receiver */
w
=
OMAP_MCBSP_READ
(
io_base
,
SPCR1
);
OMAP_MCBSP_WRITE
(
io_base
,
SPCR1
,
w
&
~
(
1
));
OMAP_MCBSP_WRITE
(
io_base
,
SPCR1
,
w
&
~
(
rx
&
1
));
/* Reset the sample rate generator */
w
=
OMAP_MCBSP_READ
(
io_base
,
SPCR2
);
OMAP_MCBSP_WRITE
(
io_base
,
SPCR2
,
w
&
~
(
1
<<
6
));
idle
=
!
((
OMAP_MCBSP_READ
(
io_base
,
SPCR2
)
|
OMAP_MCBSP_READ
(
io_base
,
SPCR1
))
&
1
);
if
(
idle
)
{
/* Reset the sample rate generator */
w
=
OMAP_MCBSP_READ
(
io_base
,
SPCR2
);
OMAP_MCBSP_WRITE
(
io_base
,
SPCR2
,
w
&
~
(
1
<<
6
));
}
}
EXPORT_SYMBOL
(
omap_mcbsp_stop
);
...
...
sound/soc/omap/omap-mcbsp.c
浏览文件 @
b9b5cc26
...
...
@@ -183,21 +183,21 @@ static int omap_mcbsp_dai_trigger(struct snd_pcm_substream *substream, int cmd,
struct
snd_soc_pcm_runtime
*
rtd
=
substream
->
private_data
;
struct
snd_soc_dai
*
cpu_dai
=
rtd
->
dai
->
cpu_dai
;
struct
omap_mcbsp_data
*
mcbsp_data
=
to_mcbsp
(
cpu_dai
->
private_data
);
int
err
=
0
;
int
err
=
0
,
play
=
(
substream
->
stream
==
SNDRV_PCM_STREAM_PLAYBACK
)
;
switch
(
cmd
)
{
case
SNDRV_PCM_TRIGGER_START
:
case
SNDRV_PCM_TRIGGER_RESUME
:
case
SNDRV_PCM_TRIGGER_PAUSE_RELEASE
:
if
(
!
mcbsp_data
->
active
++
)
omap_mcbsp_start
(
mcbsp_data
->
bus_id
);
mcbsp_data
->
active
++
;
omap_mcbsp_start
(
mcbsp_data
->
bus_id
,
play
,
!
play
);
break
;
case
SNDRV_PCM_TRIGGER_STOP
:
case
SNDRV_PCM_TRIGGER_SUSPEND
:
case
SNDRV_PCM_TRIGGER_PAUSE_PUSH
:
if
(
!--
mcbsp_data
->
active
)
omap_mcbsp_stop
(
mcbsp_data
->
bus_id
)
;
omap_mcbsp_stop
(
mcbsp_data
->
bus_id
,
play
,
!
play
);
mcbsp_data
->
active
--
;
break
;
default:
err
=
-
EINVAL
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录