Skip to content

Commit 7aafff6

Browse files
committed
ASoC: SOF: Intel: HDA: Set up sof_ipc4_fw_data for IPC4
Allocate the sof_ipc4_fw_data struct for IPC4 and set the fw header offset for the platforms which will be used by the core when loading the firmware image. The core expects that the "private" field in struct snd_sof_dev (which is unused today with IPC3) is used to save this data. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
1 parent b7490f9 commit 7aafff6

3 files changed

Lines changed: 35 additions & 0 deletions

File tree

sound/soc/sof/intel/apl.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
* Hardware interface for audio DSP on Apollolake and GeminiLake
1616
*/
1717

18+
#include <sound/sof/ext_manifest4.h>
19+
#include "../ipc4-priv.h"
1820
#include "../sof-priv.h"
1921
#include "hda.h"
2022
#include "../sof-audio.h"
@@ -46,6 +48,16 @@ int sof_apl_ops_init(struct snd_sof_dev *sdev)
4648
}
4749

4850
if (sdev->pdata->ipc_type == SOF_INTEL_IPC4) {
51+
struct sof_ipc4_fw_data *ipc4_data;
52+
53+
sdev->private = devm_kzalloc(sdev->dev, sizeof(*ipc4_data), GFP_KERNEL);
54+
if (!sdev->private)
55+
return -ENOMEM;
56+
57+
ipc4_data = sdev->private;
58+
ipc4_data->manifest_fw_hdr_offset = SOF_MAN4_FW_HDR_OFFSET;
59+
60+
/* doorbell */
4961
sof_apl_ops.irq_thread = hda_dsp_ipc4_irq_thread;
5062

5163
/* ipc */

sound/soc/sof/intel/cnl.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
* Hardware interface for audio DSP on Cannonlake.
1616
*/
1717

18+
#include <sound/sof/ext_manifest4.h>
1819
#include <sound/sof/ipc4/header.h>
20+
#include "../ipc4-priv.h"
1921
#include "../ops.h"
2022
#include "hda.h"
2123
#include "hda-ipc.h"
@@ -345,6 +347,16 @@ int sof_cnl_ops_init(struct snd_sof_dev *sdev)
345347
}
346348

347349
if (sdev->pdata->ipc_type == SOF_INTEL_IPC4) {
350+
struct sof_ipc4_fw_data *ipc4_data;
351+
352+
sdev->private = devm_kzalloc(sdev->dev, sizeof(*ipc4_data), GFP_KERNEL);
353+
if (!sdev->private)
354+
return -ENOMEM;
355+
356+
ipc4_data = sdev->private;
357+
ipc4_data->manifest_fw_hdr_offset = SOF_MAN4_FW_HDR_OFFSET;
358+
359+
/* doorbell */
348360
sof_cnl_ops.irq_thread = cnl_ipc4_irq_thread;
349361

350362
/* ipc */

sound/soc/sof/intel/tgl.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
* Hardware interface for audio DSP on Tigerlake.
1010
*/
1111

12+
#include <sound/sof/ext_manifest4.h>
13+
#include "../ipc4-priv.h"
1214
#include "../ops.h"
1315
#include "hda.h"
1416
#include "hda-ipc.h"
@@ -79,6 +81,15 @@ int sof_tgl_ops_init(struct snd_sof_dev *sdev)
7981
}
8082

8183
if (sdev->pdata->ipc_type == SOF_INTEL_IPC4) {
84+
struct sof_ipc4_fw_data *ipc4_data;
85+
86+
sdev->private = devm_kzalloc(sdev->dev, sizeof(*ipc4_data), GFP_KERNEL);
87+
if (!sdev->private)
88+
return -ENOMEM;
89+
90+
ipc4_data = sdev->private;
91+
ipc4_data->manifest_fw_hdr_offset = SOF_MAN4_FW_HDR_OFFSET;
92+
8293
/* doorbell */
8394
sof_tgl_ops.irq_thread = cnl_ipc4_irq_thread;
8495

0 commit comments

Comments
 (0)