ASoC: SOF: Introduce snd_sof_dsp_get_mailbox_offset
authorDaniel Baluta <daniel.baluta@nxp.com>
Wed, 7 Aug 2019 15:01:59 +0000 (10:01 -0500)
committerMark Brown <broonie@kernel.org>
Fri, 9 Aug 2019 12:25:43 +0000 (13:25 +0100)
This will allow us to export mailbox offset in order to
read the fw_ready message from.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20190807150203.26359-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/ops.h
sound/soc/sof/sof-priv.h

index 793c1aea0c53b30e4f6f2ee23be456c6f75a963a..c820606f19a1764e77ce517a38ffeb221301f1c2 100644 (file)
@@ -119,6 +119,15 @@ static inline int snd_sof_dsp_get_bar_index(struct snd_sof_dev *sdev, u32 type)
        return sdev->mmio_bar;
 }
 
+static inline int snd_sof_dsp_get_mailbox_offset(struct snd_sof_dev *sdev)
+{
+       if (sof_ops(sdev)->get_mailbox_offset)
+               return sof_ops(sdev)->get_mailbox_offset(sdev);
+
+       dev_err(sdev->dev, "error: %s not defined\n", __func__);
+       return -ENOTSUPP;
+}
+
 /* power management */
 static inline int snd_sof_dsp_resume(struct snd_sof_dev *sdev)
 {
index 1cec3f23f9cd80fc606766d58d8201ec5437d1a6..3aefb8ec3ef95f54bcc18b4b96723d6e4d2dfdee 100644 (file)
@@ -198,6 +198,8 @@ struct snd_sof_dsp_ops {
        /* misc */
        int (*get_bar_index)(struct snd_sof_dev *sdev,
                             u32 type); /* optional */
+       int (*get_mailbox_offset)(struct snd_sof_dev *sdev);/* mandatory for common loader code */
+
        /* DAI ops */
        struct snd_soc_dai_driver *drv;
        int num_drv;