Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
ae1abb0c
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看板
提交
ae1abb0c
编写于
1月 10, 2013
作者:
M
Mark Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'asoc/fix/arizona' into tmp
上级
9931faca
d71753e2
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
57 addition
and
18 deletion
+57
-18
sound/soc/codecs/arizona.c
sound/soc/codecs/arizona.c
+2
-7
sound/soc/codecs/arizona.h
sound/soc/codecs/arizona.h
+9
-9
sound/soc/codecs/wm5102.c
sound/soc/codecs/wm5102.c
+46
-2
未找到文件。
sound/soc/codecs/arizona.c
浏览文件 @
ae1abb0c
...
...
@@ -446,15 +446,9 @@ static int arizona_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
case
SND_SOC_DAIFMT_DSP_A
:
mode
=
0
;
break
;
case
SND_SOC_DAIFMT_DSP_B
:
mode
=
1
;
break
;
case
SND_SOC_DAIFMT_I2S
:
mode
=
2
;
break
;
case
SND_SOC_DAIFMT_LEFT_J
:
mode
=
3
;
break
;
default:
arizona_aif_err
(
dai
,
"Unsupported DAI format %d
\n
"
,
fmt
&
SND_SOC_DAIFMT_FORMAT_MASK
);
...
...
@@ -714,7 +708,8 @@ static int arizona_hw_params(struct snd_pcm_substream *substream,
snd_soc_update_bits
(
codec
,
ARIZONA_ASYNC_SAMPLE_RATE_1
,
ARIZONA_ASYNC_SAMPLE_RATE_MASK
,
sr_val
);
snd_soc_update_bits
(
codec
,
base
+
ARIZONA_AIF_RATE_CTRL
,
ARIZONA_AIF1_RATE_MASK
,
8
);
ARIZONA_AIF1_RATE_MASK
,
8
<<
ARIZONA_AIF1_RATE_SHIFT
);
break
;
default:
arizona_aif_err
(
dai
,
"Invalid clock %d
\n
"
,
dai_priv
->
clk
);
...
...
sound/soc/codecs/arizona.h
浏览文件 @
ae1abb0c
...
...
@@ -34,15 +34,15 @@
#define ARIZONA_FLL_SRC_MCLK1 0
#define ARIZONA_FLL_SRC_MCLK2 1
#define ARIZONA_FLL_SRC_SLIMCLK
2
#define ARIZONA_FLL_SRC_FLL1
3
#define ARIZONA_FLL_SRC_FLL2
4
#define ARIZONA_FLL_SRC_AIF1BCLK
5
#define ARIZONA_FLL_SRC_AIF2BCLK
6
#define ARIZONA_FLL_SRC_AIF3BCLK
7
#define ARIZONA_FLL_SRC_AIF1LRCLK
8
#define ARIZONA_FLL_SRC_AIF2LRCLK
9
#define ARIZONA_FLL_SRC_AIF3LRCLK 1
0
#define ARIZONA_FLL_SRC_SLIMCLK
3
#define ARIZONA_FLL_SRC_FLL1
4
#define ARIZONA_FLL_SRC_FLL2
5
#define ARIZONA_FLL_SRC_AIF1BCLK
8
#define ARIZONA_FLL_SRC_AIF2BCLK
9
#define ARIZONA_FLL_SRC_AIF3BCLK
10
#define ARIZONA_FLL_SRC_AIF1LRCLK
12
#define ARIZONA_FLL_SRC_AIF2LRCLK
13
#define ARIZONA_FLL_SRC_AIF3LRCLK 1
4
#define ARIZONA_MIXER_VOL_MASK 0x00FE
#define ARIZONA_MIXER_VOL_SHIFT 1
...
...
sound/soc/codecs/wm5102.c
浏览文件 @
ae1abb0c
...
...
@@ -36,6 +36,9 @@
struct
wm5102_priv
{
struct
arizona_priv
core
;
struct
arizona_fll
fll
[
2
];
unsigned
int
spk_ena
:
2
;
unsigned
int
spk_ena_pending
:
1
;
};
static
DECLARE_TLV_DB_SCALE
(
ana_tlv
,
0
,
100
,
0
);
...
...
@@ -787,6 +790,47 @@ ARIZONA_MIXER_CONTROLS("AIF3TX1", ARIZONA_AIF3TX1MIX_INPUT_1_SOURCE),
ARIZONA_MIXER_CONTROLS
(
"AIF3TX2"
,
ARIZONA_AIF3TX2MIX_INPUT_1_SOURCE
),
};
static
int
wm5102_spk_ev
(
struct
snd_soc_dapm_widget
*
w
,
struct
snd_kcontrol
*
kcontrol
,
int
event
)
{
struct
snd_soc_codec
*
codec
=
w
->
codec
;
struct
arizona
*
arizona
=
dev_get_drvdata
(
codec
->
dev
->
parent
);
struct
wm5102_priv
*
wm5102
=
snd_soc_codec_get_drvdata
(
codec
);
if
(
arizona
->
rev
<
1
)
return
0
;
switch
(
event
)
{
case
SND_SOC_DAPM_PRE_PMU
:
if
(
!
wm5102
->
spk_ena
)
{
snd_soc_write
(
codec
,
0x4f5
,
0x25a
);
wm5102
->
spk_ena_pending
=
true
;
}
break
;
case
SND_SOC_DAPM_POST_PMU
:
if
(
wm5102
->
spk_ena_pending
)
{
msleep
(
75
);
snd_soc_write
(
codec
,
0x4f5
,
0xda
);
wm5102
->
spk_ena_pending
=
false
;
wm5102
->
spk_ena
++
;
}
break
;
case
SND_SOC_DAPM_PRE_PMD
:
wm5102
->
spk_ena
--
;
if
(
!
wm5102
->
spk_ena
)
snd_soc_write
(
codec
,
0x4f5
,
0x25a
);
break
;
case
SND_SOC_DAPM_POST_PMD
:
if
(
!
wm5102
->
spk_ena
)
snd_soc_write
(
codec
,
0x4f5
,
0x0da
);
break
;
}
return
0
;
}
ARIZONA_MIXER_ENUMS
(
EQ1
,
ARIZONA_EQ1MIX_INPUT_1_SOURCE
);
ARIZONA_MIXER_ENUMS
(
EQ2
,
ARIZONA_EQ2MIX_INPUT_1_SOURCE
);
ARIZONA_MIXER_ENUMS
(
EQ3
,
ARIZONA_EQ3MIX_INPUT_1_SOURCE
);
...
...
@@ -1034,10 +1078,10 @@ SND_SOC_DAPM_PGA_E("OUT3L", ARIZONA_OUTPUT_ENABLES_1,
ARIZONA_OUT3L_ENA_SHIFT
,
0
,
NULL
,
0
,
arizona_out_ev
,
SND_SOC_DAPM_PRE_PMD
|
SND_SOC_DAPM_POST_PMU
),
SND_SOC_DAPM_PGA_E
(
"OUT4L"
,
ARIZONA_OUTPUT_ENABLES_1
,
ARIZONA_OUT4L_ENA_SHIFT
,
0
,
NULL
,
0
,
arizona_out
_ev
,
ARIZONA_OUT4L_ENA_SHIFT
,
0
,
NULL
,
0
,
wm5102_spk
_ev
,
SND_SOC_DAPM_PRE_PMD
|
SND_SOC_DAPM_POST_PMU
),
SND_SOC_DAPM_PGA_E
(
"OUT4R"
,
ARIZONA_OUTPUT_ENABLES_1
,
ARIZONA_OUT4R_ENA_SHIFT
,
0
,
NULL
,
0
,
arizona_out
_ev
,
ARIZONA_OUT4R_ENA_SHIFT
,
0
,
NULL
,
0
,
wm5102_spk
_ev
,
SND_SOC_DAPM_PRE_PMD
|
SND_SOC_DAPM_POST_PMU
),
SND_SOC_DAPM_PGA_E
(
"OUT5L"
,
ARIZONA_OUTPUT_ENABLES_1
,
ARIZONA_OUT5L_ENA_SHIFT
,
0
,
NULL
,
0
,
arizona_out_ev
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录