Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
614acf93
K
Kernel
项目概览
openeuler
/
Kernel
大约 1 年 前同步成功
通知
6
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,发现更多精彩内容 >>
提交
614acf93
编写于
12月 30, 2014
作者:
T
Takashi Iwai
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'topic/msbits' into for-next
上级
6a8484b6
0e2a3751
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
17 addition
and
22 deletion
+17
-22
sound/core/pcm_lib.c
sound/core/pcm_lib.c
+13
-2
sound/soc/soc-pcm.c
sound/soc/soc-pcm.c
+4
-20
未找到文件。
sound/core/pcm_lib.c
浏览文件 @
614acf93
...
...
@@ -1299,8 +1299,14 @@ static int snd_pcm_hw_rule_msbits(struct snd_pcm_hw_params *params,
int
width
=
l
&
0xffff
;
unsigned
int
msbits
=
l
>>
16
;
struct
snd_interval
*
i
=
hw_param_interval
(
params
,
SNDRV_PCM_HW_PARAM_SAMPLE_BITS
);
if
(
snd_interval_single
(
i
)
&&
snd_interval_value
(
i
)
==
width
)
params
->
msbits
=
msbits
;
if
(
!
snd_interval_single
(
i
))
return
0
;
if
((
snd_interval_value
(
i
)
==
width
)
||
(
width
==
0
&&
snd_interval_value
(
i
)
>
msbits
))
params
->
msbits
=
min_not_zero
(
params
->
msbits
,
msbits
);
return
0
;
}
...
...
@@ -1311,6 +1317,11 @@ static int snd_pcm_hw_rule_msbits(struct snd_pcm_hw_params *params,
* @width: sample bits width
* @msbits: msbits width
*
* This constraint will set the number of most significant bits (msbits) if a
* sample format with the specified width has been select. If width is set to 0
* the msbits will be set for any sample format with a width larger than the
* specified msbits.
*
* Return: Zero if successful, or a negative error code on failure.
*/
int
snd_pcm_hw_constraint_msbits
(
struct
snd_pcm_runtime
*
runtime
,
...
...
sound/soc/soc-pcm.c
浏览文件 @
614acf93
...
...
@@ -301,15 +301,6 @@ static bool soc_pcm_has_symmetry(struct snd_pcm_substream *substream)
return
symmetry
;
}
/*
* List of sample sizes that might go over the bus for parameter
* application. There ought to be a wildcard sample size for things
* like the DAC/ADC resolution to use but there isn't right now.
*/
static
int
sample_sizes
[]
=
{
24
,
32
,
};
static
void
soc_pcm_set_msb
(
struct
snd_pcm_substream
*
substream
,
int
bits
)
{
struct
snd_soc_pcm_runtime
*
rtd
=
substream
->
private_data
;
...
...
@@ -318,17 +309,10 @@ static void soc_pcm_set_msb(struct snd_pcm_substream *substream, int bits)
if
(
!
bits
)
return
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
sample_sizes
);
i
++
)
{
if
(
bits
>=
sample_sizes
[
i
])
continue
;
ret
=
snd_pcm_hw_constraint_msbits
(
substream
->
runtime
,
0
,
sample_sizes
[
i
],
bits
);
if
(
ret
!=
0
)
dev_warn
(
rtd
->
dev
,
"ASoC: Failed to set MSB %d/%d: %d
\n
"
,
bits
,
sample_sizes
[
i
],
ret
);
}
ret
=
snd_pcm_hw_constraint_msbits
(
substream
->
runtime
,
0
,
0
,
bits
);
if
(
ret
!=
0
)
dev_warn
(
rtd
->
dev
,
"ASoC: Failed to set MSB %d: %d
\n
"
,
bits
,
ret
);
}
static
void
soc_pcm_apply_msb
(
struct
snd_pcm_substream
*
substream
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录