Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
1e570a83
K
Kernel
项目概览
openeuler
/
Kernel
大约 1 年 前同步成功
通知
5
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,发现更多精彩内容 >>
提交
1e570a83
编写于
12月 12, 2016
作者:
M
Mark Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branches 'asoc/fix/da7219-pops' and 'asoc/fix/qcom' into asoc-linus
上级
2e8239e7
86834511
3b89e4b7
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
143 addition
and
22 deletion
+143
-22
sound/soc/codecs/da7219-aad.c
sound/soc/codecs/da7219-aad.c
+14
-4
sound/soc/codecs/da7219.c
sound/soc/codecs/da7219.c
+121
-18
sound/soc/codecs/da7219.h
sound/soc/codecs/da7219.h
+5
-0
sound/soc/qcom/lpass-platform.c
sound/soc/qcom/lpass-platform.c
+3
-0
未找到文件。
sound/soc/codecs/da7219-aad.c
浏览文件 @
1e570a83
...
...
@@ -204,10 +204,19 @@ static void da7219_aad_hptest_work(struct work_struct *work)
snd_soc_update_bits
(
codec
,
DA7219_MIXOUT_R_CTRL
,
DA7219_MIXOUT_R_AMP_EN_MASK
,
DA7219_MIXOUT_R_AMP_EN_MASK
);
snd_soc_write
(
codec
,
DA7219_HP_L_CTRL
,
DA7219_HP_L_AMP_OE_MASK
|
DA7219_HP_L_AMP_EN_MASK
);
snd_soc_write
(
codec
,
DA7219_HP_R_CTRL
,
DA7219_HP_R_AMP_OE_MASK
|
DA7219_HP_R_AMP_EN_MASK
);
snd_soc_update_bits
(
codec
,
DA7219_HP_L_CTRL
,
DA7219_HP_L_AMP_OE_MASK
|
DA7219_HP_L_AMP_EN_MASK
,
DA7219_HP_L_AMP_OE_MASK
|
DA7219_HP_L_AMP_EN_MASK
);
snd_soc_update_bits
(
codec
,
DA7219_HP_R_CTRL
,
DA7219_HP_R_AMP_OE_MASK
|
DA7219_HP_R_AMP_EN_MASK
,
DA7219_HP_R_AMP_OE_MASK
|
DA7219_HP_R_AMP_EN_MASK
);
msleep
(
DA7219_SETTLING_DELAY
);
snd_soc_update_bits
(
codec
,
DA7219_HP_L_CTRL
,
DA7219_HP_L_AMP_MUTE_EN_MASK
|
DA7219_HP_L_AMP_MIN_GAIN_EN_MASK
,
0
);
snd_soc_update_bits
(
codec
,
DA7219_HP_R_CTRL
,
DA7219_HP_R_AMP_MUTE_EN_MASK
|
DA7219_HP_R_AMP_MIN_GAIN_EN_MASK
,
0
);
/*
* If we're running from the internal oscillator then give audio paths
...
...
@@ -244,6 +253,7 @@ static void da7219_aad_hptest_work(struct work_struct *work)
regcache_mark_dirty
(
da7219
->
regmap
);
regcache_sync_region
(
da7219
->
regmap
,
DA7219_HP_L_CTRL
,
DA7219_HP_R_CTRL
);
msleep
(
DA7219_SETTLING_DELAY
);
regcache_sync_region
(
da7219
->
regmap
,
DA7219_MIXOUT_L_CTRL
,
DA7219_MIXOUT_R_CTRL
);
regcache_sync_region
(
da7219
->
regmap
,
DA7219_DROUTING_ST_OUTFILT_1L
,
...
...
sound/soc/codecs/da7219.c
浏览文件 @
1e570a83
...
...
@@ -823,6 +823,85 @@ static int da7219_dai_event(struct snd_soc_dapm_widget *w,
}
}
static
int
da7219_settling_event
(
struct
snd_soc_dapm_widget
*
w
,
struct
snd_kcontrol
*
kcontrol
,
int
event
)
{
switch
(
event
)
{
case
SND_SOC_DAPM_POST_PMU
:
case
SND_SOC_DAPM_POST_PMD
:
msleep
(
DA7219_SETTLING_DELAY
);
break
;
default:
break
;
}
return
0
;
}
static
int
da7219_mixout_event
(
struct
snd_soc_dapm_widget
*
w
,
struct
snd_kcontrol
*
kcontrol
,
int
event
)
{
struct
snd_soc_codec
*
codec
=
snd_soc_dapm_to_codec
(
w
->
dapm
);
u8
hp_ctrl
,
min_gain_mask
;
switch
(
w
->
reg
)
{
case
DA7219_MIXOUT_L_CTRL
:
hp_ctrl
=
DA7219_HP_L_CTRL
;
min_gain_mask
=
DA7219_HP_L_AMP_MIN_GAIN_EN_MASK
;
break
;
case
DA7219_MIXOUT_R_CTRL
:
hp_ctrl
=
DA7219_HP_R_CTRL
;
min_gain_mask
=
DA7219_HP_R_AMP_MIN_GAIN_EN_MASK
;
break
;
default:
return
-
EINVAL
;
}
switch
(
event
)
{
case
SND_SOC_DAPM_PRE_PMD
:
/* Enable minimum gain on HP to avoid pops */
snd_soc_update_bits
(
codec
,
hp_ctrl
,
min_gain_mask
,
min_gain_mask
);
msleep
(
DA7219_MIN_GAIN_DELAY
);
break
;
case
SND_SOC_DAPM_POST_PMU
:
/* Remove minimum gain on HP */
snd_soc_update_bits
(
codec
,
hp_ctrl
,
min_gain_mask
,
0
);
break
;
}
return
0
;
}
static
int
da7219_gain_ramp_event
(
struct
snd_soc_dapm_widget
*
w
,
struct
snd_kcontrol
*
kcontrol
,
int
event
)
{
struct
snd_soc_codec
*
codec
=
snd_soc_dapm_to_codec
(
w
->
dapm
);
struct
da7219_priv
*
da7219
=
snd_soc_codec_get_drvdata
(
codec
);
switch
(
event
)
{
case
SND_SOC_DAPM_PRE_PMU
:
case
SND_SOC_DAPM_PRE_PMD
:
/* Ensure nominal gain ramping for DAPM sequence */
da7219
->
gain_ramp_ctrl
=
snd_soc_read
(
codec
,
DA7219_GAIN_RAMP_CTRL
);
snd_soc_write
(
codec
,
DA7219_GAIN_RAMP_CTRL
,
DA7219_GAIN_RAMP_RATE_NOMINAL
);
break
;
case
SND_SOC_DAPM_POST_PMU
:
case
SND_SOC_DAPM_POST_PMD
:
/* Restore previous gain ramp settings */
snd_soc_write
(
codec
,
DA7219_GAIN_RAMP_CTRL
,
da7219
->
gain_ramp_ctrl
);
break
;
}
return
0
;
}
/*
* DAPM Widgets
...
...
@@ -907,30 +986,46 @@ static const struct snd_soc_dapm_widget da7219_dapm_widgets[] = {
ARRAY_SIZE
(
da7219_st_out_filtr_mix_controls
)),
/* DACs */
SND_SOC_DAPM_DAC
(
"DACL"
,
NULL
,
DA7219_DAC_L_CTRL
,
DA7219_DAC_L_EN_SHIFT
,
DA7219_NO_INVERT
),
SND_SOC_DAPM_DAC
(
"DACR"
,
NULL
,
DA7219_DAC_R_CTRL
,
DA7219_DAC_R_EN_SHIFT
,
DA7219_NO_INVERT
),
SND_SOC_DAPM_DAC_E
(
"DACL"
,
NULL
,
DA7219_DAC_L_CTRL
,
DA7219_DAC_L_EN_SHIFT
,
DA7219_NO_INVERT
,
da7219_settling_event
,
SND_SOC_DAPM_POST_PMU
|
SND_SOC_DAPM_POST_PMD
),
SND_SOC_DAPM_DAC_E
(
"DACR"
,
NULL
,
DA7219_DAC_R_CTRL
,
DA7219_DAC_R_EN_SHIFT
,
DA7219_NO_INVERT
,
da7219_settling_event
,
SND_SOC_DAPM_POST_PMU
|
SND_SOC_DAPM_POST_PMD
),
/* Output PGAs */
SND_SOC_DAPM_PGA
(
"Mixout Left PGA"
,
DA7219_MIXOUT_L_CTRL
,
DA7219_MIXOUT_L_AMP_EN_SHIFT
,
DA7219_NO_INVERT
,
NULL
,
0
),
SND_SOC_DAPM_PGA
(
"Mixout Right PGA"
,
DA7219_MIXOUT_R_CTRL
,
DA7219_MIXOUT_R_AMP_EN_SHIFT
,
DA7219_NO_INVERT
,
NULL
,
0
),
SND_SOC_DAPM_PGA
(
"Headphone Left PGA"
,
DA7219_HP_L_CTRL
,
DA7219_HP_L_AMP_EN_SHIFT
,
DA7219_NO_INVERT
,
NULL
,
0
),
SND_SOC_DAPM_PGA
(
"Headphone Right PGA"
,
DA7219_HP_R_CTRL
,
DA7219_HP_R_AMP_EN_SHIFT
,
DA7219_NO_INVERT
,
NULL
,
0
),
SND_SOC_DAPM_PGA_E
(
"Mixout Left PGA"
,
DA7219_MIXOUT_L_CTRL
,
DA7219_MIXOUT_L_AMP_EN_SHIFT
,
DA7219_NO_INVERT
,
NULL
,
0
,
da7219_mixout_event
,
SND_SOC_DAPM_POST_PMU
|
SND_SOC_DAPM_PRE_PMD
),
SND_SOC_DAPM_PGA_E
(
"Mixout Right PGA"
,
DA7219_MIXOUT_R_CTRL
,
DA7219_MIXOUT_R_AMP_EN_SHIFT
,
DA7219_NO_INVERT
,
NULL
,
0
,
da7219_mixout_event
,
SND_SOC_DAPM_POST_PMU
|
SND_SOC_DAPM_PRE_PMD
),
SND_SOC_DAPM_SUPPLY_S
(
"Headphone Left PGA"
,
1
,
DA7219_HP_L_CTRL
,
DA7219_HP_L_AMP_EN_SHIFT
,
DA7219_NO_INVERT
,
da7219_settling_event
,
SND_SOC_DAPM_POST_PMU
|
SND_SOC_DAPM_POST_PMD
),
SND_SOC_DAPM_SUPPLY_S
(
"Headphone Right PGA"
,
1
,
DA7219_HP_R_CTRL
,
DA7219_HP_R_AMP_EN_SHIFT
,
DA7219_NO_INVERT
,
da7219_settling_event
,
SND_SOC_DAPM_POST_PMU
|
SND_SOC_DAPM_POST_PMD
),
/* Output Supplies */
SND_SOC_DAPM_SUPPLY
(
"Charge Pump"
,
DA7219_CP_CTRL
,
DA7219_CP_EN_SHIFT
,
DA7219_NO_INVERT
,
NULL
,
0
),
SND_SOC_DAPM_SUPPLY_S
(
"Charge Pump"
,
0
,
DA7219_CP_CTRL
,
DA7219_CP_EN_SHIFT
,
DA7219_NO_INVERT
,
da7219_settling_event
,
SND_SOC_DAPM_POST_PMU
),
/* Outputs */
SND_SOC_DAPM_OUTPUT
(
"HPL"
),
SND_SOC_DAPM_OUTPUT
(
"HPR"
),
/* Pre/Post Power */
SND_SOC_DAPM_PRE
(
"Pre Power Gain Ramp"
,
da7219_gain_ramp_event
),
SND_SOC_DAPM_POST
(
"Post Power Gain Ramp"
,
da7219_gain_ramp_event
),
};
...
...
@@ -1003,8 +1098,8 @@ static const struct snd_soc_dapm_route da7219_audio_map[] = {
{
"Mixout Left PGA"
,
NULL
,
"DACL"
},
{
"Mixout Right PGA"
,
NULL
,
"DACR"
},
{
"H
eadphone Left PGA
"
,
NULL
,
"Mixout Left PGA"
},
{
"H
eadphone Right PGA
"
,
NULL
,
"Mixout Right PGA"
},
{
"H
PL
"
,
NULL
,
"Mixout Left PGA"
},
{
"H
PR
"
,
NULL
,
"Mixout Right PGA"
},
{
"HPL"
,
NULL
,
"Headphone Left PGA"
},
{
"HPR"
,
NULL
,
"Headphone Right PGA"
},
...
...
@@ -1712,6 +1807,14 @@ static int da7219_probe(struct snd_soc_codec *codec)
DA7219_HP_R_AMP_RAMP_EN_MASK
,
DA7219_HP_R_AMP_RAMP_EN_MASK
);
/* Default minimum gain on HP to avoid pops during DAPM sequencing */
snd_soc_update_bits
(
codec
,
DA7219_HP_L_CTRL
,
DA7219_HP_L_AMP_MIN_GAIN_EN_MASK
,
DA7219_HP_L_AMP_MIN_GAIN_EN_MASK
);
snd_soc_update_bits
(
codec
,
DA7219_HP_R_CTRL
,
DA7219_HP_R_AMP_MIN_GAIN_EN_MASK
,
DA7219_HP_R_AMP_MIN_GAIN_EN_MASK
);
/* Default infinite tone gen, start/stop by Kcontrol */
snd_soc_write
(
codec
,
DA7219_TONE_GEN_CYCLES
,
DA7219_BEEP_CYCLES_MASK
);
...
...
sound/soc/codecs/da7219.h
浏览文件 @
1e570a83
...
...
@@ -777,6 +777,10 @@
#define DA7219_SYS_STAT_CHECK_RETRIES 6
#define DA7219_SYS_STAT_CHECK_DELAY 50
/* Power up/down Delays */
#define DA7219_SETTLING_DELAY 40
#define DA7219_MIN_GAIN_DELAY 30
enum
da7219_clk_src
{
DA7219_CLKSRC_MCLK
=
0
,
DA7219_CLKSRC_MCLK_SQR
,
...
...
@@ -814,6 +818,7 @@ struct da7219_priv {
bool
master
;
bool
alc_en
;
u8
gain_ramp_ctrl
;
};
#endif
/* __DA7219_H */
sound/soc/qcom/lpass-platform.c
浏览文件 @
1e570a83
...
...
@@ -78,6 +78,9 @@ static int lpass_platform_pcmops_open(struct snd_pcm_substream *substream)
dma_ch
=
0
;
if
(
v
->
alloc_dma_channel
)
dma_ch
=
v
->
alloc_dma_channel
(
drvdata
,
dir
);
else
dma_ch
=
0
;
if
(
dma_ch
<
0
)
return
dma_ch
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录