Skip to content

Commit 0354583

Browse files
committed
ASoC: SOF: ipc4-control: If there is no data do not send bytes update
When the bytes control have no data (payload) then there is no need to send an IPC message as there is nothing to send. Fixes: a062c88 ("ASoC: SOF: ipc4-control: Add support for bytes control get and put") Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
1 parent 2b78e31 commit 0354583

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

sound/soc/sof/ipc4-control.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,8 +412,16 @@ static int sof_ipc4_set_get_bytes_data(struct snd_sof_dev *sdev,
412412
int ret = 0;
413413

414414
/* Send the new data to the firmware only if it is powered up */
415-
if (set && !pm_runtime_active(sdev->dev))
416-
return 0;
415+
if (set) {
416+
if (!pm_runtime_active(sdev->dev))
417+
return 0;
418+
419+
if (!data->size) {
420+
dev_dbg(sdev->dev, "%s: No data to be sent.\n",
421+
scontrol->name);
422+
return 0;
423+
}
424+
}
417425

418426
msg->extension = SOF_IPC4_MOD_EXT_MSG_PARAM_ID(data->type);
419427

0 commit comments

Comments
 (0)