Skip to content

Commit 4708449

Browse files
ujfalusibroonie
authored andcommitted
ASoC: SOF: ipc3-topology: Make sure that only one cmd is sent in dai_config
The commands in sof_ipc_dai_config.flags are encoded as bits: 1 (bit0) - hw_params 2 (bit1) - hw_free 4 (bit2) - pause These are commands, they cannot be combined as one would assume, for example 3 (bit0 | bit1) is invalid. This can happen right at the second start of a stream as at the end of the first stream we set the hw_free command (bit1) and on the second start we would OR on top of it the hw_params (bit0). Fixes: b66bfc3 ("ASoC: SOF: sof-audio: Fix broken early bclk feature for SSP") Signed-off-by: Peter Ujfalusi <[email protected] Reviewed-by: Daniel Baluta <[email protected] Reviewed-by: Bard Liao <[email protected] Reviewed-by: Ranjani Sridharan <[email protected] Reviewed-by: Pierre-Louis Bossart <[email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]
1 parent f63550e commit 4708449

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

sound/soc/sof/ipc3-topology.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2103,10 +2103,13 @@ static int sof_ipc3_dai_config(struct snd_sof_dev *sdev, struct snd_sof_widget *
21032103
* For the case of PAUSE/HW_FREE, since there are no quirks, flags can be used as is.
21042104
*/
21052105

2106-
if (flags & SOF_DAI_CONFIG_FLAGS_HW_PARAMS)
2106+
if (flags & SOF_DAI_CONFIG_FLAGS_HW_PARAMS) {
2107+
/* Clear stale command */
2108+
config->flags &= ~SOF_DAI_CONFIG_FLAGS_CMD_MASK;
21072109
config->flags |= flags;
2108-
else
2110+
} else {
21092111
config->flags = flags;
2112+
}
21102113

21112114
/* only send the IPC if the widget is set up in the DSP */
21122115
if (swidget->use_count > 0) {

0 commit comments

Comments
 (0)