summaryrefslogtreecommitdiff
path: root/sound/soc/sof/intel/apl.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2022-05-12 15:18:23 +0100
committerMark Brown <broonie@kernel.org>2022-05-12 15:18:23 +0100
commitfd4b80044b09c8ee9ccdd1caff025b7d0dabcaf7 (patch)
tree63a773ec682ab9a18786f2fa6dea0a9f1b8b5c83 /sound/soc/sof/intel/apl.c
parent0b7f644f52e81e2a653a353966933b47d01df9bb (diff)
parenta4cfdebdfe62e276f7626eb55b859fe16dcc28ef (diff)
ASoC: SOF: Add IPC4 FW loader support
Merge series from Ranjani Sridharan <ranjani.sridharan@linux.intel.com>: The patches in this series add support for FW loading for IPC4 in the SOF driver.
Diffstat (limited to 'sound/soc/sof/intel/apl.c')
-rw-r--r--sound/soc/sof/intel/apl.c29
1 files changed, 25 insertions, 4 deletions
diff --git a/sound/soc/sof/intel/apl.c b/sound/soc/sof/intel/apl.c
index b7839fd04dfb..0cea280a6d2d 100644
--- a/sound/soc/sof/intel/apl.c
+++ b/sound/soc/sof/intel/apl.c
@@ -15,6 +15,8 @@
* Hardware interface for audio DSP on Apollolake and GeminiLake
*/
+#include <sound/sof/ext_manifest4.h>
+#include "../ipc4-priv.h"
#include "../sof-priv.h"
#include "hda.h"
#include "../sof-audio.h"
@@ -37,11 +39,30 @@ int sof_apl_ops_init(struct snd_sof_dev *sdev)
/* probe/remove/shutdown */
sof_apl_ops.shutdown = hda_dsp_shutdown;
- /* doorbell */
- sof_apl_ops.irq_thread = hda_dsp_ipc_irq_thread;
+ if (sdev->pdata->ipc_type == SOF_IPC) {
+ /* doorbell */
+ sof_apl_ops.irq_thread = hda_dsp_ipc_irq_thread;
- /* ipc */
- sof_apl_ops.send_msg = hda_dsp_ipc_send_msg;
+ /* ipc */
+ sof_apl_ops.send_msg = hda_dsp_ipc_send_msg;
+ }
+
+ if (sdev->pdata->ipc_type == SOF_INTEL_IPC4) {
+ struct sof_ipc4_fw_data *ipc4_data;
+
+ sdev->private = devm_kzalloc(sdev->dev, sizeof(*ipc4_data), GFP_KERNEL);
+ if (!sdev->private)
+ return -ENOMEM;
+
+ ipc4_data = sdev->private;
+ ipc4_data->manifest_fw_hdr_offset = SOF_MAN4_FW_HDR_OFFSET;
+
+ /* doorbell */
+ sof_apl_ops.irq_thread = hda_dsp_ipc4_irq_thread;
+
+ /* ipc */
+ sof_apl_ops.send_msg = hda_dsp_ipc4_send_msg;
+ }
/* set DAI driver ops */
hda_set_dai_drv_ops(sdev, &sof_apl_ops);