OSDN Git Service

ASoC: SOF: IPC: dai: Expand DAI_CONFIG IPC flags
authorRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Thu, 25 Nov 2021 10:15:19 +0000 (12:15 +0200)
committerMark Brown <broonie@kernel.org>
Fri, 26 Nov 2021 13:24:24 +0000 (13:24 +0000)
commita0f84dfb3f6d9f78f862cbe885036d3e4449fc6f
tree45a6ff9d8838761dea50f4208a3839a2da1cbac1
parent0b639dcd457b1d3fc660e5a77b02cf65acde3b5a
ASoC: SOF: IPC: dai: Expand DAI_CONFIG IPC flags

Some DAI components, such as HDaudio, need to be stopped in two steps
a) stop the DAI component
b) stop the DAI DMA

This patch enables this two-step stop by expanding the DAI_CONFIG
IPC flags and split them into 2 parts.

The 4 LSB bits indicate when the DAI_CONFIG IPC is sent, ex: hw_params,
hw_free or pause. The 4 MSB bits are used as the quirk flags to be used
along with the command flags. The quirk flag called
SOF_DAI_CONFIG_FLAGS_2_STEP_STOP shall be set along with the HW_PARAMS
command flag, i.e. before the pipeline is started so that the stop/pause
trigger op in the FW can take the appropriate action to either
perform/skip the DMA stop. If set, the DMA stop will be executed when
the DAI_CONFIG IPC is sent during hw_free. In the case of pause, DMA
pause will be handled when the DAI_CONFIG IPC is sent with the PAUSE
command flag.

Along with this, modify the signature for the hda_ctrl_dai_widget_setup/
hda_ctrl_dai_widget_free() functions to take additional flags as an
argument and modify all users to pass the appropriate quirk flags. Only
the HDA DAI's need to pass the SOF_DAI_CONFIG_FLAGS_2_STEP_STOP quirk
flag during hw_params to indicate that it supports two-step stop and
pause.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20211125101520.291581-10-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
include/sound/sof/dai.h
sound/soc/sof/intel/hda-dai.c
sound/soc/sof/intel/hda.c
sound/soc/sof/intel/hda.h
sound/soc/sof/sof-audio.c