ASoC: SOF: ipc4: Handle compressed drain done notification from firmware

The decoder module sends a drain done notification when the last chunk of
the stream after the EOS from host has been decoded.

The notification is a module notification with 0xc0c0 as magic number in
event_id upper 16 bit.

Call sof_ipc4_compr_drain_done() when the notification arrives to handle
it.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Link: https://patch.msgid.link/20261007084955.1256-26-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Peter Ujfalusi 2026-10-07 11:49:52 +03:00 committed by Mark Brown
parent 782a378dac
commit 176f4f8934
2 changed files with 13 additions and 3 deletions

View File

@ -647,9 +647,10 @@ struct sof_ipc4_notify_module_data {
* The event_data contains the struct sof_ipc4_control_msg_payload of the control
* which sent the notification.
*/
#define SOF_IPC4_NOTIFY_MODULE_EVENTID_ALSA_MAGIC_MASK GENMASK(31, 16)
#define SOF_IPC4_NOTIFY_MODULE_EVENTID_SOF_MAGIC_MASK GENMASK(31, 16)
#define SOF_IPC4_NOTIFY_MODULE_EVENTID_ALSA_MAGIC_VAL 0xA15A0000
#define SOF_IPC4_NOTIFY_MODULE_EVENTID_ALSA_PARAMID_MASK GENMASK(15, 0)
#define SOF_IPC4_NOTIFY_MODULE_EVENTID_COMPR_MAGIC_VAL 0xC0C00000
/*
* Macros for creating struct sof_ipc4_module_init_ext_init payload

View File

@ -776,12 +776,21 @@ static void sof_ipc4_module_notification_handler(struct snd_sof_dev *sdev,
}
/* Handle ALSA kcontrol notification */
if ((data->event_id & SOF_IPC4_NOTIFY_MODULE_EVENTID_ALSA_MAGIC_MASK) ==
SOF_IPC4_NOTIFY_MODULE_EVENTID_ALSA_MAGIC_VAL) {
switch (data->event_id & SOF_IPC4_NOTIFY_MODULE_EVENTID_SOF_MAGIC_MASK) {
case SOF_IPC4_NOTIFY_MODULE_EVENTID_ALSA_MAGIC_VAL:
{
const struct sof_ipc_tplg_ops *tplg_ops = sdev->ipc->ops->tplg;
if (tplg_ops->control->update)
tplg_ops->control->update(sdev, ipc4_msg);
break;
}
case SOF_IPC4_NOTIFY_MODULE_EVENTID_COMPR_MAGIC_VAL:
sof_ipc4_compr_drain_done(sdev, ipc4_msg);
break;
default:
break;
}
}