Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
89595f5e
cloud-kernel
项目概览
openanolis
/
cloud-kernel
接近 2 年 前同步成功
通知
170
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
89595f5e
编写于
3月 13, 2016
作者:
M
Mark Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'asoc/topic/core-pcm' into asoc-next
上级
977011ea
3bdff244
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
32 addition
and
0 deletion
+32
-0
include/sound/pcm.h
include/sound/pcm.h
+2
-0
sound/core/pcm_misc.c
sound/core/pcm_misc.c
+30
-0
未找到文件。
include/sound/pcm.h
浏览文件 @
89595f5e
...
...
@@ -1093,6 +1093,8 @@ unsigned int snd_pcm_rate_to_rate_bit(unsigned int rate);
unsigned
int
snd_pcm_rate_bit_to_rate
(
unsigned
int
rate_bit
);
unsigned
int
snd_pcm_rate_mask_intersect
(
unsigned
int
rates_a
,
unsigned
int
rates_b
);
unsigned
int
snd_pcm_rate_range_to_bits
(
unsigned
int
rate_min
,
unsigned
int
rate_max
);
/**
* snd_pcm_set_runtime_buffer - Set the PCM runtime buffer
...
...
sound/core/pcm_misc.c
浏览文件 @
89595f5e
...
...
@@ -565,3 +565,33 @@ unsigned int snd_pcm_rate_mask_intersect(unsigned int rates_a,
return
rates_a
&
rates_b
;
}
EXPORT_SYMBOL_GPL
(
snd_pcm_rate_mask_intersect
);
/**
* snd_pcm_rate_range_to_bits - converts rate range to SNDRV_PCM_RATE_xxx bit
* @rate_min: the minimum sample rate
* @rate_max: the maximum sample rate
*
* This function has an implicit assumption: the rates in the given range have
* only the pre-defined rates like 44100 or 16000.
*
* Return: The SNDRV_PCM_RATE_xxx flag that corresponds to the given rate range,
* or SNDRV_PCM_RATE_KNOT for an unknown range.
*/
unsigned
int
snd_pcm_rate_range_to_bits
(
unsigned
int
rate_min
,
unsigned
int
rate_max
)
{
unsigned
int
rates
=
0
;
int
i
;
for
(
i
=
0
;
i
<
snd_pcm_known_rates
.
count
;
i
++
)
{
if
(
snd_pcm_known_rates
.
list
[
i
]
>=
rate_min
&&
snd_pcm_known_rates
.
list
[
i
]
<=
rate_max
)
rates
|=
1
<<
i
;
}
if
(
!
rates
)
rates
=
SNDRV_PCM_RATE_KNOT
;
return
rates
;
}
EXPORT_SYMBOL_GPL
(
snd_pcm_rate_range_to_bits
);
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录