Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
b10be23b
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看板
提交
b10be23b
编写于
8月 25, 2012
作者:
M
Mark Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'asoc-omap' into for-3.7
上级
32c50a31
db615509
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
27 addition
and
37 deletion
+27
-37
sound/soc/omap/omap-mcbsp.c
sound/soc/omap/omap-mcbsp.c
+27
-37
未找到文件。
sound/soc/omap/omap-mcbsp.c
浏览文件 @
b10be23b
...
...
@@ -619,9 +619,9 @@ static int omap_mcbsp_st_info_volsw(struct snd_kcontrol *kcontrol,
return
0
;
}
#define OMAP_MCBSP_ST_
SET_CHANNEL_VOLUME(channel)
\
#define OMAP_MCBSP_ST_
CHANNEL_VOLUME(channel)
\
static int \
omap_mcbsp_set_st_ch##channel##_volume(struct snd_kcontrol *kc, \
omap_mcbsp_set_st_ch##channel##_volume(struct snd_kcontrol *kc,
\
struct snd_ctl_elem_value *uc) \
{ \
struct snd_soc_dai *cpu_dai = snd_kcontrol_chip(kc); \
...
...
@@ -637,11 +637,10 @@ omap_mcbsp_set_st_ch##channel##_volume(struct snd_kcontrol *kc, \
\
/* OMAP McBSP implementation uses index values 0..4 */
\
return omap_st_set_chgain(mcbsp, channel, val); \
}
#define OMAP_MCBSP_ST_GET_CHANNEL_VOLUME(channel) \
} \
\
static int \
omap_mcbsp_get_st_ch##channel##_volume(struct snd_kcontrol *kc, \
omap_mcbsp_get_st_ch##channel##_volume(struct snd_kcontrol *kc,
\
struct snd_ctl_elem_value *uc) \
{ \
struct snd_soc_dai *cpu_dai = snd_kcontrol_chip(kc); \
...
...
@@ -655,10 +654,8 @@ omap_mcbsp_get_st_ch##channel##_volume(struct snd_kcontrol *kc, \
return 0; \
}
OMAP_MCBSP_ST_SET_CHANNEL_VOLUME
(
0
)
OMAP_MCBSP_ST_SET_CHANNEL_VOLUME
(
1
)
OMAP_MCBSP_ST_GET_CHANNEL_VOLUME
(
0
)
OMAP_MCBSP_ST_GET_CHANNEL_VOLUME
(
1
)
OMAP_MCBSP_ST_CHANNEL_VOLUME
(
0
)
OMAP_MCBSP_ST_CHANNEL_VOLUME
(
1
)
static
int
omap_mcbsp_st_put_mode
(
struct
snd_kcontrol
*
kcontrol
,
struct
snd_ctl_elem_value
*
ucontrol
)
...
...
@@ -688,41 +685,34 @@ static int omap_mcbsp_st_get_mode(struct snd_kcontrol *kcontrol,
return
0
;
}
static
const
struct
snd_kcontrol_new
omap_mcbsp2_st_controls
[]
=
{
SOC_SINGLE_EXT
(
"McBSP2 Sidetone Switch"
,
1
,
0
,
1
,
0
,
omap_mcbsp_st_get_mode
,
omap_mcbsp_st_put_mode
),
OMAP_MCBSP_SOC_SINGLE_S16_EXT
(
"McBSP2 Sidetone Channel 0 Volume"
,
-
32768
,
32767
,
omap_mcbsp_get_st_ch0_volume
,
omap_mcbsp_set_st_ch0_volume
),
OMAP_MCBSP_SOC_SINGLE_S16_EXT
(
"McBSP2 Sidetone Channel 1 Volume"
,
-
32768
,
32767
,
omap_mcbsp_get_st_ch1_volume
,
omap_mcbsp_set_st_ch1_volume
),
};
#define OMAP_MCBSP_ST_CONTROLS(port) \
static const struct snd_kcontrol_new omap_mcbsp##port##_st_controls[] = { \
SOC_SINGLE_EXT("McBSP" #port " Sidetone Switch", 1, 0, 1, 0, \
omap_mcbsp_st_get_mode, omap_mcbsp_st_put_mode), \
OMAP_MCBSP_SOC_SINGLE_S16_EXT("McBSP" #port " Sidetone Channel 0 Volume", \
-32768, 32767, \
omap_mcbsp_get_st_ch0_volume, \
omap_mcbsp_set_st_ch0_volume), \
OMAP_MCBSP_SOC_SINGLE_S16_EXT("McBSP" #port " Sidetone Channel 1 Volume", \
-32768, 32767, \
omap_mcbsp_get_st_ch1_volume, \
omap_mcbsp_set_st_ch1_volume), \
}
static
const
struct
snd_kcontrol_new
omap_mcbsp3_st_controls
[]
=
{
SOC_SINGLE_EXT
(
"McBSP3 Sidetone Switch"
,
2
,
0
,
1
,
0
,
omap_mcbsp_st_get_mode
,
omap_mcbsp_st_put_mode
),
OMAP_MCBSP_SOC_SINGLE_S16_EXT
(
"McBSP3 Sidetone Channel 0 Volume"
,
-
32768
,
32767
,
omap_mcbsp_get_st_ch0_volume
,
omap_mcbsp_set_st_ch0_volume
),
OMAP_MCBSP_SOC_SINGLE_S16_EXT
(
"McBSP3 Sidetone Channel 1 Volume"
,
-
32768
,
32767
,
omap_mcbsp_get_st_ch1_volume
,
omap_mcbsp_set_st_ch1_volume
),
};
OMAP_MCBSP_ST_CONTROLS
(
2
);
OMAP_MCBSP_ST_CONTROLS
(
3
);
int
omap_mcbsp_st_add_controls
(
struct
snd_soc_pcm_runtime
*
rtd
)
{
struct
snd_soc_dai
*
cpu_dai
=
rtd
->
cpu_dai
;
struct
omap_mcbsp
*
mcbsp
=
snd_soc_dai_get_drvdata
(
cpu_dai
);
if
(
!
mcbsp
->
st_data
)
return
-
ENODEV
;
if
(
!
mcbsp
->
st_data
)
{
dev_warn
(
mcbsp
->
dev
,
"No sidetone data for port
\n
"
);
return
0
;
}
switch
(
cpu_dai
->
id
)
{
switch
(
mcbsp
->
id
)
{
case
2
:
/* McBSP 2 */
return
snd_soc_add_dai_controls
(
cpu_dai
,
omap_mcbsp2_st_controls
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录