Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: SOF: Intel: hda: add new flags for DAI_CONFIG

The DAI_CONFIG is used for both hw_params and hw_free. Use flags to
specify what stage the configuration applies to.

the DAI_CONFIG IPC may be sent also during the widget setup so each
flag is cleared after the IPC to restore the state.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Brent Lu <brent.lu@intel.com>
Link: https://lore.kernel.org/r/20211004171430.103674-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Pierre-Louis Bossart and committed by
Mark Brown
b30b60a2 21c51692

+10
+6
sound/soc/sof/intel/hda.c
··· 71 71 return ret; 72 72 } 73 73 74 + /* set HW_PARAMS flag */ 75 + config->flags = FIELD_PREP(SOF_DAI_CONFIG_FLAGS_MASK, SOF_DAI_CONFIG_FLAGS_HW_PARAMS); 76 + 74 77 /* send DAI_CONFIG IPC */ 75 78 ret = sof_ipc_tx_message(sdev->ipc, config->hdr.cmd, config, config->hdr.size, 76 79 &reply, sizeof(reply)); ··· 109 106 return 0; 110 107 111 108 config = &sof_dai->dai_config[sof_dai->current_config]; 109 + 110 + /* set HW_FREE flag */ 111 + config->flags = FIELD_PREP(SOF_DAI_CONFIG_FLAGS_MASK, SOF_DAI_CONFIG_FLAGS_HW_FREE); 112 112 113 113 ret = sof_ipc_tx_message(sdev->ipc, config->hdr.cmd, config, config->hdr.size, 114 114 &reply, sizeof(reply));
+4
sound/soc/sof/sof-audio.c
··· 8 8 // Author: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> 9 9 // 10 10 11 + #include <linux/bitfield.h> 11 12 #include "sof-audio.h" 12 13 #include "ops.h" 13 14 ··· 55 54 dev_err(sdev->dev, "error: no config for DAI %s\n", dai->name); 56 55 return -EINVAL; 57 56 } 57 + 58 + /* set NONE flag to clear all previous settings */ 59 + config->flags = FIELD_PREP(SOF_DAI_CONFIG_FLAGS_MASK, SOF_DAI_CONFIG_FLAGS_NONE); 58 60 59 61 ret = sof_ipc_tx_message(sdev->ipc, config->hdr.cmd, config, config->hdr.size, 60 62 &reply, sizeof(reply));