Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
6abb3190
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
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看板
提交
6abb3190
编写于
1月 31, 2011
作者:
T
Takashi Iwai
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'topic/hda' into fix/hda
上级
efbeb071
19593875
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
79 addition
and
63 deletion
+79
-63
Documentation/sound/alsa/HD-Audio-Models.txt
Documentation/sound/alsa/HD-Audio-Models.txt
+1
-0
sound/pci/hda/patch_conexant.c
sound/pci/hda/patch_conexant.c
+78
-63
未找到文件。
Documentation/sound/alsa/HD-Audio-Models.txt
浏览文件 @
6abb3190
...
...
@@ -296,6 +296,7 @@ Conexant 5066
=============
laptop Basic Laptop config (default)
hp-laptop HP laptops, e g G60
asus Asus K52JU, Lenovo G560
dell-laptop Dell laptops
dell-vostro Dell Vostro
olpc-xo-1_5 OLPC XO 1.5
...
...
sound/pci/hda/patch_conexant.c
浏览文件 @
6abb3190
...
...
@@ -85,6 +85,7 @@ struct conexant_spec {
unsigned
int
auto_mic
;
int
auto_mic_ext
;
/* autocfg.inputs[] index for ext mic */
unsigned
int
need_dac_fix
;
hda_nid_t
slave_dig_outs
[
2
];
/* capture */
unsigned
int
num_adc_nids
;
...
...
@@ -127,6 +128,7 @@ struct conexant_spec {
unsigned
int
ideapad
:
1
;
unsigned
int
thinkpad
:
1
;
unsigned
int
hp_laptop
:
1
;
unsigned
int
asus
:
1
;
unsigned
int
ext_mic_present
;
unsigned
int
recording
;
...
...
@@ -352,6 +354,8 @@ static int conexant_build_pcms(struct hda_codec *codec)
info
->
stream
[
SNDRV_PCM_STREAM_CAPTURE
].
nid
=
spec
->
dig_in_nid
;
}
if
(
spec
->
slave_dig_outs
[
0
])
codec
->
slave_dig_outs
=
spec
->
slave_dig_outs
;
}
return
0
;
...
...
@@ -2100,7 +2104,7 @@ static int patch_cxt5051(struct hda_codec *codec)
static
hda_nid_t
cxt5066_dac_nids
[
1
]
=
{
0x10
};
static
hda_nid_t
cxt5066_adc_nids
[
3
]
=
{
0x14
,
0x15
,
0x16
};
static
hda_nid_t
cxt5066_capsrc_nids
[
1
]
=
{
0x17
};
#define CXT5066_SPDIF_OUT 0x21
static
hda_nid_t
cxt5066_digout_pin_nids
[
2
]
=
{
0x20
,
0x22
};
/* OLPC's microphone port is DC coupled for use with external sensors,
* therefore we use a 50% mic bias in order to center the input signal with
...
...
@@ -2312,6 +2316,19 @@ static void cxt5066_ideapad_automic(struct hda_codec *codec)
}
}
/* toggle input of built-in digital mic and mic jack appropriately */
static
void
cxt5066_asus_automic
(
struct
hda_codec
*
codec
)
{
unsigned
int
present
;
present
=
snd_hda_jack_detect
(
codec
,
0x1b
);
snd_printdd
(
"CXT5066: external microphone present=%d
\n
"
,
present
);
snd_hda_codec_write
(
codec
,
0x17
,
0
,
AC_VERB_SET_CONNECT_SEL
,
present
?
1
:
0
);
}
/* toggle input of built-in digital mic and mic jack appropriately */
static
void
cxt5066_hp_laptop_automic
(
struct
hda_codec
*
codec
)
{
...
...
@@ -2387,79 +2404,55 @@ static void cxt5066_hp_automute(struct hda_codec *codec)
cxt5066_update_speaker
(
codec
);
}
/*
unsolicited event for jack sensing
*/
static
void
cxt5066_
olpc_unsol_event
(
struct
hda_codec
*
codec
,
unsigned
int
res
)
/*
Dispatch the right mic autoswitch function
*/
static
void
cxt5066_
automic
(
struct
hda_codec
*
codec
)
{
struct
conexant_spec
*
spec
=
codec
->
spec
;
snd_printdd
(
"CXT5066: unsol event %x (%x)
\n
"
,
res
,
res
>>
26
);
switch
(
res
>>
26
)
{
case
CONEXANT_HP_EVENT
:
cxt5066_hp_automute
(
codec
);
break
;
case
CONEXANT_MIC_EVENT
:
/* ignore mic events in DC mode; we're always using the jack */
if
(
!
spec
->
dc_enable
)
cxt5066_olpc_automic
(
codec
);
break
;
}
}
/* unsolicited event for jack sensing */
static
void
cxt5066_vostro_event
(
struct
hda_codec
*
codec
,
unsigned
int
res
)
{
snd_printdd
(
"CXT5066_vostro: unsol event %x (%x)
\n
"
,
res
,
res
>>
26
);
switch
(
res
>>
26
)
{
case
CONEXANT_HP_EVENT
:
cxt5066_hp_automute
(
codec
);
break
;
case
CONEXANT_MIC_EVENT
:
if
(
spec
->
dell_vostro
)
cxt5066_vostro_automic
(
codec
);
break
;
}
}
/* unsolicited event for jack sensing */
static
void
cxt5066_ideapad_event
(
struct
hda_codec
*
codec
,
unsigned
int
res
)
{
snd_printdd
(
"CXT5066_ideapad: unsol event %x (%x)
\n
"
,
res
,
res
>>
26
);
switch
(
res
>>
26
)
{
case
CONEXANT_HP_EVENT
:
cxt5066_hp_automute
(
codec
);
break
;
case
CONEXANT_MIC_EVENT
:
else
if
(
spec
->
ideapad
)
cxt5066_ideapad_automic
(
codec
);
break
;
}
else
if
(
spec
->
thinkpad
)
cxt5066_thinkpad_automic
(
codec
);
else
if
(
spec
->
hp_laptop
)
cxt5066_hp_laptop_automic
(
codec
);
else
if
(
spec
->
asus
)
cxt5066_asus_automic
(
codec
);
}
/* unsolicited event for jack sensing */
static
void
cxt5066_
hp_laptop
_event
(
struct
hda_codec
*
codec
,
unsigned
int
res
)
static
void
cxt5066_
olpc_unsol
_event
(
struct
hda_codec
*
codec
,
unsigned
int
res
)
{
snd_printdd
(
"CXT5066_hp_laptop: unsol event %x (%x)
\n
"
,
res
,
res
>>
26
);
struct
conexant_spec
*
spec
=
codec
->
spec
;
snd_printdd
(
"CXT5066: unsol event %x (%x)
\n
"
,
res
,
res
>>
26
);
switch
(
res
>>
26
)
{
case
CONEXANT_HP_EVENT
:
cxt5066_hp_automute
(
codec
);
break
;
case
CONEXANT_MIC_EVENT
:
cxt5066_hp_laptop_automic
(
codec
);
/* ignore mic events in DC mode; we're always using the jack */
if
(
!
spec
->
dc_enable
)
cxt5066_olpc_automic
(
codec
);
break
;
}
}
/* unsolicited event for jack sensing */
static
void
cxt5066_
thinkpad
_event
(
struct
hda_codec
*
codec
,
unsigned
int
res
)
static
void
cxt5066_
unsol
_event
(
struct
hda_codec
*
codec
,
unsigned
int
res
)
{
snd_printdd
(
"CXT5066
_thinkpad
: unsol event %x (%x)
\n
"
,
res
,
res
>>
26
);
snd_printdd
(
"CXT5066: unsol event %x (%x)
\n
"
,
res
,
res
>>
26
);
switch
(
res
>>
26
)
{
case
CONEXANT_HP_EVENT
:
cxt5066_hp_automute
(
codec
);
break
;
case
CONEXANT_MIC_EVENT
:
cxt5066_
thinkpad_
automic
(
codec
);
cxt5066_automic
(
codec
);
break
;
}
}
static
const
struct
hda_input_mux
cxt5066_analog_mic_boost
=
{
.
num_items
=
5
,
.
items
=
{
...
...
@@ -2633,6 +2626,27 @@ static void cxt5066_olpc_capture_cleanup(struct hda_codec *codec)
spec
->
recording
=
0
;
}
static
void
conexant_check_dig_outs
(
struct
hda_codec
*
codec
,
hda_nid_t
*
dig_pins
,
int
num_pins
)
{
struct
conexant_spec
*
spec
=
codec
->
spec
;
hda_nid_t
*
nid_loc
=
&
spec
->
multiout
.
dig_out_nid
;
int
i
;
for
(
i
=
0
;
i
<
num_pins
;
i
++
,
dig_pins
++
)
{
unsigned
int
cfg
=
snd_hda_codec_get_pincfg
(
codec
,
*
dig_pins
);
if
(
get_defcfg_connect
(
cfg
)
==
AC_JACK_PORT_NONE
)
continue
;
if
(
snd_hda_get_connections
(
codec
,
*
dig_pins
,
nid_loc
,
1
)
!=
1
)
continue
;
if
(
spec
->
slave_dig_outs
[
0
])
nid_loc
++
;
else
nid_loc
=
spec
->
slave_dig_outs
;
}
}
static
struct
hda_input_mux
cxt5066_capture_source
=
{
.
num_items
=
4
,
.
items
=
{
...
...
@@ -3039,20 +3053,11 @@ static struct hda_verb cxt5066_init_verbs_hp_laptop[] = {
/* initialize jack-sensing, too */
static
int
cxt5066_init
(
struct
hda_codec
*
codec
)
{
struct
conexant_spec
*
spec
=
codec
->
spec
;
snd_printdd
(
"CXT5066: init
\n
"
);
conexant_init
(
codec
);
if
(
codec
->
patch_ops
.
unsol_event
)
{
cxt5066_hp_automute
(
codec
);
if
(
spec
->
dell_vostro
)
cxt5066_vostro_automic
(
codec
);
else
if
(
spec
->
ideapad
)
cxt5066_ideapad_automic
(
codec
);
else
if
(
spec
->
thinkpad
)
cxt5066_thinkpad_automic
(
codec
);
else
if
(
spec
->
hp_laptop
)
cxt5066_hp_laptop_automic
(
codec
);
cxt5066_automic
(
codec
);
}
cxt5066_set_mic_boost
(
codec
);
return
0
;
...
...
@@ -3080,6 +3085,7 @@ enum {
CXT5066_DELL_VOSTRO
,
/* Dell Vostro 1015i */
CXT5066_IDEAPAD
,
/* Lenovo IdeaPad U150 */
CXT5066_THINKPAD
,
/* Lenovo ThinkPad T410s, others? */
CXT5066_ASUS
,
/* Asus K52JU, Lenovo G560 - Int mic at 0x1a and Ext mic at 0x1b */
CXT5066_HP_LAPTOP
,
/* HP Laptop */
CXT5066_MODELS
};
...
...
@@ -3091,6 +3097,7 @@ static const char * const cxt5066_models[CXT5066_MODELS] = {
[
CXT5066_DELL_VOSTRO
]
=
"dell-vostro"
,
[
CXT5066_IDEAPAD
]
=
"ideapad"
,
[
CXT5066_THINKPAD
]
=
"thinkpad"
,
[
CXT5066_ASUS
]
=
"asus"
,
[
CXT5066_HP_LAPTOP
]
=
"hp-laptop"
,
};
...
...
@@ -3102,7 +3109,9 @@ static struct snd_pci_quirk cxt5066_cfg_tbl[] = {
SND_PCI_QUIRK
(
0x1028
,
0x0402
,
"Dell Vostro"
,
CXT5066_DELL_VOSTRO
),
SND_PCI_QUIRK
(
0x1028
,
0x0408
,
"Dell Inspiron One 19T"
,
CXT5066_IDEAPAD
),
SND_PCI_QUIRK
(
0x103c
,
0x360b
,
"HP G60"
,
CXT5066_HP_LAPTOP
),
SND_PCI_QUIRK
(
0x1043
,
0x13f3
,
"Asus A52J"
,
CXT5066_HP_LAPTOP
),
SND_PCI_QUIRK
(
0x1043
,
0x13f3
,
"Asus A52J"
,
CXT5066_ASUS
),
SND_PCI_QUIRK
(
0x1043
,
0x1643
,
"Asus K52JU"
,
CXT5066_ASUS
),
SND_PCI_QUIRK
(
0x1043
,
0x1993
,
"Asus U50F"
,
CXT5066_ASUS
),
SND_PCI_QUIRK
(
0x1179
,
0xff1e
,
"Toshiba Satellite C650D"
,
CXT5066_IDEAPAD
),
SND_PCI_QUIRK
(
0x1179
,
0xff50
,
"Toshiba Satellite P500-PSPGSC-01800T"
,
CXT5066_OLPC_XO_1_5
),
SND_PCI_QUIRK
(
0x1179
,
0xffe0
,
"Toshiba Satellite Pro T130-15F"
,
CXT5066_OLPC_XO_1_5
),
...
...
@@ -3111,7 +3120,9 @@ static struct snd_pci_quirk cxt5066_cfg_tbl[] = {
SND_PCI_QUIRK
(
0x152d
,
0x0833
,
"OLPC XO-1.5"
,
CXT5066_OLPC_XO_1_5
),
SND_PCI_QUIRK
(
0x17aa
,
0x20f2
,
"Lenovo T400s"
,
CXT5066_THINKPAD
),
SND_PCI_QUIRK
(
0x17aa
,
0x21c5
,
"Thinkpad Edge 13"
,
CXT5066_THINKPAD
),
SND_PCI_QUIRK
(
0x17aa
,
0x21c6
,
"Thinkpad Edge 13"
,
CXT5066_ASUS
),
SND_PCI_QUIRK
(
0x17aa
,
0x215e
,
"Lenovo Thinkpad"
,
CXT5066_THINKPAD
),
SND_PCI_QUIRK
(
0x17aa
,
0x38af
,
"Lenovo G560"
,
CXT5066_ASUS
),
SND_PCI_QUIRK_VENDOR
(
0x17aa
,
"Lenovo"
,
CXT5066_IDEAPAD
),
/* Fallback for Lenovos without dock mic */
{}
};
...
...
@@ -3133,7 +3144,8 @@ static int patch_cxt5066(struct hda_codec *codec)
spec
->
multiout
.
max_channels
=
2
;
spec
->
multiout
.
num_dacs
=
ARRAY_SIZE
(
cxt5066_dac_nids
);
spec
->
multiout
.
dac_nids
=
cxt5066_dac_nids
;
spec
->
multiout
.
dig_out_nid
=
CXT5066_SPDIF_OUT
;
conexant_check_dig_outs
(
codec
,
cxt5066_digout_pin_nids
,
ARRAY_SIZE
(
cxt5066_digout_pin_nids
));
spec
->
num_adc_nids
=
1
;
spec
->
adc_nids
=
cxt5066_adc_nids
;
spec
->
capsrc_nids
=
cxt5066_capsrc_nids
;
...
...
@@ -3167,17 +3179,20 @@ static int patch_cxt5066(struct hda_codec *codec)
spec
->
num_init_verbs
++
;
spec
->
dell_automute
=
1
;
break
;
case
CXT5066_ASUS
:
case
CXT5066_HP_LAPTOP
:
codec
->
patch_ops
.
init
=
cxt5066_init
;
codec
->
patch_ops
.
unsol_event
=
cxt5066_
hp_laptop
_event
;
codec
->
patch_ops
.
unsol_event
=
cxt5066_
unsol
_event
;
spec
->
init_verbs
[
spec
->
num_init_verbs
]
=
cxt5066_init_verbs_hp_laptop
;
spec
->
num_init_verbs
++
;
spec
->
hp_laptop
=
1
;
spec
->
hp_laptop
=
board_config
==
CXT5066_HP_LAPTOP
;
spec
->
asus
=
board_config
==
CXT5066_ASUS
;
spec
->
mixers
[
spec
->
num_mixers
++
]
=
cxt5066_mixer_master
;
spec
->
mixers
[
spec
->
num_mixers
++
]
=
cxt5066_mixers
;
/* no S/PDIF out */
spec
->
multiout
.
dig_out_nid
=
0
;
if
(
board_config
==
CXT5066_HP_LAPTOP
)
spec
->
multiout
.
dig_out_nid
=
0
;
/* input source automatically selected */
spec
->
input_mux
=
NULL
;
spec
->
port_d_mode
=
0
;
...
...
@@ -3207,7 +3222,7 @@ static int patch_cxt5066(struct hda_codec *codec)
break
;
case
CXT5066_DELL_VOSTRO
:
codec
->
patch_ops
.
init
=
cxt5066_init
;
codec
->
patch_ops
.
unsol_event
=
cxt5066_
vostro
_event
;
codec
->
patch_ops
.
unsol_event
=
cxt5066_
unsol
_event
;
spec
->
init_verbs
[
0
]
=
cxt5066_init_verbs_vostro
;
spec
->
mixers
[
spec
->
num_mixers
++
]
=
cxt5066_mixer_master_olpc
;
spec
->
mixers
[
spec
->
num_mixers
++
]
=
cxt5066_mixers
;
...
...
@@ -3224,7 +3239,7 @@ static int patch_cxt5066(struct hda_codec *codec)
break
;
case
CXT5066_IDEAPAD
:
codec
->
patch_ops
.
init
=
cxt5066_init
;
codec
->
patch_ops
.
unsol_event
=
cxt5066_
ideapad
_event
;
codec
->
patch_ops
.
unsol_event
=
cxt5066_
unsol
_event
;
spec
->
mixers
[
spec
->
num_mixers
++
]
=
cxt5066_mixer_master
;
spec
->
mixers
[
spec
->
num_mixers
++
]
=
cxt5066_mixers
;
spec
->
init_verbs
[
0
]
=
cxt5066_init_verbs_ideapad
;
...
...
@@ -3240,7 +3255,7 @@ static int patch_cxt5066(struct hda_codec *codec)
break
;
case
CXT5066_THINKPAD
:
codec
->
patch_ops
.
init
=
cxt5066_init
;
codec
->
patch_ops
.
unsol_event
=
cxt5066_
thinkpad
_event
;
codec
->
patch_ops
.
unsol_event
=
cxt5066_
unsol
_event
;
spec
->
mixers
[
spec
->
num_mixers
++
]
=
cxt5066_mixer_master
;
spec
->
mixers
[
spec
->
num_mixers
++
]
=
cxt5066_mixers
;
spec
->
init_verbs
[
0
]
=
cxt5066_init_verbs_thinkpad
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录