Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
2f43a23a
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
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看板
提交
2f43a23a
编写于
1月 16, 2014
作者:
M
Mark Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'asoc/topic/pcm' into for-tiwai
上级
7cfa7b54
55dcdb50
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
59 addition
and
18 deletion
+59
-18
include/sound/pcm.h
include/sound/pcm.h
+2
-0
include/sound/soc.h
include/sound/soc.h
+4
-0
sound/core/pcm_misc.c
sound/core/pcm_misc.c
+39
-0
sound/soc/fsl/fsl_ssi.c
sound/soc/fsl/fsl_ssi.c
+1
-2
sound/soc/fsl/mpc5200_psc_i2s.c
sound/soc/fsl/mpc5200_psc_i2s.c
+1
-2
sound/soc/s6000/s6000-i2s.c
sound/soc/s6000/s6000-i2s.c
+1
-2
sound/soc/soc-pcm.c
sound/soc/soc-pcm.c
+11
-12
未找到文件。
include/sound/pcm.h
浏览文件 @
2f43a23a
...
...
@@ -900,6 +900,8 @@ extern const struct snd_pcm_hw_constraint_list snd_pcm_known_rates;
int
snd_pcm_limit_hw_rates
(
struct
snd_pcm_runtime
*
runtime
);
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
);
static
inline
void
snd_pcm_set_runtime_buffer
(
struct
snd_pcm_substream
*
substream
,
struct
snd_dma_buffer
*
bufp
)
...
...
include/sound/soc.h
浏览文件 @
2f43a23a
...
...
@@ -895,6 +895,10 @@ struct snd_soc_dai_link {
/* This DAI link can route to other DAI links at runtime (Frontend)*/
unsigned
int
dynamic
:
1
;
/* DPCM capture and Playback support */
unsigned
int
dpcm_capture
:
1
;
unsigned
int
dpcm_playback
:
1
;
/* pmdown_time is ignored at stop */
unsigned
int
ignore_pmdown_time
:
1
;
...
...
sound/core/pcm_misc.c
浏览文件 @
2f43a23a
...
...
@@ -514,3 +514,42 @@ unsigned int snd_pcm_rate_bit_to_rate(unsigned int rate_bit)
return
0
;
}
EXPORT_SYMBOL
(
snd_pcm_rate_bit_to_rate
);
static
unsigned
int
snd_pcm_rate_mask_sanitize
(
unsigned
int
rates
)
{
if
(
rates
&
SNDRV_PCM_RATE_CONTINUOUS
)
return
SNDRV_PCM_RATE_CONTINUOUS
;
else
if
(
rates
&
SNDRV_PCM_RATE_KNOT
)
return
SNDRV_PCM_RATE_KNOT
;
return
rates
;
}
/**
* snd_pcm_rate_mask_intersect - computes the intersection between two rate masks
* @rates_a: The first rate mask
* @rates_b: The second rate mask
*
* This function computes the rates that are supported by both rate masks passed
* to the function. It will take care of the special handling of
* SNDRV_PCM_RATE_CONTINUOUS and SNDRV_PCM_RATE_KNOT.
*
* Return: A rate mask containing the rates that are supported by both rates_a
* and rates_b.
*/
unsigned
int
snd_pcm_rate_mask_intersect
(
unsigned
int
rates_a
,
unsigned
int
rates_b
)
{
rates_a
=
snd_pcm_rate_mask_sanitize
(
rates_a
);
rates_b
=
snd_pcm_rate_mask_sanitize
(
rates_b
);
if
(
rates_a
&
SNDRV_PCM_RATE_CONTINUOUS
)
return
rates_b
;
else
if
(
rates_b
&
SNDRV_PCM_RATE_CONTINUOUS
)
return
rates_a
;
else
if
(
rates_a
&
SNDRV_PCM_RATE_KNOT
)
return
rates_b
;
else
if
(
rates_b
&
SNDRV_PCM_RATE_KNOT
)
return
rates_a
;
return
rates_a
&
rates_b
;
}
EXPORT_SYMBOL_GPL
(
snd_pcm_rate_mask_intersect
);
sound/soc/fsl/fsl_ssi.c
浏览文件 @
2f43a23a
...
...
@@ -80,8 +80,7 @@ static inline void write_ssi_mask(u32 __iomem *addr, u32 clear, u32 set)
* ALSA that we support all rates and let the codec driver decide what rates
* are really supported.
*/
#define FSLSSI_I2S_RATES (SNDRV_PCM_RATE_5512 | SNDRV_PCM_RATE_8000_192000 | \
SNDRV_PCM_RATE_CONTINUOUS)
#define FSLSSI_I2S_RATES SNDRV_PCM_RATE_CONTINUOUS
/**
* FSLSSI_I2S_FORMATS: audio formats supported by the SSI
...
...
sound/soc/fsl/mpc5200_psc_i2s.c
浏览文件 @
2f43a23a
...
...
@@ -26,8 +26,7 @@
* ALSA that we support all rates and let the codec driver decide what rates
* are really supported.
*/
#define PSC_I2S_RATES (SNDRV_PCM_RATE_5512 | SNDRV_PCM_RATE_8000_192000 | \
SNDRV_PCM_RATE_CONTINUOUS)
#define PSC_I2S_RATES SNDRV_PCM_RATE_CONTINUOUS
/**
* PSC_I2S_FORMATS: audio formats supported by the PSC I2S mode
...
...
sound/soc/s6000/s6000-i2s.c
浏览文件 @
2f43a23a
...
...
@@ -405,8 +405,7 @@ static int s6000_i2s_dai_probe(struct snd_soc_dai *dai)
return
0
;
}
#define S6000_I2S_RATES (SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_5512 | \
SNDRV_PCM_RATE_8000_192000)
#define S6000_I2S_RATES SNDRV_PCM_RATE_CONTINUOUS
#define S6000_I2S_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE)
static
const
struct
snd_soc_dai_ops
s6000_i2s_dai_ops
=
{
...
...
sound/soc/soc-pcm.c
浏览文件 @
2f43a23a
...
...
@@ -240,14 +240,15 @@ static void soc_pcm_init_runtime_hw(struct snd_pcm_runtime *runtime,
cpu_stream
->
channels_min
);
hw
->
channels_max
=
min
(
codec_stream
->
channels_max
,
cpu_stream
->
channels_max
);
hw
->
formats
=
codec_stream
->
formats
&
cpu_stream
->
formats
;
hw
->
rates
=
codec_stream
->
rates
&
cpu_stream
->
rates
;
if
(
codec_stream
->
rates
&
(
SNDRV_PCM_RATE_KNOT
|
SNDRV_PCM_RATE_CONTINUOUS
))
hw
->
rates
|=
cpu_stream
->
rates
;
if
(
cpu_stream
->
rates
&
(
SNDRV_PCM_RATE_KNOT
|
SNDRV_PCM_RATE_CONTINUOUS
))
hw
->
rates
|=
codec_stream
->
rates
;
if
(
hw
->
formats
)
hw
->
formats
&=
codec_stream
->
formats
&
cpu_stream
->
formats
;
else
hw
->
formats
=
codec_stream
->
formats
&
cpu_stream
->
formats
;
hw
->
rates
=
snd_pcm_rate_mask_intersect
(
codec_stream
->
rates
,
cpu_stream
->
rates
);
hw
->
rate_min
=
0
;
hw
->
rate_max
=
UINT_MAX
;
snd_pcm_limit_hw_rates
(
runtime
);
...
...
@@ -2140,10 +2141,8 @@ int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num)
int
ret
=
0
,
playback
=
0
,
capture
=
0
;
if
(
rtd
->
dai_link
->
dynamic
||
rtd
->
dai_link
->
no_pcm
)
{
if
(
cpu_dai
->
driver
->
playback
.
channels_min
)
playback
=
1
;
if
(
cpu_dai
->
driver
->
capture
.
channels_min
)
capture
=
1
;
playback
=
rtd
->
dai_link
->
dpcm_playback
;
capture
=
rtd
->
dai_link
->
dpcm_capture
;
}
else
{
if
(
codec_dai
->
driver
->
playback
.
channels_min
&&
cpu_dai
->
driver
->
playback
.
channels_min
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录