Skip to content

Commit b30b60a

Browse files
plbossartbroonie
authored andcommitted
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 <[email protected]> Reviewed-by: Bard Liao <[email protected]> Reviewed-by: Guennadi Liakhovetski <[email protected]> Reviewed-by: Brent Lu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 21c5169 commit b30b60a

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

sound/soc/sof/intel/hda.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ int hda_ctrl_dai_widget_setup(struct snd_soc_dapm_widget *w)
7171
return ret;
7272
}
7373

74+
/* set HW_PARAMS flag */
75+
config->flags = FIELD_PREP(SOF_DAI_CONFIG_FLAGS_MASK, SOF_DAI_CONFIG_FLAGS_HW_PARAMS);
76+
7477
/* send DAI_CONFIG IPC */
7578
ret = sof_ipc_tx_message(sdev->ipc, config->hdr.cmd, config, config->hdr.size,
7679
&reply, sizeof(reply));
@@ -107,6 +110,9 @@ int hda_ctrl_dai_widget_free(struct snd_soc_dapm_widget *w)
107110

108111
config = &sof_dai->dai_config[sof_dai->current_config];
109112

113+
/* set HW_FREE flag */
114+
config->flags = FIELD_PREP(SOF_DAI_CONFIG_FLAGS_MASK, SOF_DAI_CONFIG_FLAGS_HW_FREE);
115+
110116
ret = sof_ipc_tx_message(sdev->ipc, config->hdr.cmd, config, config->hdr.size,
111117
&reply, sizeof(reply));
112118
if (ret < 0)

sound/soc/sof/sof-audio.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// Author: Ranjani Sridharan <[email protected]>
99
//
1010

11+
#include <linux/bitfield.h>
1112
#include "sof-audio.h"
1213
#include "ops.h"
1314

@@ -55,6 +56,9 @@ static int sof_dai_config_setup(struct snd_sof_dev *sdev, struct snd_sof_dai *da
5556
return -EINVAL;
5657
}
5758

59+
/* set NONE flag to clear all previous settings */
60+
config->flags = FIELD_PREP(SOF_DAI_CONFIG_FLAGS_MASK, SOF_DAI_CONFIG_FLAGS_NONE);
61+
5862
ret = sof_ipc_tx_message(sdev->ipc, config->hdr.cmd, config, config->hdr.size,
5963
&reply, sizeof(reply));
6064

0 commit comments

Comments
 (0)