Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
5ff5c3a4
K
kernel_linux
项目概览
OpenHarmony
/
kernel_linux
上一次同步 3 年多
通知
13
Star
8
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kernel_linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
5ff5c3a4
编写于
4月 07, 2012
作者:
T
Takashi Iwai
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'fix/hda' into topic/hda
Conflicts: sound/pci/hda/patch_conexant.c
上级
18dcd304
250f3274
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
61 addition
and
77 deletion
+61
-77
sound/pci/asihpi/hpi_internal.h
sound/pci/asihpi/hpi_internal.h
+2
-2
sound/pci/asihpi/hpios.c
sound/pci/asihpi/hpios.c
+5
-5
sound/pci/hda/hda_codec.h
sound/pci/hda/hda_codec.h
+3
-0
sound/pci/hda/hda_proc.c
sound/pci/hda/hda_proc.c
+10
-3
sound/pci/hda/patch_conexant.c
sound/pci/hda/patch_conexant.c
+41
-67
未找到文件。
sound/pci/asihpi/hpi_internal.h
浏览文件 @
5ff5c3a4
/******************************************************************************
AudioScience HPI driver
Copyright (C) 1997-201
1
AudioScience Inc. <support@audioscience.com>
Copyright (C) 1997-201
2
AudioScience Inc. <support@audioscience.com>
This program is free software; you can redistribute it and/or modify
it under the terms of version 2 of the GNU General Public License as
...
...
@@ -42,7 +42,7 @@ On error *pLockedMemHandle marked invalid, non-zero returned.
If this function succeeds, then HpiOs_LockedMem_GetVirtAddr() and
HpiOs_LockedMem_GetPyhsAddr() will always succed on the returned handle.
*/
int
hpios_locked_mem_alloc
(
struct
consistent_dma_area
*
p_locked_mem_handle
,
u16
hpios_locked_mem_alloc
(
struct
consistent_dma_area
*
p_locked_mem_handle
,
/**< memory handle */
u32
size
,
/**< Size in bytes to allocate */
struct
pci_dev
*
p_os_reference
...
...
sound/pci/asihpi/hpios.c
浏览文件 @
5ff5c3a4
/******************************************************************************
AudioScience HPI driver
Copyright (C) 1997-201
1
AudioScience Inc. <support@audioscience.com>
Copyright (C) 1997-201
2
AudioScience Inc. <support@audioscience.com>
This program is free software; you can redistribute it and/or modify
it under the terms of version 2 of the GNU General Public License as
...
...
@@ -39,11 +39,11 @@ void hpios_delay_micro_seconds(u32 num_micro_sec)
}
/** Allocate
d
an area of locked memory for bus master DMA operations.
/** Allocate an area of locked memory for bus master DMA operations.
On error, return -ENOMEM
, and *pMemArea.size = 0
If allocation fails, return 1
, and *pMemArea.size = 0
*/
int
hpios_locked_mem_alloc
(
struct
consistent_dma_area
*
p_mem_area
,
u32
size
,
u16
hpios_locked_mem_alloc
(
struct
consistent_dma_area
*
p_mem_area
,
u32
size
,
struct
pci_dev
*
pdev
)
{
/*?? any benefit in using managed dmam_alloc_coherent? */
...
...
@@ -62,7 +62,7 @@ int hpios_locked_mem_alloc(struct consistent_dma_area *p_mem_area, u32 size,
HPI_DEBUG_LOG
(
WARNING
,
"failed to allocate %d bytes locked memory
\n
"
,
size
);
p_mem_area
->
size
=
0
;
return
-
ENOMEM
;
return
1
;
}
}
...
...
sound/pci/hda/hda_codec.h
浏览文件 @
5ff5c3a4
...
...
@@ -851,6 +851,9 @@ struct hda_codec {
unsigned
int
pin_amp_workaround
:
1
;
/* pin out-amp takes index
* (e.g. Conexant codecs)
*/
unsigned
int
single_adc_amp
:
1
;
/* adc in-amp takes no index
* (e.g. CX20549 codec)
*/
unsigned
int
no_sticky_stream
:
1
;
/* no sticky-PCM stream assignment */
unsigned
int
pins_shutup
:
1
;
/* pins are shut up */
unsigned
int
no_trigger_sense
:
1
;
/* don't trigger at pin-sensing */
...
...
sound/pci/hda/hda_proc.c
浏览文件 @
5ff5c3a4
...
...
@@ -651,9 +651,16 @@ static void print_codec_info(struct snd_info_entry *entry,
snd_iprintf
(
buffer
,
" Amp-In caps: "
);
print_amp_caps
(
buffer
,
codec
,
nid
,
HDA_INPUT
);
snd_iprintf
(
buffer
,
" Amp-In vals: "
);
print_amp_vals
(
buffer
,
codec
,
nid
,
HDA_INPUT
,
wid_caps
&
AC_WCAP_STEREO
,
wid_type
==
AC_WID_PIN
?
1
:
conn_len
);
if
(
wid_type
==
AC_WID_PIN
||
(
codec
->
single_adc_amp
&&
wid_type
==
AC_WID_AUD_IN
))
print_amp_vals
(
buffer
,
codec
,
nid
,
HDA_INPUT
,
wid_caps
&
AC_WCAP_STEREO
,
1
);
else
print_amp_vals
(
buffer
,
codec
,
nid
,
HDA_INPUT
,
wid_caps
&
AC_WCAP_STEREO
,
conn_len
);
}
if
(
wid_caps
&
AC_WCAP_OUT_AMP
)
{
snd_iprintf
(
buffer
,
" Amp-Out caps: "
);
...
...
sound/pci/hda/patch_conexant.c
浏览文件 @
5ff5c3a4
...
...
@@ -141,7 +141,6 @@ struct conexant_spec {
unsigned
int
hp_laptop
:
1
;
unsigned
int
asus
:
1
;
unsigned
int
pin_eapd_ctrls
:
1
;
unsigned
int
single_adc_amp
:
1
;
unsigned
int
fixup_stereo_dmic
:
1
;
unsigned
int
adc_switching
:
1
;
...
...
@@ -688,27 +687,26 @@ static const struct hda_channel_mode cxt5045_modes[1] = {
static
const
struct
hda_input_mux
cxt5045_capture_source
=
{
.
num_items
=
2
,
.
items
=
{
{
"IntMic"
,
0x1
},
{
"
ExtMic"
,
0x2
},
{
"Int
ernal
Mic"
,
0x1
},
{
"
Mic"
,
0x2
},
}
};
static
const
struct
hda_input_mux
cxt5045_capture_source_benq
=
{
.
num_items
=
5
,
.
num_items
=
4
,
.
items
=
{
{
"IntMic"
,
0x1
},
{
"ExtMic"
,
0x2
},
{
"LineIn"
,
0x3
},
{
"CD"
,
0x4
},
{
"Mixer"
,
0x0
},
{
"Internal Mic"
,
0x1
},
{
"Mic"
,
0x2
},
{
"Line"
,
0x3
},
{
"Mixer"
,
0x0
},
}
};
static
const
struct
hda_input_mux
cxt5045_capture_source_hp530
=
{
.
num_items
=
2
,
.
items
=
{
{
"
ExtMic"
,
0x1
},
{
"IntMic"
,
0x2
},
{
"
Mic"
,
0x1
},
{
"Int
ernal
Mic"
,
0x2
},
}
};
...
...
@@ -799,10 +797,8 @@ static void cxt5045_hp_unsol_event(struct hda_codec *codec,
}
static
const
struct
snd_kcontrol_new
cxt5045_mixers
[]
=
{
HDA_CODEC_VOLUME
(
"Internal Mic Capture Volume"
,
0x1a
,
0x01
,
HDA_INPUT
),
HDA_CODEC_MUTE
(
"Internal Mic Capture Switch"
,
0x1a
,
0x01
,
HDA_INPUT
),
HDA_CODEC_VOLUME
(
"Mic Capture Volume"
,
0x1a
,
0x02
,
HDA_INPUT
),
HDA_CODEC_MUTE
(
"Mic Capture Switch"
,
0x1a
,
0x02
,
HDA_INPUT
),
HDA_CODEC_VOLUME
(
"Capture Volume"
,
0x1a
,
0x00
,
HDA_INPUT
),
HDA_CODEC_MUTE
(
"Capture Switch"
,
0x1a
,
0x0
,
HDA_INPUT
),
HDA_CODEC_VOLUME
(
"PCM Playback Volume"
,
0x17
,
0x0
,
HDA_INPUT
),
HDA_CODEC_MUTE
(
"PCM Playback Switch"
,
0x17
,
0x0
,
HDA_INPUT
),
HDA_CODEC_VOLUME
(
"Internal Mic Playback Volume"
,
0x17
,
0x1
,
HDA_INPUT
),
...
...
@@ -823,27 +819,15 @@ static const struct snd_kcontrol_new cxt5045_mixers[] = {
};
static
const
struct
snd_kcontrol_new
cxt5045_benq_mixers
[]
=
{
HDA_CODEC_VOLUME
(
"CD Capture Volume"
,
0x1a
,
0x04
,
HDA_INPUT
),
HDA_CODEC_MUTE
(
"CD Capture Switch"
,
0x1a
,
0x04
,
HDA_INPUT
),
HDA_CODEC_VOLUME
(
"CD Playback Volume"
,
0x17
,
0x4
,
HDA_INPUT
),
HDA_CODEC_MUTE
(
"CD Playback Switch"
,
0x17
,
0x4
,
HDA_INPUT
),
HDA_CODEC_VOLUME
(
"Line In Capture Volume"
,
0x1a
,
0x03
,
HDA_INPUT
),
HDA_CODEC_MUTE
(
"Line In Capture Switch"
,
0x1a
,
0x03
,
HDA_INPUT
),
HDA_CODEC_VOLUME
(
"Line In Playback Volume"
,
0x17
,
0x3
,
HDA_INPUT
),
HDA_CODEC_MUTE
(
"Line In Playback Switch"
,
0x17
,
0x3
,
HDA_INPUT
),
HDA_CODEC_VOLUME
(
"Mixer Capture Volume"
,
0x1a
,
0x0
,
HDA_INPUT
),
HDA_CODEC_MUTE
(
"Mixer Capture Switch"
,
0x1a
,
0x0
,
HDA_INPUT
),
HDA_CODEC_VOLUME
(
"Line Playback Volume"
,
0x17
,
0x3
,
HDA_INPUT
),
HDA_CODEC_MUTE
(
"Line Playback Switch"
,
0x17
,
0x3
,
HDA_INPUT
),
{}
};
static
const
struct
snd_kcontrol_new
cxt5045_mixers_hp530
[]
=
{
HDA_CODEC_VOLUME
(
"Internal Mic Capture Volume"
,
0x1a
,
0x02
,
HDA_INPUT
),
HDA_CODEC_MUTE
(
"Internal Mic Capture Switch"
,
0x1a
,
0x02
,
HDA_INPUT
),
HDA_CODEC_VOLUME
(
"Mic Capture Volume"
,
0x1a
,
0x01
,
HDA_INPUT
),
HDA_CODEC_MUTE
(
"Mic Capture Switch"
,
0x1a
,
0x01
,
HDA_INPUT
),
HDA_CODEC_VOLUME
(
"Capture Volume"
,
0x1a
,
0x00
,
HDA_INPUT
),
HDA_CODEC_MUTE
(
"Capture Switch"
,
0x1a
,
0x0
,
HDA_INPUT
),
HDA_CODEC_VOLUME
(
"PCM Playback Volume"
,
0x17
,
0x0
,
HDA_INPUT
),
HDA_CODEC_MUTE
(
"PCM Playback Switch"
,
0x17
,
0x0
,
HDA_INPUT
),
HDA_CODEC_VOLUME
(
"Internal Mic Playback Volume"
,
0x17
,
0x2
,
HDA_INPUT
),
...
...
@@ -947,10 +931,10 @@ static const struct snd_kcontrol_new cxt5045_test_mixer[] = {
/* Output controls */
HDA_CODEC_VOLUME
(
"Speaker Playback Volume"
,
0x10
,
0x0
,
HDA_OUTPUT
),
HDA_CODEC_MUTE
(
"Speaker Playback Switch"
,
0x10
,
0x0
,
HDA_OUTPUT
),
HDA_CODEC_VOLUME
(
"
Node 11
Playback Volume"
,
0x11
,
0x0
,
HDA_OUTPUT
),
HDA_CODEC_MUTE
(
"
Node 11
Playback Switch"
,
0x11
,
0x0
,
HDA_OUTPUT
),
HDA_CODEC_VOLUME
(
"
Node 12
Playback Volume"
,
0x12
,
0x0
,
HDA_OUTPUT
),
HDA_CODEC_MUTE
(
"
Node 12
Playback Switch"
,
0x12
,
0x0
,
HDA_OUTPUT
),
HDA_CODEC_VOLUME
(
"
HP-OUT
Playback Volume"
,
0x11
,
0x0
,
HDA_OUTPUT
),
HDA_CODEC_MUTE
(
"
HP-OUT
Playback Switch"
,
0x11
,
0x0
,
HDA_OUTPUT
),
HDA_CODEC_VOLUME
(
"
LINE1
Playback Volume"
,
0x12
,
0x0
,
HDA_OUTPUT
),
HDA_CODEC_MUTE
(
"
LINE1
Playback Switch"
,
0x12
,
0x0
,
HDA_OUTPUT
),
/* Modes for retasking pin widgets */
CXT_PIN_MODE
(
"HP-OUT pin mode"
,
0x11
,
CXT_PIN_DIR_INOUT
),
...
...
@@ -961,16 +945,16 @@ static const struct snd_kcontrol_new cxt5045_test_mixer[] = {
/* Loopback mixer controls */
HDA_CODEC_VOLUME
(
"
Mixer-1
Volume"
,
0x17
,
0x0
,
HDA_INPUT
),
HDA_CODEC_MUTE
(
"
Mixer-1
Switch"
,
0x17
,
0x0
,
HDA_INPUT
),
HDA_CODEC_VOLUME
(
"M
ixer-2
Volume"
,
0x17
,
0x1
,
HDA_INPUT
),
HDA_CODEC_MUTE
(
"M
ixer-2
Switch"
,
0x17
,
0x1
,
HDA_INPUT
),
HDA_CODEC_VOLUME
(
"
Mixer-3
Volume"
,
0x17
,
0x2
,
HDA_INPUT
),
HDA_CODEC_MUTE
(
"
Mixer-3
Switch"
,
0x17
,
0x2
,
HDA_INPUT
),
HDA_CODEC_VOLUME
(
"
Mixer-4
Volume"
,
0x17
,
0x3
,
HDA_INPUT
),
HDA_CODEC_MUTE
(
"
Mixer-4
Switch"
,
0x17
,
0x3
,
HDA_INPUT
),
HDA_CODEC_VOLUME
(
"
Mixer-5
Volume"
,
0x17
,
0x4
,
HDA_INPUT
),
HDA_CODEC_MUTE
(
"
Mixer-5
Switch"
,
0x17
,
0x4
,
HDA_INPUT
),
HDA_CODEC_VOLUME
(
"
PCM
Volume"
,
0x17
,
0x0
,
HDA_INPUT
),
HDA_CODEC_MUTE
(
"
PCM
Switch"
,
0x17
,
0x0
,
HDA_INPUT
),
HDA_CODEC_VOLUME
(
"M
IC1 pin
Volume"
,
0x17
,
0x1
,
HDA_INPUT
),
HDA_CODEC_MUTE
(
"M
IC1 pin
Switch"
,
0x17
,
0x1
,
HDA_INPUT
),
HDA_CODEC_VOLUME
(
"
LINE1 pin
Volume"
,
0x17
,
0x2
,
HDA_INPUT
),
HDA_CODEC_MUTE
(
"
LINE1 pin
Switch"
,
0x17
,
0x2
,
HDA_INPUT
),
HDA_CODEC_VOLUME
(
"
HP-OUT pin
Volume"
,
0x17
,
0x3
,
HDA_INPUT
),
HDA_CODEC_MUTE
(
"
HP-OUT pin
Switch"
,
0x17
,
0x3
,
HDA_INPUT
),
HDA_CODEC_VOLUME
(
"
CD pin
Volume"
,
0x17
,
0x4
,
HDA_INPUT
),
HDA_CODEC_MUTE
(
"
CD pin
Switch"
,
0x17
,
0x4
,
HDA_INPUT
),
{
.
iface
=
SNDRV_CTL_ELEM_IFACE_MIXER
,
.
name
=
"Input Source"
,
...
...
@@ -979,16 +963,8 @@ static const struct snd_kcontrol_new cxt5045_test_mixer[] = {
.
put
=
conexant_mux_enum_put
,
},
/* Audio input controls */
HDA_CODEC_VOLUME
(
"Input-1 Volume"
,
0x1a
,
0x0
,
HDA_INPUT
),
HDA_CODEC_MUTE
(
"Input-1 Switch"
,
0x1a
,
0x0
,
HDA_INPUT
),
HDA_CODEC_VOLUME
(
"Input-2 Volume"
,
0x1a
,
0x1
,
HDA_INPUT
),
HDA_CODEC_MUTE
(
"Input-2 Switch"
,
0x1a
,
0x1
,
HDA_INPUT
),
HDA_CODEC_VOLUME
(
"Input-3 Volume"
,
0x1a
,
0x2
,
HDA_INPUT
),
HDA_CODEC_MUTE
(
"Input-3 Switch"
,
0x1a
,
0x2
,
HDA_INPUT
),
HDA_CODEC_VOLUME
(
"Input-4 Volume"
,
0x1a
,
0x3
,
HDA_INPUT
),
HDA_CODEC_MUTE
(
"Input-4 Switch"
,
0x1a
,
0x3
,
HDA_INPUT
),
HDA_CODEC_VOLUME
(
"Input-5 Volume"
,
0x1a
,
0x4
,
HDA_INPUT
),
HDA_CODEC_MUTE
(
"Input-5 Switch"
,
0x1a
,
0x4
,
HDA_INPUT
),
HDA_CODEC_VOLUME
(
"Capture Volume"
,
0x1a
,
0x0
,
HDA_INPUT
),
HDA_CODEC_MUTE
(
"Capture Switch"
,
0x1a
,
0x0
,
HDA_INPUT
),
{
}
/* end */
};
...
...
@@ -1010,10 +986,6 @@ static const struct hda_verb cxt5045_test_init_verbs[] = {
{
0x13
,
AC_VERB_SET_PIN_WIDGET_CONTROL
,
PIN_OUT
},
{
0x18
,
AC_VERB_SET_DIGI_CONVERT_1
,
0
},
/* Start with output sum widgets muted and their output gains at min */
{
0x17
,
AC_VERB_SET_AMP_GAIN_MUTE
,
AMP_IN_MUTE
(
0
)},
{
0x17
,
AC_VERB_SET_AMP_GAIN_MUTE
,
AMP_IN_MUTE
(
1
)},
/* Unmute retasking pin widget output buffers since the default
* state appears to be output. As the pin mode is changed by the
* user the pin mode control will take care of enabling the pin's
...
...
@@ -1028,11 +1000,11 @@ static const struct hda_verb cxt5045_test_init_verbs[] = {
/* Set ADC connection select to match default mixer setting (mic1
* pin)
*/
{
0x1a
,
AC_VERB_SET_CONNECT_SEL
,
0x0
0
},
{
0x17
,
AC_VERB_SET_CONNECT_SEL
,
0x0
0
},
{
0x1a
,
AC_VERB_SET_CONNECT_SEL
,
0x0
1
},
{
0x17
,
AC_VERB_SET_CONNECT_SEL
,
0x0
1
},
/* Mute all inputs to mixer widget (even unconnected ones) */
{
0x17
,
AC_VERB_SET_AMP_GAIN_MUTE
,
AMP_IN_MUTE
(
0
)},
/* Mixer
pin
*/
{
0x17
,
AC_VERB_SET_AMP_GAIN_MUTE
,
AMP_IN_MUTE
(
0
)},
/* Mixer */
{
0x17
,
AC_VERB_SET_AMP_GAIN_MUTE
,
AMP_IN_MUTE
(
1
)},
/* Mic1 pin */
{
0x17
,
AC_VERB_SET_AMP_GAIN_MUTE
,
AMP_IN_MUTE
(
2
)},
/* Line pin */
{
0x17
,
AC_VERB_SET_AMP_GAIN_MUTE
,
AMP_IN_MUTE
(
3
)},
/* HP pin */
...
...
@@ -1111,7 +1083,7 @@ static int patch_cxt5045(struct hda_codec *codec)
if
(
!
spec
)
return
-
ENOMEM
;
codec
->
spec
=
spec
;
codec
->
pin_amp_workaround
=
1
;
codec
->
single_adc_amp
=
1
;
spec
->
multiout
.
max_channels
=
2
;
spec
->
multiout
.
num_dacs
=
ARRAY_SIZE
(
cxt5045_dac_nids
);
...
...
@@ -4252,7 +4224,7 @@ static int cx_auto_add_capture_volume(struct hda_codec *codec, hda_nid_t nid,
int
idx
=
get_input_connection
(
codec
,
adc_nid
,
nid
);
if
(
idx
<
0
)
continue
;
if
(
sp
ec
->
single_adc_amp
)
if
(
cod
ec
->
single_adc_amp
)
idx
=
0
;
if
(
cx_auto_get_rightch_label
(
codec
,
label
,
rightch_label
,
nid
))
{
...
...
@@ -4327,7 +4299,7 @@ static int cx_auto_build_input_controls(struct hda_codec *codec)
if
(
cidx
<
0
)
continue
;
input_conn
[
i
]
=
spec
->
imux_info
[
i
].
adc
;
if
(
!
sp
ec
->
single_adc_amp
)
if
(
!
cod
ec
->
single_adc_amp
)
input_conn
[
i
]
|=
cidx
<<
8
;
if
(
i
>
0
&&
input_conn
[
i
]
!=
input_conn
[
0
])
multi_connection
=
1
;
...
...
@@ -4528,15 +4500,17 @@ static int patch_conexant_auto(struct hda_codec *codec)
if
(
!
spec
)
return
-
ENOMEM
;
codec
->
spec
=
spec
;
codec
->
pin_amp_workaround
=
1
;
switch
(
codec
->
vendor_id
)
{
case
0x14f15045
:
sp
ec
->
single_adc_amp
=
1
;
cod
ec
->
single_adc_amp
=
1
;
break
;
case
0x14f15051
:
add_cx5051_fake_mutes
(
codec
);
codec
->
pin_amp_workaround
=
1
;
break
;
default:
codec
->
pin_amp_workaround
=
1
;
}
apply_fixup
(
codec
,
cxt_fixups
,
cxt_pincfg_tbl
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录