mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-18 19:43:43 -04:00
ASoC: SOF: pcm: Improve the pcm trigger sequence
The recommended sequence for triggering the host DMA is to first program the DMA in the FW before setting the RUN bit to start the stream in the host. With IPC3, this sequence is honored because the FW programs the DMA when the HW_PARAMS IPC is sent during PCM hw_params and then the host sets the RUN bit during sof_pcm_trigger(). But with IPC4, sof_pcm_trigger() sends the SET_PIPELINE_STATE IPC to program the DMA in the FW after the DMA RUN bit is set. In order to minimize the impact for IPC3, introduce a new flag as part of struct sof_ipc_pcm_ops, ipc_first_on_start, which will be set for IPC4 only. With this flag set, the SET_PIPELINE_STATE IPC will be sent before the DMA RUN bit is set by the host during the START/PAUSE_RELEASE triggers. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Link: https://lore.kernel.org/r/20230322094346.6019-4-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
committed by
Mark Brown
parent
7d6f623c6a
commit
51ce3e6eff
@@ -106,6 +106,8 @@ struct snd_sof_dai_config_data {
|
||||
* @delay: Function pointer for pcm delay calculation
|
||||
* @reset_hw_params_during_stop: Flag indicating whether the hw_params should be reset during the
|
||||
* STOP pcm trigger
|
||||
* @ipc_first_on_start: Send IPC before invoking platform trigger during
|
||||
* START/PAUSE_RELEASE triggers
|
||||
*/
|
||||
struct sof_ipc_pcm_ops {
|
||||
int (*hw_params)(struct snd_soc_component *component, struct snd_pcm_substream *substream,
|
||||
@@ -120,6 +122,7 @@ struct sof_ipc_pcm_ops {
|
||||
snd_pcm_sframes_t (*delay)(struct snd_soc_component *component,
|
||||
struct snd_pcm_substream *substream);
|
||||
bool reset_hw_params_during_stop;
|
||||
bool ipc_first_on_start;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user