From af79e066402fa9cc4fb8115a8e25e5c5ae40e021 Mon Sep 17 00:00:00 2001 From: Gyeongtaek Lee Date: Thu, 14 Dec 2017 16:19:54 +0900 Subject: [PATCH] [RAMEN9610-10895][COMMON] ASoC: abox: skip hw params fixup If stream is active already, hw params shouldn't be changed because H/W doesn't support runtime format change. Change-Id: I51a8766820e565c1252c4e3f79c941d895123f54 Signed-off-by: Gyeongtaek Lee --- sound/soc/samsung/abox/abox.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sound/soc/samsung/abox/abox.c b/sound/soc/samsung/abox/abox.c index f43bbaa369ca..1136c3edf9be 100644 --- a/sound/soc/samsung/abox/abox.c +++ b/sound/soc/samsung/abox/abox.c @@ -3021,6 +3021,7 @@ int abox_hw_params_fixup_helper(struct snd_soc_pcm_runtime *rtd, enum ABOX_CONFIGMSG msg_rate, msg_format; unsigned int rate, channels, width; snd_pcm_format_t format; + bool skip_ipc = false; dev_info(dev, "%s[%s](%d)\n", __func__, dai->name, stream); @@ -3085,6 +3086,13 @@ skip_capture: if (!w_tgt) goto unlock; + if (w_tgt->power) { + dev_info(dev, "%s: %s: skip ipc due to active already\n", + __func__, w_tgt->name); + skip_ipc = true; + goto unlock; + } + /* channel mixing isn't supported */ abox_set_sif_channels(data, msg_format, params_channels(params)); @@ -3119,8 +3127,12 @@ unlock: if (!w_tgt) goto out; + if (skip_ipc) + goto fixup; + abox_sample_rate_put_ipc(dev, rate, msg_rate); abox_sif_format_put_ipc(dev, format, channels, msg_format); +fixup: hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE)->min = abox_get_sif_rate(data, msg_rate); hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS)->min = -- 2.20.1