Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
2f43a23a
Commit
2f43a23a
authored
Jan 16, 2014
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'asoc/topic/pcm' into for-tiwai
parents
7cfa7b54
55dcdb50
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
59 additions
and
18 deletions
+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
No files found.
include/sound/pcm.h
View file @
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
View file @
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
View file @
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
View file @
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
View file @
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
View file @
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
View file @
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
);
if
(
hw
->
formats
)
hw
->
formats
&=
codec_stream
->
formats
&
cpu_stream
->
formats
;
else
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
;
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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment