Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
0bebd2f1
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
0bebd2f1
编写于
10月 26, 2017
作者:
M
Mark Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branches 'asoc/fix/topology' and 'asoc/fix/wm8998' into asoc-linus
上级
b64395f1
f3ee9096
d24e95f8
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
23 addition
and
66 deletion
+23
-66
sound/soc/codecs/wm8998.c
sound/soc/codecs/wm8998.c
+19
-65
sound/soc/soc-topology.c
sound/soc/soc-topology.c
+4
-1
未找到文件。
sound/soc/codecs/wm8998.c
浏览文件 @
0bebd2f1
...
...
@@ -101,7 +101,7 @@ static int wm8998_asrc_ev(struct snd_soc_dapm_widget *w,
return
0
;
}
static
int
wm8998_in
1
mux_put
(
struct
snd_kcontrol
*
kcontrol
,
static
int
wm8998_inmux_put
(
struct
snd_kcontrol
*
kcontrol
,
struct
snd_ctl_elem_value
*
ucontrol
)
{
struct
snd_soc_codec
*
codec
=
snd_soc_dapm_kcontrol_codec
(
kcontrol
);
...
...
@@ -109,84 +109,38 @@ static int wm8998_in1mux_put(struct snd_kcontrol *kcontrol,
struct
wm8998_priv
*
wm8998
=
snd_soc_codec_get_drvdata
(
codec
);
struct
arizona
*
arizona
=
wm8998
->
core
.
arizona
;
struct
soc_enum
*
e
=
(
struct
soc_enum
*
)
kcontrol
->
private_value
;
unsigned
int
m
ux
,
inmode
;
unsigned
int
m
ode_val
,
src
_val
;
unsigned
int
m
ode_reg
,
mode_index
;
unsigned
int
m
ux
,
inmode
,
src_val
,
mode
_val
;
mux
=
ucontrol
->
value
.
enumerated
.
item
[
0
];
if
(
mux
>
1
)
return
-
EINVAL
;
/* L and R registers have same shift and mask */
inmode
=
arizona
->
pdata
.
inmode
[
2
*
mux
];
src_val
=
mux
<<
ARIZONA_IN1L_SRC_SHIFT
;
if
(
inmode
&
ARIZONA_INMODE_SE
)
src_val
|=
1
<<
ARIZONA_IN1L_SRC_SE_SHIFT
;
switch
(
arizona
->
pdata
.
inmode
[
0
])
{
case
ARIZONA_INMODE_DMIC
:
if
(
mux
)
mode_val
=
0
;
/* B always analogue */
else
mode_val
=
1
<<
ARIZONA_IN1_MODE_SHIFT
;
snd_soc_update_bits
(
codec
,
ARIZONA_IN1L_CONTROL
,
ARIZONA_IN1_MODE_MASK
,
mode_val
);
/* IN1A is digital so L and R must change together */
/* src_val setting same for both registers */
snd_soc_update_bits
(
codec
,
ARIZONA_ADC_DIGITAL_VOLUME_1L
,
ARIZONA_IN1L_SRC_MASK
|
ARIZONA_IN1L_SRC_SE_MASK
,
src_val
);
snd_soc_update_bits
(
codec
,
ARIZONA_ADC_DIGITAL_VOLUME_1R
,
ARIZONA_IN1R_SRC_MASK
|
ARIZONA_IN1R_SRC_SE_MASK
,
src_val
);
switch
(
e
->
reg
)
{
case
ARIZONA_ADC_DIGITAL_VOLUME_2L
:
mode_reg
=
ARIZONA_IN2L_CONTROL
;
mode_index
=
1
+
(
2
*
mux
);
break
;
default:
/* both analogue */
snd_soc_update_bits
(
codec
,
e
->
reg
,
ARIZONA_IN1L_SRC_MASK
|
ARIZONA_IN1L_SRC_SE_MASK
,
src_val
);
mode_reg
=
ARIZONA_IN1L_CONTROL
;
mode_index
=
(
2
*
mux
);
break
;
}
return
snd_soc_dapm_mux_update_power
(
dapm
,
kcontrol
,
ucontrol
->
value
.
enumerated
.
item
[
0
],
e
,
NULL
);
}
static
int
wm8998_in2mux_put
(
struct
snd_kcontrol
*
kcontrol
,
struct
snd_ctl_elem_value
*
ucontrol
)
{
struct
snd_soc_codec
*
codec
=
snd_soc_dapm_kcontrol_codec
(
kcontrol
);
struct
snd_soc_dapm_context
*
dapm
=
snd_soc_codec_get_dapm
(
codec
);
struct
wm8998_priv
*
wm8998
=
snd_soc_codec_get_drvdata
(
codec
);
struct
arizona
*
arizona
=
wm8998
->
core
.
arizona
;
struct
soc_enum
*
e
=
(
struct
soc_enum
*
)
kcontrol
->
private_value
;
unsigned
int
mux
,
inmode
,
src_val
,
mode_val
;
mux
=
ucontrol
->
value
.
enumerated
.
item
[
0
];
if
(
mux
>
1
)
return
-
EINVAL
;
inmode
=
arizona
->
pdata
.
inmode
[
1
+
(
2
*
mux
)];
inmode
=
arizona
->
pdata
.
inmode
[
mode_index
];
if
(
inmode
&
ARIZONA_INMODE_DMIC
)
mode_val
=
1
<<
ARIZONA_IN
2
_MODE_SHIFT
;
mode_val
=
1
<<
ARIZONA_IN
1
_MODE_SHIFT
;
else
mode_val
=
0
;
src_val
=
mux
<<
ARIZONA_IN
2
L_SRC_SHIFT
;
src_val
=
mux
<<
ARIZONA_IN
1
L_SRC_SHIFT
;
if
(
inmode
&
ARIZONA_INMODE_SE
)
src_val
|=
1
<<
ARIZONA_IN
2
L_SRC_SE_SHIFT
;
src_val
|=
1
<<
ARIZONA_IN
1
L_SRC_SE_SHIFT
;
snd_soc_update_bits
(
codec
,
ARIZONA_IN2L_CONTROL
,
ARIZONA_IN2_MODE_MASK
,
mode_val
);
snd_soc_update_bits
(
codec
,
mode_reg
,
ARIZONA_IN1_MODE_MASK
,
mode_val
);
snd_soc_update_bits
(
codec
,
ARIZONA_ADC_DIGITAL_VOLUME_2L
,
ARIZONA_IN
2L_SRC_MASK
|
ARIZONA_IN2
L_SRC_SE_MASK
,
snd_soc_update_bits
(
codec
,
e
->
reg
,
ARIZONA_IN
1L_SRC_MASK
|
ARIZONA_IN1
L_SRC_SE_MASK
,
src_val
);
return
snd_soc_dapm_mux_update_power
(
dapm
,
kcontrol
,
...
...
@@ -216,14 +170,14 @@ static SOC_ENUM_SINGLE_DECL(wm8998_in2mux_enum,
static
const
struct
snd_kcontrol_new
wm8998_in1mux
[
2
]
=
{
SOC_DAPM_ENUM_EXT
(
"IN1L Mux"
,
wm8998_in1muxl_enum
,
snd_soc_dapm_get_enum_double
,
wm8998_in
1
mux_put
),
snd_soc_dapm_get_enum_double
,
wm8998_inmux_put
),
SOC_DAPM_ENUM_EXT
(
"IN1R Mux"
,
wm8998_in1muxr_enum
,
snd_soc_dapm_get_enum_double
,
wm8998_in
1
mux_put
),
snd_soc_dapm_get_enum_double
,
wm8998_inmux_put
),
};
static
const
struct
snd_kcontrol_new
wm8998_in2mux
=
SOC_DAPM_ENUM_EXT
(
"IN2 Mux"
,
wm8998_in2mux_enum
,
snd_soc_dapm_get_enum_double
,
wm8998_in
2
mux_put
);
snd_soc_dapm_get_enum_double
,
wm8998_inmux_put
);
static
DECLARE_TLV_DB_SCALE
(
ana_tlv
,
0
,
100
,
0
);
static
DECLARE_TLV_DB_SCALE
(
eq_tlv
,
-
1200
,
100
,
0
);
...
...
sound/soc/soc-topology.c
浏览文件 @
0bebd2f1
...
...
@@ -1301,7 +1301,7 @@ static struct snd_kcontrol_new *soc_tplg_dapm_widget_denum_create(
/* validate kcontrol */
if
(
strnlen
(
ec
->
hdr
.
name
,
SNDRV_CTL_ELEM_ID_NAME_MAXLEN
)
==
SNDRV_CTL_ELEM_ID_NAME_MAXLEN
)
return
NULL
;
goto
err
;
se
=
kzalloc
(
sizeof
(
*
se
),
GFP_KERNEL
);
if
(
se
==
NULL
)
...
...
@@ -1378,6 +1378,9 @@ static struct snd_kcontrol_new *soc_tplg_dapm_widget_denum_create(
for
(;
i
>=
0
;
i
--
)
{
/* free values and texts */
se
=
(
struct
soc_enum
*
)
kc
[
i
].
private_value
;
if
(
!
se
)
continue
;
kfree
(
se
->
dobj
.
control
.
dvalues
);
for
(
j
=
0
;
j
<
ec
->
items
;
j
++
)
kfree
(
se
->
dobj
.
control
.
dtexts
[
j
]);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录