alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Kai Vehmanen <kai.vehmanen@linux.intel.com>
To: alsa-devel@alsa-project.org, broonie@kernel.org
Cc: kai.vehmanen@linux.intel.com, lgirdwood@gmail.com,
	pierre-louis.bossart@linux.intel.com,
	Fred Oh <fred.oh@linux.intel.com>,
	ranjani.sridharan@linux.intel.com, daniel.baluta@nxp.com
Subject: [PATCH 1/5] ASoC: SOF: ops: add parse_platform_ext_manifest() op
Date: Fri, 27 Nov 2020 18:40:18 +0200	[thread overview]
Message-ID: <20201127164022.2498406-2-kai.vehmanen@linux.intel.com> (raw)
In-Reply-To: <20201127164022.2498406-1-kai.vehmanen@linux.intel.com>

From: Fred Oh <fred.oh@linux.intel.com>

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>
---
 include/sound/sof/ext_manifest.h |  1 +
 sound/soc/sof/loader.c           |  3 +++
 sound/soc/sof/ops.h              | 10 ++++++++++
 sound/soc/sof/sof-priv.h         |  5 +++++
 4 files changed, 19 insertions(+)

diff --git a/include/sound/sof/ext_manifest.h b/include/sound/sof/ext_manifest.h
index e05cb21023e5..7abc4f0bd3ad 100644
--- a/include/sound/sof/ext_manifest.h
+++ b/include/sound/sof/ext_manifest.h
@@ -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 */
diff --git a/sound/soc/sof/loader.c b/sound/soc/sof/loader.c
index 2a8c9bff9963..cbce484b6469 100644
--- a/sound/soc/sof/loader.c
+++ b/sound/soc/sof/loader.c
@@ -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);
diff --git a/sound/soc/sof/ops.h b/sound/soc/sof/ops.h
index b21632f5511a..77a6ac157d37 100644
--- a/sound/soc/sof/ops.h
+++ b/sound/soc/sof/ops.h
@@ -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 */
 
 /**
diff --git a/sound/soc/sof/sof-priv.h b/sound/soc/sof/sof-priv.h
index d8bc0178dc89..32d6ceb41fdd 100644
--- a/sound/soc/sof/sof-priv.h
+++ b/sound/soc/sof/sof-priv.h
@@ -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 */
-- 
2.28.0


  reply	other threads:[~2020-11-27 16:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-27 16:40 [PATCH 0/5] ASoC: SOF: Intel: fix ICL boot sequence Kai Vehmanen
2020-11-27 16:40 ` Kai Vehmanen [this message]
2020-11-27 16:40 ` [PATCH 2/5] ASoC: SOF: Intel: hda: define parse_platform_ext_manifest op Kai Vehmanen
2020-11-27 16:40 ` [PATCH 3/5] ASoC: SOF: ext_manifest: parse cavs extra config data elem Kai Vehmanen
2020-11-27 16:40 ` [PATCH 4/5] ASoC: SOF: ops: modify the signature of stall op Kai Vehmanen
2020-11-27 16:40 ` [PATCH 5/5] ASoC: SOF: Intel: hda: add sof_icl_ops for ICL platforms Kai Vehmanen
2020-11-30 16:55 ` [PATCH 0/5] ASoC: SOF: Intel: fix ICL boot sequence Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201127164022.2498406-2-kai.vehmanen@linux.intel.com \
    --to=kai.vehmanen@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=daniel.baluta@nxp.com \
    --cc=fred.oh@linux.intel.com \
    --cc=lgirdwood@gmail.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=ranjani.sridharan@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).