All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guneshwor Singh <guneshwor.o.singh@intel.com>
To: alsa-devel@alsa-project.org, Mark Brown <broonie@kernel.org>
Cc: Takashi Iwai <tiwai@suse.de>,
	Guneshwor Singh <guneshwor.o.singh@intel.com>,
	Patches Audio <patches.audio@intel.com>,
	Liam Girdwood <liam.r.girdwood@linux.intel.com>,
	Vinod Koul <vinod.koul@intel.com>,
	Shreyas NC <shreyas.nc@intel.com>
Subject: [PATCH 1/7] ASoC: Intel: Skylake: Parse multiple manifest data blocks
Date: Mon, 21 Aug 2017 14:16:40 +0530	[thread overview]
Message-ID: <20170821084646.6525-2-guneshwor.o.singh@intel.com> (raw)
In-Reply-To: <20170821084646.6525-1-guneshwor.o.singh@intel.com>

From: Shreyas NC <shreyas.nc@intel.com>

Currently we can parse a single manifest data block. But manifest
private data can have multiple data blocks.

So, fix the parsing logic to parse multiple data blocks by returning
offset of each parsed data block.

Signed-off-by: Shreyas NC <shreyas.nc@intel.com>
Signed-off-by: Guneshwor Singh <guneshwor.o.singh@intel.com>
---
 sound/soc/intel/skylake/skl-topology.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c
index 350d2387f737..f14b373f65d7 100644
--- a/sound/soc/intel/skylake/skl-topology.c
+++ b/sound/soc/intel/skylake/skl-topology.c
@@ -2721,14 +2721,12 @@ static int skl_tplg_get_manifest_tkn(struct device *dev,
 
 			tkn_count = tkn_count + ret;
 			tkn_elem++;
-			tuple_size += tkn_count *
-				sizeof(struct snd_soc_tplg_vendor_value_elem);
-			break;
 		}
+		tuple_size += (tkn_count * sizeof(*tkn_elem));
 		tkn_count = 0;
 	}
 
-	return 0;
+	return off;
 }
 
 /*
@@ -2751,11 +2749,10 @@ static int skl_tplg_get_manifest_data(struct snd_soc_tplg_manifest *manifest,
 	num_blocks = ret;
 
 	off += array->size;
-	array = (struct snd_soc_tplg_vendor_array *)
-			(manifest->priv.data + off);
-
 	/* Read the BLOCK_TYPE and BLOCK_SIZE descriptor */
 	while (num_blocks > 0) {
+		array = (struct snd_soc_tplg_vendor_array *)
+				(manifest->priv.data + off);
 		ret = skl_tplg_get_desc_blocks(dev, array);
 
 		if (ret < 0)
@@ -2789,6 +2786,7 @@ static int skl_tplg_get_manifest_data(struct snd_soc_tplg_manifest *manifest,
 		} else {
 			return -EINVAL;
 		}
+		off += ret;
 	}
 
 	return 0;
-- 
2.14.1

  reply	other threads:[~2017-08-21  8:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-21  8:46 [PATCH 0/7] ASoC: Intel: Introduce tokens for CNL Guneshwor Singh
2017-08-21  8:46 ` Guneshwor Singh [this message]
2017-08-27 13:39   ` Applied "ASoC: Intel: Skylake: Parse multiple manifest data blocks" to the asoc tree Mark Brown
2017-08-21  8:46 ` [PATCH 2/7] ASoC: Intel: uapi: Add new tokens for module common data Guneshwor Singh
2017-08-21  8:46 ` [PATCH 3/7] ASoC: Intel: Skylake: Commonize parsing of format tokens Guneshwor Singh
2017-08-27 13:38   ` Applied "ASoC: Intel: Skylake: Commonize parsing of format tokens" to the asoc tree Mark Brown
2017-08-21  8:46 ` [PATCH 4/7] ASoC: Intel: Skylake: Add driver structures to be filled from topology manifest Guneshwor Singh
2017-08-21  8:46 ` [PATCH 5/7] ASoC: Intel: Skylake: Populate module data " Guneshwor Singh
2017-08-21  8:46 ` [PATCH 6/7] ASoC: Intel: Skylake: Parse and update module config structure Guneshwor Singh
2017-08-21  8:46 ` [PATCH 7/7] ASoC: Intel: Skylake: Update module id in pin connections Guneshwor Singh
2017-08-27 13:38   ` Applied "ASoC: Intel: Skylake: Update module id in pin connections" to the asoc tree 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=20170821084646.6525-2-guneshwor.o.singh@intel.com \
    --to=guneshwor.o.singh@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=patches.audio@intel.com \
    --cc=shreyas.nc@intel.com \
    --cc=tiwai@suse.de \
    --cc=vinod.koul@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.