ASoC: SOF: ops: add parse_platform_ext_manifest() op
authorFred Oh <fred.oh@linux.intel.com>
Fri, 27 Nov 2020 16:40:18 +0000 (18:40 +0200)
committerMark Brown <broonie@kernel.org>
Fri, 27 Nov 2020 17:23:03 +0000 (17:23 +0000)
Add parse_platform_ext_manifest() op to parse platform-specific config
data in the extended manifest.

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20201127164022.2498406-2-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
include/sound/sof/ext_manifest.h
sound/soc/sof/loader.c
sound/soc/sof/ops.h
sound/soc/sof/sof-priv.h

index e05cb21023e557056cf41042d0975f2f68ce0ac4..7abc4f0bd3ade1155b65809fcbc1df24197dfb25 100644 (file)
@@ -62,6 +62,7 @@ enum sof_ext_man_elem_type {
        SOF_EXT_MAN_ELEM_CC_VERSION             = SOF_IPC_EXT_CC_INFO,
        SOF_EXT_MAN_ELEM_DBG_ABI                = SOF_IPC_EXT_USER_ABI_INFO,
        SOF_EXT_MAN_ELEM_CONFIG_DATA            = 5, /**< ABI3.17 */
+       SOF_EXT_MAN_ELEM_PLATFORM_CONFIG_DATA   = 6,
 };
 
 /* extended manifest element header */
index 2a8c9bff99639ebf10040cc85c3d356f06e867b6..cbce484b64690ea2ffba9db104ac815bd966ec1c 100644 (file)
@@ -330,6 +330,9 @@ static int snd_sof_fw_ext_man_parse(struct snd_sof_dev *sdev,
                case SOF_EXT_MAN_ELEM_CONFIG_DATA:
                        ret = ext_man_get_config_data(sdev, elem_hdr);
                        break;
+               case SOF_EXT_MAN_ELEM_PLATFORM_CONFIG_DATA:
+                       ret = snd_sof_dsp_parse_platform_ext_manifest(sdev, elem_hdr);
+                       break;
                default:
                        dev_info(sdev->dev, "unknown sof_ext_man header type %d size 0x%X\n",
                                 elem_hdr->type, elem_hdr->size);
index b21632f5511a10ca8ddbc372f2d2ca88c0af4499..77a6ac157d3774dc9179fea802fd7c392418be77 100644 (file)
@@ -100,6 +100,16 @@ static inline int snd_sof_dsp_post_fw_run(struct snd_sof_dev *sdev)
        return 0;
 }
 
+/* parse platform specific extended manifest */
+static inline int snd_sof_dsp_parse_platform_ext_manifest(struct snd_sof_dev *sdev,
+                                                         const struct sof_ext_man_elem_header *hdr)
+{
+       if (sof_ops(sdev)->parse_platform_ext_manifest)
+               return sof_ops(sdev)->parse_platform_ext_manifest(sdev, hdr);
+
+       return 0;
+}
+
 /* misc */
 
 /**
index d8bc0178dc89d094500e233bb3434d6313e72765..32d6ceb41fdd5e06e8b53f978eefe14da7766195 100644 (file)
@@ -18,6 +18,7 @@
 #include <sound/sof/pm.h>
 #include <sound/sof/trace.h>
 #include <uapi/sound/sof/fw.h>
+#include <sound/sof/ext_manifest.h>
 
 /* debug flags */
 #define SOF_DBG_ENABLE_TRACE   BIT(0)
@@ -208,6 +209,10 @@ struct snd_sof_dsp_ops {
        int (*pre_fw_run)(struct snd_sof_dev *sof_dev); /* optional */
        int (*post_fw_run)(struct snd_sof_dev *sof_dev); /* optional */
 
+       /* parse platform specific extended manifest, optional */
+       int (*parse_platform_ext_manifest)(struct snd_sof_dev *sof_dev,
+                                          const struct sof_ext_man_elem_header *hdr);
+
        /* DSP PM */
        int (*suspend)(struct snd_sof_dev *sof_dev,
                       u32 target_state); /* optional */