[RAMEN9610-10895][COMMON] ASoC: abox: skip hw params fixup
authorGyeongtaek Lee <gt82.lee@samsung.com>
Thu, 14 Dec 2017 07:19:54 +0000 (16:19 +0900)
committerhskang <hs1218.kang@samsung.com>
Tue, 15 Jan 2019 11:06:52 +0000 (20:06 +0900)
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 <gt82.lee@samsung.com>
sound/soc/samsung/abox/abox.c

index f43bbaa369ca946fd94d18cd9e81a692893add45..1136c3edf9befa83f8970b2a1d6b4bbb46e4dec0 100644 (file)
@@ -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 =