alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Vinod Koul <vinod.koul@intel.com>
To: alsa-devel@alsa-project.org
Cc: liam.r.girdwood@linux.intel.com, patches.audio@intel.com,
	broonie@kernel.org, Vinod Koul <vinod.koul@intel.com>,
	Jeeja KP <jeeja.kp@intel.com>
Subject: [PATCH 3/7] ASoC: Intel: Skylake: Fix to update bit depth for module params
Date: Mon, 23 Nov 2015 22:26:25 +0530	[thread overview]
Message-ID: <1448297789-6524-4-git-send-email-vinod.koul@intel.com> (raw)
In-Reply-To: <1448297789-6524-1-git-send-email-vinod.koul@intel.com>

From: Jeeja KP <jeeja.kp@intel.com>

Module hw param fixup will change the valid bit depth based
on the fixup flag. If valid bit depth changes, need to set
the bit depth according to valid bit depth. This patch
fixes this issue of updating bit depth correctly.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
 sound/soc/intel/skylake/skl-topology.c | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c
index 0937ea2129c1..698c4aa03933 100644
--- a/sound/soc/intel/skylake/skl-topology.c
+++ b/sound/soc/intel/skylake/skl-topology.c
@@ -147,8 +147,24 @@ static void skl_tplg_update_params(struct skl_module_fmt *fmt,
 		fmt->s_freq = params->s_freq;
 	if (fixup & SKL_CH_FIXUP_MASK)
 		fmt->channels = params->ch;
-	if (fixup & SKL_FMT_FIXUP_MASK)
-		fmt->valid_bit_depth = params->s_fmt;
+	if (fixup & SKL_FMT_FIXUP_MASK) {
+		fmt->valid_bit_depth = skl_get_bit_depth(params->s_fmt);
+
+		/*
+		 * 16 bit is 16 bit container whereas 24 bit is in 32 bit
+		 * container so update bit depth accordingly
+		 */
+		switch (fmt->valid_bit_depth) {
+		case SKL_DEPTH_16BIT:
+			fmt->bit_depth = fmt->valid_bit_depth;
+			break;
+
+		default:
+			fmt->bit_depth = SKL_DEPTH_32BIT;
+			break;
+		}
+	}
+
 }
 
 /*
-- 
1.9.1

  parent reply	other threads:[~2015-11-23 16:52 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-23 16:56 [PATCH 0/7] ASoC: Intel: Skylake: Fix suspend issues Vinod Koul
2015-11-23 16:56 ` [PATCH 1/7] ASoC: Intel: Skylake: Add Resume capability in PCM info Vinod Koul
2015-11-23 18:45   ` Takashi Iwai
2015-11-24  2:44     ` Vinod Koul
2015-11-24  6:07       ` Takashi Iwai
2015-11-26  8:56         ` Vinod Koul
2015-11-26  9:06           ` Takashi Iwai
2016-01-10 12:22   ` Applied "ASoC: Intel: Skylake: Add Resume capability in PCM info." to the asoc tree Mark Brown
2015-11-23 16:56 ` [PATCH 2/7] ASoC: Intel: Skylake: Reconfigure HDA stream register in prepare/resume Vinod Koul
2015-11-25 17:57   ` Applied "ASoC: Intel: Skylake: Reconfigure HDA stream register in prepare/resume" to the asoc tree Mark Brown
2015-11-23 16:56 ` Vinod Koul [this message]
2015-11-25 17:57   ` Applied "ASoC: Intel: Skylake: Fix to update bit depth for module params" " Mark Brown
2015-11-23 16:56 ` [PATCH 4/7] ASoC: Intel: Skylake: Update pcm capability Vinod Koul
2015-11-25 17:57   ` Applied "ASoC: Intel: Skylake: Update pcm capability" to the asoc tree Mark Brown
2015-11-23 16:56 ` [PATCH 5/7] ASoC: Intel: Skylake: Poll CLDMA RUN bit when set Vinod Koul
2015-11-25 17:57   ` Applied "ASoC: Intel: Skylake: Poll CLDMA RUN bit when set" to the asoc tree Mark Brown
2015-11-23 16:56 ` [PATCH 6/7] ASoC: Intel: Skylake: Clear stream registers before setting up stream Vinod Koul
2015-11-23 16:56 ` [PATCH 7/7] ASoC: Intel: Skylake: Move up pipe mem free Vinod Koul
2015-11-25 17:57   ` Applied "ASoC: Intel: Skylake: Move up pipe mem free" 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=1448297789-6524-4-git-send-email-vinod.koul@intel.com \
    --to=vinod.koul@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=jeeja.kp@intel.com \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=patches.audio@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).