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
614acf93
Commit
614acf93
authored
Dec 30, 2014
by
Takashi Iwai
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'topic/msbits' into for-next
parents
6a8484b6
0e2a3751
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
22 deletions
+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
No files found.
sound/core/pcm_lib.c
View file @
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
View file @
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
)
...
...
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