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
Kirill Smelkov
linux
Commits
89595f5e
Commit
89595f5e
authored
Mar 13, 2016
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'asoc/topic/core-pcm' into asoc-next
parents
977011ea
3bdff244
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
0 deletions
+32
-0
include/sound/pcm.h
include/sound/pcm.h
+2
-0
sound/core/pcm_misc.c
sound/core/pcm_misc.c
+30
-0
No files found.
include/sound/pcm.h
View file @
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
View file @
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
);
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