Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
8452a982
K
Kernel
项目概览
openeuler
/
Kernel
12 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
8452a982
编写于
7月 08, 2011
作者:
T
Takashi Iwai
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ALSA: hda - Merge ALC260 auto-parser code
Finally the last one. Signed-off-by:
N
Takashi Iwai
<
tiwai@suse.de
>
上级
4c11398e
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
11 addition
and
142 deletion
+11
-142
sound/pci/hda/patch_realtek.c
sound/pci/hda/patch_realtek.c
+11
-142
未找到文件。
sound/pci/hda/patch_realtek.c
浏览文件 @
8452a982
...
...
@@ -3677,132 +3677,6 @@ static int patch_alc880(struct hda_codec *codec)
/*
* ALC260 support
*/
/* convert from pin to volume-mixer widget */
static
hda_nid_t
alc260_pin_to_vol_mix
(
hda_nid_t
nid
)
{
if
(
nid
>=
0x0f
&&
nid
<=
0x11
)
return
nid
-
0x7
;
else
if
(
nid
>=
0x12
&&
nid
<=
0x15
)
return
0x08
;
else
return
0
;
}
static
int
alc260_add_playback_controls
(
struct
alc_spec
*
spec
,
hda_nid_t
nid
,
const
char
*
pfx
,
int
*
vol_bits
)
{
hda_nid_t
nid_vol
;
unsigned
long
vol_val
,
sw_val
;
int
chs
,
err
;
nid_vol
=
alc260_pin_to_vol_mix
(
nid
);
if
(
!
nid_vol
)
return
0
;
/* N/A */
if
(
nid
==
0x11
)
chs
=
2
;
else
chs
=
3
;
vol_val
=
HDA_COMPOSE_AMP_VAL
(
nid_vol
,
chs
,
0
,
HDA_OUTPUT
);
sw_val
=
HDA_COMPOSE_AMP_VAL
(
nid
,
chs
,
0
,
HDA_OUTPUT
);
if
(
!
(
*
vol_bits
&
(
1
<<
nid_vol
)))
{
/* first control for the volume widget */
err
=
add_pb_vol_ctrl
(
spec
,
ALC_CTL_WIDGET_VOL
,
pfx
,
vol_val
);
if
(
err
<
0
)
return
err
;
*
vol_bits
|=
(
1
<<
nid_vol
);
}
err
=
add_pb_sw_ctrl
(
spec
,
ALC_CTL_WIDGET_MUTE
,
pfx
,
sw_val
);
if
(
err
<
0
)
return
err
;
return
1
;
}
/* add playback controls from the parsed DAC table */
static
int
alc260_auto_create_multi_out_ctls
(
struct
alc_spec
*
spec
,
const
struct
auto_pin_cfg
*
cfg
)
{
hda_nid_t
nid
;
int
err
;
int
vols
=
0
;
spec
->
multiout
.
num_dacs
=
1
;
spec
->
multiout
.
dac_nids
=
spec
->
private_dac_nids
;
spec
->
private_dac_nids
[
0
]
=
0x02
;
nid
=
cfg
->
line_out_pins
[
0
];
if
(
nid
)
{
const
char
*
pfx
;
int
index
;
pfx
=
alc_get_line_out_pfx
(
spec
,
0
,
true
,
&
index
);
err
=
alc260_add_playback_controls
(
spec
,
nid
,
pfx
,
&
vols
);
if
(
err
<
0
)
return
err
;
}
nid
=
cfg
->
speaker_pins
[
0
];
if
(
nid
)
{
err
=
alc260_add_playback_controls
(
spec
,
nid
,
"Speaker"
,
&
vols
);
if
(
err
<
0
)
return
err
;
}
nid
=
cfg
->
hp_pins
[
0
];
if
(
nid
)
{
err
=
alc260_add_playback_controls
(
spec
,
nid
,
"Headphone"
,
&
vols
);
if
(
err
<
0
)
return
err
;
}
return
0
;
}
static
void
alc260_auto_set_output_and_unmute
(
struct
hda_codec
*
codec
,
hda_nid_t
nid
,
int
pin_type
,
int
sel_idx
)
{
hda_nid_t
mix
;
alc_set_pin_output
(
codec
,
nid
,
pin_type
);
/* need the manual connection? */
if
(
nid
>=
0x12
)
{
int
idx
=
nid
-
0x12
;
snd_hda_codec_write
(
codec
,
idx
+
0x0b
,
0
,
AC_VERB_SET_CONNECT_SEL
,
sel_idx
);
}
mix
=
alc260_pin_to_vol_mix
(
nid
);
if
(
!
mix
)
return
;
snd_hda_codec_write
(
codec
,
mix
,
0
,
AC_VERB_SET_AMP_GAIN_MUTE
,
AMP_OUT_ZERO
);
snd_hda_codec_write
(
codec
,
mix
,
0
,
AC_VERB_SET_AMP_GAIN_MUTE
,
AMP_IN_UNMUTE
(
0
));
snd_hda_codec_write
(
codec
,
mix
,
0
,
AC_VERB_SET_AMP_GAIN_MUTE
,
AMP_IN_UNMUTE
(
1
));
}
static
void
alc260_auto_init_multi_out
(
struct
hda_codec
*
codec
)
{
struct
alc_spec
*
spec
=
codec
->
spec
;
hda_nid_t
nid
;
nid
=
spec
->
autocfg
.
line_out_pins
[
0
];
if
(
nid
)
{
int
pin_type
=
get_pin_type
(
spec
->
autocfg
.
line_out_type
);
alc260_auto_set_output_and_unmute
(
codec
,
nid
,
pin_type
,
0
);
}
nid
=
spec
->
autocfg
.
speaker_pins
[
0
];
if
(
nid
)
alc260_auto_set_output_and_unmute
(
codec
,
nid
,
PIN_OUT
,
0
);
nid
=
spec
->
autocfg
.
hp_pins
[
0
];
if
(
nid
)
alc260_auto_set_output_and_unmute
(
codec
,
nid
,
PIN_HP
,
0
);
}
static
int
alc260_parse_auto_config
(
struct
hda_codec
*
codec
)
{
struct
alc_spec
*
spec
=
codec
->
spec
;
...
...
@@ -3813,11 +3687,18 @@ static int alc260_parse_auto_config(struct hda_codec *codec)
alc260_ignore
);
if
(
err
<
0
)
return
err
;
err
=
alc260_auto_create_multi_out_ctls
(
spec
,
&
spec
->
autocfg
);
err
=
alc_auto_fill_dac_nids
(
codec
);
if
(
err
<
0
)
return
err
;
err
=
alc_auto_create_multi_out_ctls
(
codec
,
&
spec
->
autocfg
);
if
(
err
<
0
)
return
err
;
err
=
alc_auto_create_hp_out
(
codec
);
if
(
err
<
0
)
return
err
;
err
=
alc_auto_create_speaker_out
(
codec
);
if
(
err
<
0
)
return
err
;
if
(
!
spec
->
kctls
.
list
)
return
0
;
/* can't find valid BIOS pin config */
err
=
alc_auto_create_input_ctls
(
codec
);
if
(
err
<
0
)
return
err
;
...
...
@@ -3837,18 +3718,6 @@ static int alc260_parse_auto_config(struct hda_codec *codec)
return
1
;
}
/* additional initialization for auto-configuration model */
static
void
alc260_auto_init
(
struct
hda_codec
*
codec
)
{
struct
alc_spec
*
spec
=
codec
->
spec
;
alc260_auto_init_multi_out
(
codec
);
alc_auto_init_analog_input
(
codec
);
alc_auto_init_input_src
(
codec
);
alc_auto_init_digital
(
codec
);
if
(
spec
->
unsol_event
)
alc_inithook
(
codec
);
}
#ifdef CONFIG_SND_HDA_POWER_SAVE
static
const
struct
hda_amp_list
alc260_loopbacks
[]
=
{
{
0x07
,
HDA_INPUT
,
0
},
...
...
@@ -3954,7 +3823,7 @@ static int patch_alc260(struct hda_codec *codec)
codec
->
patch_ops
=
alc_patch_ops
;
if
(
board_config
==
ALC_MODEL_AUTO
)
spec
->
init_hook
=
alc
260_auto_init
;
spec
->
init_hook
=
alc
_auto_init_std
;
spec
->
shutup
=
alc_eapd_shutup
;
#ifdef CONFIG_SND_HDA_POWER_SAVE
if
(
!
spec
->
loopback
.
amplist
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录