ASoC: Intel: catpt: Correct clock selection for dai trigger
authorCezary Rojewski <cezary.rojewski@intel.com>
Mon, 16 Nov 2020 13:33:29 +0000 (14:33 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 16 Nov 2020 20:03:28 +0000 (20:03 +0000)
During stream start DSP firmware requires LPCS disabled as that moment in
time is resource heavy. Currently high-clock is selected on start of
second stream onwards while low-clock is re-selected before stream
actually leaves RESUME state i.e. PAUSE_STREAM call. Fix this by always
updating clock before RESUME_STREAM and directly after PAUSE_STREAM.

Fixes: a126750fc865 ("ASoC: Intel: catpt: PCM operations")
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20201116133332.8530-3-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/catpt/pcm.c

index 174a786..2061978 100644 (file)
@@ -458,10 +458,6 @@ static int catpt_dai_prepare(struct snd_pcm_substream *substream,
        if (ret)
                return CATPT_IPC_ERROR(ret);
 
-       ret = catpt_dsp_update_lpclock(cdev);
-       if (ret)
-               return ret;
-
        ret = catpt_dai_apply_usettings(dai, stream);
        if (ret)
                return ret;
@@ -500,6 +496,7 @@ static int catpt_dai_trigger(struct snd_pcm_substream *substream, int cmd,
        case SNDRV_PCM_TRIGGER_RESUME:
        case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
        resume_stream:
+               catpt_dsp_update_lpclock(cdev);
                ret = catpt_ipc_resume_stream(cdev, stream->info.stream_hw_id);
                if (ret)
                        return CATPT_IPC_ERROR(ret);
@@ -507,11 +504,11 @@ static int catpt_dai_trigger(struct snd_pcm_substream *substream, int cmd,
 
        case SNDRV_PCM_TRIGGER_STOP:
                stream->prepared = false;
-               catpt_dsp_update_lpclock(cdev);
                fallthrough;
        case SNDRV_PCM_TRIGGER_SUSPEND:
        case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
                ret = catpt_ipc_pause_stream(cdev, stream->info.stream_hw_id);
+               catpt_dsp_update_lpclock(cdev);
                if (ret)
                        return CATPT_IPC_ERROR(ret);
                break;