Commit cbb984b6 authored by Peter Ujfalusi's avatar Peter Ujfalusi Committed by Mark Brown

ASoC: SOF: loader: Add support for IPC dependent post firmware boot ops

Add support for executing IPC dependent tasks after a successful firmware
boot.

The new post_fw_boot ops can make the fw_loader query_fw_configuration
callback redundant as IPC code can handle the first boot internally.
Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: default avatarChao Song <chao.song@intel.com>
Reviewed-by: default avatarKai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20221020121238.18339-17-peter.ujfalusi@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 3ab2c21e
...@@ -174,6 +174,12 @@ int snd_sof_run_firmware(struct snd_sof_dev *sdev) ...@@ -174,6 +174,12 @@ int snd_sof_run_firmware(struct snd_sof_dev *sdev)
return ret; return ret;
} }
if (sdev->ipc->ops->post_fw_boot) {
ret = sdev->ipc->ops->post_fw_boot(sdev);
if (ret)
return ret;
}
if (sdev->first_boot && sdev->ipc->ops->fw_loader->query_fw_configuration) if (sdev->first_boot && sdev->ipc->ops->fw_loader->query_fw_configuration)
return sdev->ipc->ops->fw_loader->query_fw_configuration(sdev); return sdev->ipc->ops->fw_loader->query_fw_configuration(sdev);
......
...@@ -445,6 +445,8 @@ struct sof_ipc_pcm_ops; ...@@ -445,6 +445,8 @@ struct sof_ipc_pcm_ops;
* *
* @init: Optional pointer for IPC related initialization * @init: Optional pointer for IPC related initialization
* @exit: Optional pointer for IPC related cleanup * @exit: Optional pointer for IPC related cleanup
* @post_fw_boot: Optional pointer to execute IPC related tasks after firmware
* boot.
* *
* @tx_msg: Function pointer for sending a 'short' IPC message * @tx_msg: Function pointer for sending a 'short' IPC message
* @set_get_data: Function pointer for set/get data ('large' IPC message). This * @set_get_data: Function pointer for set/get data ('large' IPC message). This
...@@ -469,6 +471,7 @@ struct sof_ipc_ops { ...@@ -469,6 +471,7 @@ struct sof_ipc_ops {
int (*init)(struct snd_sof_dev *sdev); int (*init)(struct snd_sof_dev *sdev);
void (*exit)(struct snd_sof_dev *sdev); void (*exit)(struct snd_sof_dev *sdev);
int (*post_fw_boot)(struct snd_sof_dev *sdev);
int (*tx_msg)(struct snd_sof_dev *sdev, void *msg_data, size_t msg_bytes, int (*tx_msg)(struct snd_sof_dev *sdev, void *msg_data, size_t msg_bytes,
void *reply_data, size_t reply_bytes, bool no_pm); void *reply_data, size_t reply_bytes, bool no_pm);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment