Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
57769541
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看板
提交
57769541
编写于
12月 10, 2012
作者:
M
Mark Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'asoc/topic/da9055' into asoc-next
上级
ac0d9c90
5619d76d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
30 addition
and
13 deletion
+30
-13
sound/soc/codecs/da9055.c
sound/soc/codecs/da9055.c
+30
-13
未找到文件。
sound/soc/codecs/da9055.c
浏览文件 @
57769541
...
...
@@ -173,6 +173,7 @@
#define DA9055_AIF_FORMAT_I2S_MODE (0 << 0)
#define DA9055_AIF_FORMAT_LEFT_J (1 << 0)
#define DA9055_AIF_FORMAT_RIGHT_J (2 << 0)
#define DA9055_AIF_FORMAT_DSP (3 << 0)
#define DA9055_AIF_WORD_S16_LE (0 << 2)
#define DA9055_AIF_WORD_S20_3LE (1 << 2)
#define DA9055_AIF_WORD_S24_LE (2 << 2)
...
...
@@ -752,6 +753,17 @@ static const struct snd_kcontrol_new da9055_dapm_mixoutr_controls[] = {
6
,
1
,
0
),
};
/* Headphone Output Enable */
static
const
struct
snd_kcontrol_new
da9055_dapm_hp_l_control
=
SOC_DAPM_SINGLE
(
"Switch"
,
DA9055_HP_L_CTRL
,
3
,
1
,
0
);
static
const
struct
snd_kcontrol_new
da9055_dapm_hp_r_control
=
SOC_DAPM_SINGLE
(
"Switch"
,
DA9055_HP_R_CTRL
,
3
,
1
,
0
);
/* Lineout Output Enable */
static
const
struct
snd_kcontrol_new
da9055_dapm_lineout_control
=
SOC_DAPM_SINGLE
(
"Switch"
,
DA9055_LINE_CTRL
,
3
,
1
,
0
);
/* DAPM widgets */
static
const
struct
snd_soc_dapm_widget
da9055_dapm_widgets
[]
=
{
/* Input Side */
...
...
@@ -816,6 +828,14 @@ static const struct snd_soc_dapm_widget da9055_dapm_widgets[] = {
&
da9055_dapm_mixoutr_controls
[
0
],
ARRAY_SIZE
(
da9055_dapm_mixoutr_controls
)),
/* Output Enable Switches */
SND_SOC_DAPM_SWITCH
(
"Headphone Left Enable"
,
SND_SOC_NOPM
,
0
,
0
,
&
da9055_dapm_hp_l_control
),
SND_SOC_DAPM_SWITCH
(
"Headphone Right Enable"
,
SND_SOC_NOPM
,
0
,
0
,
&
da9055_dapm_hp_r_control
),
SND_SOC_DAPM_SWITCH
(
"Lineout Enable"
,
SND_SOC_NOPM
,
0
,
0
,
&
da9055_dapm_lineout_control
),
/* Output PGAs */
SND_SOC_DAPM_PGA
(
"MIXOUT Left"
,
DA9055_MIXOUT_L_CTRL
,
7
,
0
,
NULL
,
0
),
SND_SOC_DAPM_PGA
(
"MIXOUT Right"
,
DA9055_MIXOUT_R_CTRL
,
7
,
0
,
NULL
,
0
),
...
...
@@ -901,17 +921,20 @@ static const struct snd_soc_dapm_route da9055_audio_map[] = {
{
"Out Mixer Right"
,
"DAC Right Switch"
,
"DAC Right"
},
{
"MIXOUT Left"
,
NULL
,
"Out Mixer Left"
},
{
"Headphone Left"
,
NULL
,
"MIXOUT Left"
},
{
"Headphone Left Enable"
,
"Switch"
,
"MIXOUT Left"
},
{
"Headphone Left"
,
NULL
,
"Headphone Left Enable"
},
{
"Headphone Left"
,
NULL
,
"Charge Pump"
},
{
"HPL"
,
NULL
,
"Headphone Left"
},
{
"MIXOUT Right"
,
NULL
,
"Out Mixer Right"
},
{
"Headphone Right"
,
NULL
,
"MIXOUT Right"
},
{
"Headphone Right Enable"
,
"Switch"
,
"MIXOUT Right"
},
{
"Headphone Right"
,
NULL
,
"Headphone Right Enable"
},
{
"Headphone Right"
,
NULL
,
"Charge Pump"
},
{
"HPR"
,
NULL
,
"Headphone Right"
},
{
"MIXOUT Right"
,
NULL
,
"Out Mixer Right"
},
{
"Lineout"
,
NULL
,
"MIXOUT Right"
},
{
"Lineout Enable"
,
"Switch"
,
"MIXOUT Right"
},
{
"Lineout"
,
NULL
,
"Lineout Enable"
},
{
"LINE"
,
NULL
,
"Lineout"
},
};
...
...
@@ -1175,6 +1198,9 @@ static int da9055_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
case
SND_SOC_DAIFMT_RIGHT_J
:
aif_ctrl
=
DA9055_AIF_FORMAT_RIGHT_J
;
break
;
case
SND_SOC_DAIFMT_DSP_A
:
aif_ctrl
=
DA9055_AIF_FORMAT_DSP
;
break
;
default:
return
-
EINVAL
;
}
...
...
@@ -1390,8 +1416,7 @@ static int da9055_probe(struct snd_soc_codec *codec)
DA9055_GAIN_RAMPING_EN
,
DA9055_GAIN_RAMPING_EN
);
/*
* There are two separate control bits for input and output mixers as
* well as headphone and line outs.
* There are two separate control bits for input and output mixers.
* One to enable corresponding amplifier and other to enable its
* output. As amplifier bits are related to power control, they are
* being managed by DAPM while other (non power related) bits are
...
...
@@ -1407,14 +1432,6 @@ static int da9055_probe(struct snd_soc_codec *codec)
snd_soc_update_bits
(
codec
,
DA9055_MIXOUT_R_CTRL
,
DA9055_MIXOUT_R_MIX_EN
,
DA9055_MIXOUT_R_MIX_EN
);
snd_soc_update_bits
(
codec
,
DA9055_HP_L_CTRL
,
DA9055_HP_L_AMP_OE
,
DA9055_HP_L_AMP_OE
);
snd_soc_update_bits
(
codec
,
DA9055_HP_R_CTRL
,
DA9055_HP_R_AMP_OE
,
DA9055_HP_R_AMP_OE
);
snd_soc_update_bits
(
codec
,
DA9055_LINE_CTRL
,
DA9055_LINE_AMP_OE
,
DA9055_LINE_AMP_OE
);
/* Set this as per your system configuration */
snd_soc_write
(
codec
,
DA9055_PLL_CTRL
,
DA9055_PLL_INDIV_10_20_MHZ
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录