Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
7ad2d1d5
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看板
提交
7ad2d1d5
编写于
4月 12, 2015
作者:
M
Mark Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'asoc/topic/rt5645' into asoc-next
上级
aab0bb17
37322551
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
64 addition
and
28 deletion
+64
-28
sound/soc/codecs/rt5645.c
sound/soc/codecs/rt5645.c
+64
-26
sound/soc/codecs/rt5645.h
sound/soc/codecs/rt5645.h
+0
-2
未找到文件。
sound/soc/codecs/rt5645.c
浏览文件 @
7ad2d1d5
...
...
@@ -1270,6 +1270,8 @@ static void hp_amp_power(struct snd_soc_codec *codec, int on)
snd_soc_update_bits
(
codec
,
RT5645_PWR_ANLG1
,
RT5645_PWR_HP_L
|
RT5645_PWR_HP_R
|
RT5645_PWR_HA
,
0
);
snd_soc_update_bits
(
codec
,
RT5645_DEPOP_M2
,
RT5645_DEPOP_MASK
,
0
);
}
}
}
...
...
@@ -1538,8 +1540,6 @@ static const struct snd_soc_dapm_widget rt5645_dapm_widgets[] = {
SND_SOC_DAPM_SUPPLY_S
(
"adc stereo1 filter"
,
1
,
RT5645_PWR_DIG2
,
RT5645_PWR_ADC_S1F_BIT
,
0
,
NULL
,
0
),
SND_SOC_DAPM_SUPPLY_S
(
"adc stereo2 filter"
,
1
,
RT5645_PWR_DIG2
,
RT5645_PWR_ADC_S2F_BIT
,
0
,
NULL
,
0
),
SND_SOC_DAPM_MIXER_E
(
"Sto1 ADC MIXL"
,
SND_SOC_NOPM
,
0
,
0
,
rt5645_sto1_adc_l_mix
,
ARRAY_SIZE
(
rt5645_sto1_adc_l_mix
),
NULL
,
0
),
...
...
@@ -1729,7 +1729,6 @@ static const struct snd_soc_dapm_widget rt5650_specific_dapm_widgets[] = {
static
const
struct
snd_soc_dapm_route
rt5645_dapm_routes
[]
=
{
{
"adc stereo1 filter"
,
NULL
,
"ADC STO1 ASRC"
,
is_using_asrc
},
{
"adc stereo2 filter"
,
NULL
,
"ADC STO2 ASRC"
,
is_using_asrc
},
{
"adc mono left filter"
,
NULL
,
"ADC MONO L ASRC"
,
is_using_asrc
},
{
"adc mono right filter"
,
NULL
,
"ADC MONO R ASRC"
,
is_using_asrc
},
{
"dac mono left filter"
,
NULL
,
"DAC MONO L ASRC"
,
is_using_asrc
},
...
...
@@ -2052,7 +2051,7 @@ static int rt5645_hw_params(struct snd_pcm_substream *substream,
{
struct
snd_soc_codec
*
codec
=
dai
->
codec
;
struct
rt5645_priv
*
rt5645
=
snd_soc_codec_get_drvdata
(
codec
);
unsigned
int
val_len
=
0
,
val_clk
,
mask_clk
;
unsigned
int
val_len
=
0
,
val_clk
,
mask_clk
,
dl_sft
;
int
pre_div
,
bclk_ms
,
frame_size
;
rt5645
->
lrck
[
dai
->
id
]
=
params_rate
(
params
);
...
...
@@ -2066,6 +2065,16 @@ static int rt5645_hw_params(struct snd_pcm_substream *substream,
dev_err
(
codec
->
dev
,
"Unsupported frame size: %d
\n
"
,
frame_size
);
return
-
EINVAL
;
}
switch
(
rt5645
->
codec_type
)
{
case
CODEC_TYPE_RT5650
:
dl_sft
=
4
;
break
;
default:
dl_sft
=
2
;
break
;
}
bclk_ms
=
frame_size
>
32
;
rt5645
->
bclk
[
dai
->
id
]
=
rt5645
->
lrck
[
dai
->
id
]
*
(
32
<<
bclk_ms
);
...
...
@@ -2078,13 +2087,13 @@ static int rt5645_hw_params(struct snd_pcm_substream *substream,
case
16
:
break
;
case
20
:
val_len
|=
RT5645_I2S_DL_20
;
val_len
=
0x1
;
break
;
case
24
:
val_len
|=
RT5645_I2S_DL_24
;
val_len
=
0x2
;
break
;
case
8
:
val_len
|=
RT5645_I2S_DL_8
;
val_len
=
0x3
;
break
;
default:
return
-
EINVAL
;
...
...
@@ -2096,7 +2105,7 @@ static int rt5645_hw_params(struct snd_pcm_substream *substream,
val_clk
=
bclk_ms
<<
RT5645_I2S_BCLK_MS1_SFT
|
pre_div
<<
RT5645_I2S_PD1_SFT
;
snd_soc_update_bits
(
codec
,
RT5645_I2S1_SDP
,
RT5645_I2S_DL_MASK
,
val_len
);
(
0x3
<<
dl_sft
),
(
val_len
<<
dl_sft
)
);
snd_soc_update_bits
(
codec
,
RT5645_ADDA_CLK1
,
mask_clk
,
val_clk
);
break
;
case
RT5645_AIF2
:
...
...
@@ -2104,7 +2113,7 @@ static int rt5645_hw_params(struct snd_pcm_substream *substream,
val_clk
=
bclk_ms
<<
RT5645_I2S_BCLK_MS2_SFT
|
pre_div
<<
RT5645_I2S_PD2_SFT
;
snd_soc_update_bits
(
codec
,
RT5645_I2S2_SDP
,
RT5645_I2S_DL_MASK
,
val_len
);
(
0x3
<<
dl_sft
),
(
val_len
<<
dl_sft
)
);
snd_soc_update_bits
(
codec
,
RT5645_ADDA_CLK1
,
mask_clk
,
val_clk
);
break
;
default:
...
...
@@ -2119,7 +2128,16 @@ static int rt5645_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt)
{
struct
snd_soc_codec
*
codec
=
dai
->
codec
;
struct
rt5645_priv
*
rt5645
=
snd_soc_codec_get_drvdata
(
codec
);
unsigned
int
reg_val
=
0
;
unsigned
int
reg_val
=
0
,
pol_sft
;
switch
(
rt5645
->
codec_type
)
{
case
CODEC_TYPE_RT5650
:
pol_sft
=
8
;
break
;
default:
pol_sft
=
7
;
break
;
}
switch
(
fmt
&
SND_SOC_DAIFMT_MASTER_MASK
)
{
case
SND_SOC_DAIFMT_CBM_CFM
:
...
...
@@ -2137,7 +2155,7 @@ static int rt5645_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt)
case
SND_SOC_DAIFMT_NB_NF
:
break
;
case
SND_SOC_DAIFMT_IB_NF
:
reg_val
|=
RT5645_I2S_BP_INV
;
reg_val
|=
(
1
<<
pol_sft
)
;
break
;
default:
return
-
EINVAL
;
...
...
@@ -2161,12 +2179,12 @@ static int rt5645_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt)
switch
(
dai
->
id
)
{
case
RT5645_AIF1
:
snd_soc_update_bits
(
codec
,
RT5645_I2S1_SDP
,
RT5645_I2S_MS_MASK
|
RT5645_I2S_BP_MASK
|
RT5645_I2S_MS_MASK
|
(
1
<<
pol_sft
)
|
RT5645_I2S_DF_MASK
,
reg_val
);
break
;
case
RT5645_AIF2
:
snd_soc_update_bits
(
codec
,
RT5645_I2S2_SDP
,
RT5645_I2S_MS_MASK
|
RT5645_I2S_BP_MASK
|
RT5645_I2S_MS_MASK
|
(
1
<<
pol_sft
)
|
RT5645_I2S_DF_MASK
,
reg_val
);
break
;
default:
...
...
@@ -2285,23 +2303,42 @@ static int rt5645_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask,
unsigned
int
rx_mask
,
int
slots
,
int
slot_width
)
{
struct
snd_soc_codec
*
codec
=
dai
->
codec
;
unsigned
int
val
=
0
;
struct
rt5645_priv
*
rt5645
=
snd_soc_codec_get_drvdata
(
codec
);
unsigned
int
i_slot_sft
,
o_slot_sft
,
i_width_sht
,
o_width_sht
,
en_sft
;
unsigned
int
mask
,
val
=
0
;
switch
(
rt5645
->
codec_type
)
{
case
CODEC_TYPE_RT5650
:
en_sft
=
15
;
i_slot_sft
=
10
;
o_slot_sft
=
8
;
i_width_sht
=
6
;
o_width_sht
=
4
;
mask
=
0x8ff0
;
break
;
default:
en_sft
=
14
;
i_slot_sft
=
o_slot_sft
=
12
;
i_width_sht
=
o_width_sht
=
10
;
mask
=
0x7c00
;
break
;
}
if
(
rx_mask
||
tx_mask
)
{
val
|=
(
1
<<
14
);
val
|=
(
1
<<
en_sft
);
if
(
rt5645
->
codec_type
==
CODEC_TYPE_RT5645
)
snd_soc_update_bits
(
codec
,
RT5645_BASS_BACK
,
RT5645_G_BB_BST_MASK
,
RT5645_G_BB_BST_25DB
);
}
switch
(
slots
)
{
case
4
:
val
|=
(
1
<<
12
);
val
|=
(
1
<<
i_slot_sft
)
|
(
1
<<
o_slot_sft
);
break
;
case
6
:
val
|=
(
2
<<
12
);
val
|=
(
2
<<
i_slot_sft
)
|
(
2
<<
o_slot_sft
);
break
;
case
8
:
val
|=
(
3
<<
12
);
val
|=
(
3
<<
i_slot_sft
)
|
(
3
<<
o_slot_sft
);
break
;
case
2
:
default:
...
...
@@ -2310,20 +2347,20 @@ static int rt5645_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask,
switch
(
slot_width
)
{
case
20
:
val
|=
(
1
<<
10
);
val
|=
(
1
<<
i_width_sht
)
|
(
1
<<
o_width_sht
);
break
;
case
24
:
val
|=
(
2
<<
10
);
val
|=
(
2
<<
i_width_sht
)
|
(
2
<<
o_width_sht
);
break
;
case
32
:
val
|=
(
3
<<
10
);
val
|=
(
3
<<
i_width_sht
)
|
(
3
<<
o_width_sht
);
break
;
case
16
:
default:
break
;
}
snd_soc_update_bits
(
codec
,
RT5645_TDM_CTRL_1
,
0x7c00
,
val
);
snd_soc_update_bits
(
codec
,
RT5645_TDM_CTRL_1
,
mask
,
val
);
return
0
;
}
...
...
@@ -2361,7 +2398,8 @@ static int rt5645_set_bias_level(struct snd_soc_codec *codec,
case
SND_SOC_BIAS_OFF
:
snd_soc_write
(
codec
,
RT5645_DEPOP_M2
,
0x1100
);
snd_soc_write
(
codec
,
RT5645_GEN_CTRL1
,
0x0128
);
snd_soc_update_bits
(
codec
,
RT5645_GEN_CTRL1
,
RT5645_DIG_GATE_CTRL
,
0
);
snd_soc_update_bits
(
codec
,
RT5645_PWR_ANLG1
,
RT5645_PWR_VREF1
|
RT5645_PWR_MB
|
RT5645_PWR_BG
|
RT5645_PWR_VREF2
|
...
...
@@ -2598,7 +2636,7 @@ static struct snd_soc_codec_driver soc_codec_dev_rt5645 = {
static
const
struct
regmap_config
rt5645_regmap
=
{
.
reg_bits
=
8
,
.
val_bits
=
16
,
.
use_single_rw
=
true
,
.
max_register
=
RT5645_VENDOR_ID2
+
1
+
(
ARRAY_SIZE
(
rt5645_ranges
)
*
RT5645_PR_SPACING
),
.
volatile_reg
=
rt5645_volatile_register
,
...
...
sound/soc/codecs/rt5645.h
浏览文件 @
7ad2d1d5
...
...
@@ -804,8 +804,6 @@
#define RT5645_PWR_DAC_MF_L_BIT 10
#define RT5645_PWR_DAC_MF_R (0x1 << 9)
#define RT5645_PWR_DAC_MF_R_BIT 9
#define RT5645_PWR_ADC_S2F (0x1 << 8)
#define RT5645_PWR_ADC_S2F_BIT 8
#define RT5645_PWR_PDM1 (0x1 << 7)
#define RT5645_PWR_PDM1_BIT 7
#define RT5645_PWR_PDM2 (0x1 << 6)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录