Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
mellanox
Bluefield Linux
提交
18c5ef38
B
Bluefield Linux
项目概览
mellanox
/
Bluefield Linux
12 个月 前同步成功
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
B
Bluefield Linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
18c5ef38
编写于
8月 15, 2010
作者:
T
Takashi Iwai
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'fix/hda' into for-linus
上级
38d7b08f
f0cea797
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
120 addition
and
15 deletion
+120
-15
sound/pci/hda/hda_codec.c
sound/pci/hda/hda_codec.c
+18
-8
sound/pci/hda/hda_codec.h
sound/pci/hda/hda_codec.h
+4
-1
sound/pci/hda/hda_eld.c
sound/pci/hda/hda_eld.c
+49
-0
sound/pci/hda/hda_local.h
sound/pci/hda/hda_local.h
+2
-0
sound/pci/hda/patch_cirrus.c
sound/pci/hda/patch_cirrus.c
+1
-1
sound/pci/hda/patch_conexant.c
sound/pci/hda/patch_conexant.c
+1
-1
sound/pci/hda/patch_hdmi.c
sound/pci/hda/patch_hdmi.c
+42
-0
sound/pci/hda/patch_intelhdmi.c
sound/pci/hda/patch_intelhdmi.c
+1
-0
sound/pci/hda/patch_nvhdmi.c
sound/pci/hda/patch_nvhdmi.c
+1
-3
sound/pci/hda/patch_realtek.c
sound/pci/hda/patch_realtek.c
+1
-1
未找到文件。
sound/pci/hda/hda_codec.c
浏览文件 @
18c5ef38
...
...
@@ -1261,12 +1261,17 @@ void snd_hda_codec_setup_stream(struct hda_codec *codec, hda_nid_t nid,
}
EXPORT_SYMBOL_HDA
(
snd_hda_codec_setup_stream
);
static
void
really_cleanup_stream
(
struct
hda_codec
*
codec
,
struct
hda_cvt_setup
*
q
);
/**
* snd_hda_codec_cleanup_stream - clean up the codec for closing
*
__
snd_hda_codec_cleanup_stream - clean up the codec for closing
* @codec: the CODEC to clean up
* @nid: the NID to clean up
* @do_now: really clean up the stream instead of clearing the active flag
*/
void
snd_hda_codec_cleanup_stream
(
struct
hda_codec
*
codec
,
hda_nid_t
nid
)
void
__snd_hda_codec_cleanup_stream
(
struct
hda_codec
*
codec
,
hda_nid_t
nid
,
int
do_now
)
{
struct
hda_cvt_setup
*
p
;
...
...
@@ -1274,14 +1279,19 @@ void snd_hda_codec_cleanup_stream(struct hda_codec *codec, hda_nid_t nid)
return
;
snd_printdd
(
"hda_codec_cleanup_stream: NID=0x%x
\n
"
,
nid
);
/* here we just clear the active flag; actual clean-ups will be done
* in purify_inactive_streams()
*/
p
=
get_hda_cvt_setup
(
codec
,
nid
);
if
(
p
)
p
->
active
=
0
;
if
(
p
)
{
/* here we just clear the active flag when do_now isn't set;
* actual clean-ups will be done later in
* purify_inactive_streams() called from snd_hda_codec_prpapre()
*/
if
(
do_now
)
really_cleanup_stream
(
codec
,
p
);
else
p
->
active
=
0
;
}
}
EXPORT_SYMBOL_HDA
(
snd_hda_codec_cleanup_stream
);
EXPORT_SYMBOL_HDA
(
__
snd_hda_codec_cleanup_stream
);
static
void
really_cleanup_stream
(
struct
hda_codec
*
codec
,
struct
hda_cvt_setup
*
q
)
...
...
sound/pci/hda/hda_codec.h
浏览文件 @
18c5ef38
...
...
@@ -963,7 +963,10 @@ void snd_hda_codec_cleanup(struct hda_codec *codec,
void
snd_hda_codec_setup_stream
(
struct
hda_codec
*
codec
,
hda_nid_t
nid
,
u32
stream_tag
,
int
channel_id
,
int
format
);
void
snd_hda_codec_cleanup_stream
(
struct
hda_codec
*
codec
,
hda_nid_t
nid
);
void
__snd_hda_codec_cleanup_stream
(
struct
hda_codec
*
codec
,
hda_nid_t
nid
,
int
do_now
);
#define snd_hda_codec_cleanup_stream(codec, nid) \
__snd_hda_codec_cleanup_stream(codec, nid, 0)
unsigned
int
snd_hda_calc_stream_format
(
unsigned
int
rate
,
unsigned
int
channels
,
unsigned
int
format
,
...
...
sound/pci/hda/hda_eld.c
浏览文件 @
18c5ef38
...
...
@@ -596,4 +596,53 @@ void snd_hda_eld_proc_free(struct hda_codec *codec, struct hdmi_eld *eld)
}
EXPORT_SYMBOL_HDA
(
snd_hda_eld_proc_free
);
/* update PCM info based on ELD */
void
hdmi_eld_update_pcm_info
(
struct
hdmi_eld
*
eld
,
struct
hda_pcm_stream
*
pcm
,
struct
hda_pcm_stream
*
codec_pars
)
{
int
i
;
pcm
->
rates
=
0
;
pcm
->
formats
=
0
;
pcm
->
maxbps
=
0
;
pcm
->
channels_min
=
-
1
;
pcm
->
channels_max
=
0
;
for
(
i
=
0
;
i
<
eld
->
sad_count
;
i
++
)
{
struct
cea_sad
*
a
=
&
eld
->
sad
[
i
];
pcm
->
rates
|=
a
->
rates
;
if
(
a
->
channels
<
pcm
->
channels_min
)
pcm
->
channels_min
=
a
->
channels
;
if
(
a
->
channels
>
pcm
->
channels_max
)
pcm
->
channels_max
=
a
->
channels
;
if
(
a
->
format
==
AUDIO_CODING_TYPE_LPCM
)
{
if
(
a
->
sample_bits
&
AC_SUPPCM_BITS_16
)
{
pcm
->
formats
|=
SNDRV_PCM_FMTBIT_S16_LE
;
if
(
pcm
->
maxbps
<
16
)
pcm
->
maxbps
=
16
;
}
if
(
a
->
sample_bits
&
AC_SUPPCM_BITS_20
)
{
pcm
->
formats
|=
SNDRV_PCM_FMTBIT_S32_LE
;
if
(
pcm
->
maxbps
<
20
)
pcm
->
maxbps
=
20
;
}
if
(
a
->
sample_bits
&
AC_SUPPCM_BITS_24
)
{
pcm
->
formats
|=
SNDRV_PCM_FMTBIT_S32_LE
;
if
(
pcm
->
maxbps
<
24
)
pcm
->
maxbps
=
24
;
}
}
}
if
(
!
codec_pars
)
return
;
/* restrict the parameters by the values the codec provides */
pcm
->
rates
&=
codec_pars
->
rates
;
pcm
->
formats
&=
codec_pars
->
formats
;
pcm
->
channels_min
=
max
(
pcm
->
channels_min
,
codec_pars
->
channels_min
);
pcm
->
channels_max
=
min
(
pcm
->
channels_max
,
codec_pars
->
channels_max
);
pcm
->
maxbps
=
min
(
pcm
->
maxbps
,
codec_pars
->
maxbps
);
}
EXPORT_SYMBOL_HDA
(
hdmi_eld_update_pcm_info
);
#endif
/* CONFIG_PROC_FS */
sound/pci/hda/hda_local.h
浏览文件 @
18c5ef38
...
...
@@ -604,6 +604,8 @@ struct hdmi_eld {
int
snd_hdmi_get_eld_size
(
struct
hda_codec
*
codec
,
hda_nid_t
nid
);
int
snd_hdmi_get_eld
(
struct
hdmi_eld
*
,
struct
hda_codec
*
,
hda_nid_t
);
void
snd_hdmi_show_eld
(
struct
hdmi_eld
*
eld
);
void
hdmi_eld_update_pcm_info
(
struct
hdmi_eld
*
eld
,
struct
hda_pcm_stream
*
pcm
,
struct
hda_pcm_stream
*
codec_pars
);
#ifdef CONFIG_PROC_FS
int
snd_hda_eld_proc_new
(
struct
hda_codec
*
codec
,
struct
hdmi_eld
*
eld
,
...
...
sound/pci/hda/patch_cirrus.c
浏览文件 @
18c5ef38
...
...
@@ -656,7 +656,7 @@ static int change_cur_input(struct hda_codec *codec, unsigned int idx,
return
0
;
if
(
spec
->
cur_adc
&&
spec
->
cur_adc
!=
spec
->
adc_nid
[
idx
])
{
/* stream is running, let's swap the current ADC */
snd_hda_codec_cleanup_stream
(
codec
,
spec
->
cur_adc
);
__snd_hda_codec_cleanup_stream
(
codec
,
spec
->
cur_adc
,
1
);
spec
->
cur_adc
=
spec
->
adc_nid
[
idx
];
snd_hda_codec_setup_stream
(
codec
,
spec
->
cur_adc
,
spec
->
cur_adc_stream_tag
,
0
,
...
...
sound/pci/hda/patch_conexant.c
浏览文件 @
18c5ef38
...
...
@@ -1733,7 +1733,7 @@ static void cxt5051_portc_automic(struct hda_codec *codec)
new_adc
=
spec
->
adc_nids
[
spec
->
cur_adc_idx
];
if
(
spec
->
cur_adc
&&
spec
->
cur_adc
!=
new_adc
)
{
/* stream is running, let's swap the current ADC */
snd_hda_codec_cleanup_stream
(
codec
,
spec
->
cur_adc
);
__snd_hda_codec_cleanup_stream
(
codec
,
spec
->
cur_adc
,
1
);
spec
->
cur_adc
=
new_adc
;
snd_hda_codec_setup_stream
(
codec
,
new_adc
,
spec
->
cur_adc_stream_tag
,
0
,
...
...
sound/pci/hda/patch_hdmi.c
浏览文件 @
18c5ef38
...
...
@@ -46,6 +46,7 @@ struct hdmi_spec {
* export one pcm per pipe
*/
struct
hda_pcm
pcm_rec
[
MAX_HDMI_CVTS
];
struct
hda_pcm_stream
codec_pcm_pars
[
MAX_HDMI_CVTS
];
/*
* nvhdmi specific
...
...
@@ -765,6 +766,47 @@ static int hdmi_setup_stream(struct hda_codec *codec, hda_nid_t nid,
return
0
;
}
/*
* HDA PCM callbacks
*/
static
int
hdmi_pcm_open
(
struct
hda_pcm_stream
*
hinfo
,
struct
hda_codec
*
codec
,
struct
snd_pcm_substream
*
substream
)
{
struct
hdmi_spec
*
spec
=
codec
->
spec
;
struct
hdmi_eld
*
eld
;
struct
hda_pcm_stream
*
codec_pars
;
unsigned
int
idx
;
for
(
idx
=
0
;
idx
<
spec
->
num_cvts
;
idx
++
)
if
(
hinfo
->
nid
==
spec
->
cvt
[
idx
])
break
;
if
(
snd_BUG_ON
(
idx
>=
spec
->
num_cvts
)
||
snd_BUG_ON
(
idx
>=
spec
->
num_pins
))
return
-
EINVAL
;
/* save the PCM info the codec provides */
codec_pars
=
&
spec
->
codec_pcm_pars
[
idx
];
if
(
!
codec_pars
->
rates
)
*
codec_pars
=
*
hinfo
;
eld
=
&
spec
->
sink_eld
[
idx
];
if
(
eld
->
sad_count
>
0
)
{
hdmi_eld_update_pcm_info
(
eld
,
hinfo
,
codec_pars
);
if
(
hinfo
->
channels_min
>
hinfo
->
channels_max
||
!
hinfo
->
rates
||
!
hinfo
->
formats
)
return
-
ENODEV
;
}
else
{
/* fallback to the codec default */
hinfo
->
channels_min
=
codec_pars
->
channels_min
;
hinfo
->
channels_max
=
codec_pars
->
channels_max
;
hinfo
->
rates
=
codec_pars
->
rates
;
hinfo
->
formats
=
codec_pars
->
formats
;
hinfo
->
maxbps
=
codec_pars
->
maxbps
;
}
return
0
;
}
/*
* HDA/HDMI auto parsing
*/
...
...
sound/pci/hda/patch_intelhdmi.c
浏览文件 @
18c5ef38
...
...
@@ -80,6 +80,7 @@ static struct hda_pcm_stream intel_hdmi_pcm_playback = {
.
substreams
=
1
,
.
channels_min
=
2
,
.
ops
=
{
.
open
=
hdmi_pcm_open
,
.
prepare
=
intel_hdmi_playback_pcm_prepare
,
.
cleanup
=
intel_hdmi_playback_pcm_cleanup
,
},
...
...
sound/pci/hda/patch_nvhdmi.c
浏览文件 @
18c5ef38
...
...
@@ -347,10 +347,8 @@ static int nvhdmi_dig_playback_pcm_prepare_2ch(struct hda_pcm_stream *hinfo,
static
struct
hda_pcm_stream
nvhdmi_pcm_digital_playback_8ch_89
=
{
.
substreams
=
1
,
.
channels_min
=
2
,
.
rates
=
SUPPORTED_RATES
,
.
maxbps
=
SUPPORTED_MAXBPS
,
.
formats
=
SUPPORTED_FORMATS
,
.
ops
=
{
.
open
=
hdmi_pcm_open
,
.
prepare
=
nvhdmi_dig_playback_pcm_prepare_8ch_89
,
.
cleanup
=
nvhdmi_playback_pcm_cleanup
,
},
...
...
sound/pci/hda/patch_realtek.c
浏览文件 @
18c5ef38
...
...
@@ -1037,7 +1037,7 @@ static void alc_dual_mic_adc_auto_switch(struct hda_codec *codec)
new_adc = spec->adc_nids[spec->cur_adc_idx];
if (spec->cur_adc && spec->cur_adc != new_adc) {
/* stream is running, let's swap the current ADC */
snd_hda_codec_cleanup_stream(codec, spec->cur_adc
);
__snd_hda_codec_cleanup_stream(codec, spec->cur_adc, 1
);
spec->cur_adc = new_adc;
snd_hda_codec_setup_stream(codec, new_adc,
spec->cur_adc_stream_tag, 0,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录