summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorMengdong Lin <mengdong.lin@linux.intel.com>2016-02-22 16:29:19 +0800
committerMark Brown <broonie@kernel.org>2016-02-22 19:40:36 +0900
commitb6b6e4d670c9285225dc826bf69620f69717ade0 (patch)
tree502d4a2bb061fd3f30a68f3024c61dc75c2998f5 /sound
parent3375cbe420a8987b30daf3c021bea6fb0b0fe344 (diff)
downloadop-kernel-dev-b6b6e4d670c9285225dc826bf69620f69717ade0.zip
op-kernel-dev-b6b6e4d670c9285225dc826bf69620f69717ade0.tar.gz
ASoC: topology: Fix setting of stream rates, rate_min and rate_max
Directly set a stream's rates, rate_min and rate_max from the topology info. Also define set_stream_info to wrap setting of the stream info. Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/soc-topology.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c
index 07f61a6..1cf94d7 100644
--- a/sound/soc/soc-topology.c
+++ b/sound/soc/soc-topology.c
@@ -1530,6 +1530,18 @@ static int soc_tplg_dapm_complete(struct soc_tplg *tplg)
return 0;
}
+static void set_stream_info(struct snd_soc_pcm_stream *stream,
+ struct snd_soc_tplg_stream_caps *caps)
+{
+ stream->stream_name = kstrdup(caps->name, GFP_KERNEL);
+ stream->channels_min = caps->channels_min;
+ stream->channels_max = caps->channels_max;
+ stream->rates = caps->rates;
+ stream->rate_min = caps->rate_min;
+ stream->rate_max = caps->rate_max;
+ stream->formats = caps->formats;
+}
+
static int soc_tplg_dai_create(struct soc_tplg *tplg,
struct snd_soc_tplg_pcm *pcm)
{
@@ -1548,25 +1560,13 @@ static int soc_tplg_dai_create(struct soc_tplg *tplg,
if (pcm->playback) {
stream = &dai_drv->playback;
caps = &pcm->caps[SND_SOC_TPLG_STREAM_PLAYBACK];
-
- stream->stream_name = kstrdup(caps->name, GFP_KERNEL);
- stream->channels_min = caps->channels_min;
- stream->channels_max = caps->channels_max;
- stream->rates = snd_pcm_rate_range_to_bits(caps->rate_min,
- caps->rate_max);
- stream->formats = caps->formats;
+ set_stream_info(stream, caps);
}
if (pcm->capture) {
stream = &dai_drv->capture;
caps = &pcm->caps[SND_SOC_TPLG_STREAM_CAPTURE];
-
- stream->stream_name = kstrdup(caps->name, GFP_KERNEL);
- stream->channels_min = caps->channels_min;
- stream->channels_max = caps->channels_max;
- stream->rates = snd_pcm_rate_range_to_bits(caps->rate_min,
- caps->rate_max);
- stream->formats = caps->formats;
+ set_stream_info(stream, caps);
}
/* pass control to component driver for optional further init */
OpenPOWER on IntegriCloud