alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Bard Liao <yung-chuan.liao@linux.intel.com>
Cc: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>,
	alsa-devel@alsa-project.org,
	Kai Vehmanen <kai.vehmanen@linux.intel.com>,
	tiwai@suse.de,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	Ranjani Sridharan <ranjani.sridharan@linux.intel.com>,
	Mark Brown <broonie@kernel.org>
Subject: Applied "ASoC: intel: sof_sdw: init all aggregated codecs" to the asoc tree
Date: Tue, 14 Apr 2020 15:47:59 +0100	[thread overview]
Message-ID: <applied-20200409185827.16255-7-pierre-louis.bossart@linux.intel.com> (raw)
In-Reply-To: <20200409185827.16255-7-pierre-louis.bossart@linux.intel.com>

The patch

   ASoC: intel: sof_sdw: init all aggregated codecs

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From 5930d02c2d533aa9cbc2b55ad27b41802858da16 Mon Sep 17 00:00:00 2001
From: Bard Liao <yung-chuan.liao@linux.intel.com>
Date: Thu, 9 Apr 2020 13:58:20 -0500
Subject: [PATCH] ASoC: intel: sof_sdw: init all aggregated codecs

Init codecs which belong to the same group id on all links.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200409185827.16255-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/intel/boards/sof_sdw.c | 41 ++++++++++++++++++++------------
 1 file changed, 26 insertions(+), 15 deletions(-)

diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c
index a64dc563b47e..6a1b51c0546b 100644
--- a/sound/soc/intel/boards/sof_sdw.c
+++ b/sound/soc/intel/boards/sof_sdw.c
@@ -411,25 +411,36 @@ static int create_codec_dai_name(struct device *dev,
 
 static int set_codec_init_func(const struct snd_soc_acpi_link_adr *link,
 			       struct snd_soc_dai_link *dai_links,
-			       bool playback)
+			       bool playback, int group_id)
 {
 	int i;
 
-	for (i = 0; i < link->num_adr; i++) {
-		unsigned int part_id;
-		int codec_index;
-
-		part_id = SDW_PART_ID(link->adr_d[i].adr);
-		codec_index = find_codec_info_part(part_id);
+	do {
+		/*
+		 * Initialize the codec. If codec is part of an aggregated
+		 * group (group_id>0), initialize all codecs belonging to
+		 * same group.
+		 */
+		for (i = 0; i < link->num_adr; i++) {
+			unsigned int part_id;
+			int codec_index;
 
-		if (codec_index < 0)
-			return codec_index;
+			part_id = SDW_PART_ID(link->adr_d[i].adr);
+			codec_index = find_codec_info_part(part_id);
 
-		if (codec_info_list[codec_index].init)
-			codec_info_list[codec_index].init(link, dai_links,
-						 &codec_info_list[codec_index],
-						 playback);
-	}
+			if (codec_index < 0)
+				return codec_index;
+			/* The group_id is > 0 iff the codec is aggregated */
+			if (link->adr_d[i].endpoints->group_id != group_id)
+				continue;
+			if (codec_info_list[codec_index].init)
+				codec_info_list[codec_index].init(link,
+						dai_links,
+						&codec_info_list[codec_index],
+						playback);
+		}
+		link++;
+	} while (link->mask && group_id);
 
 	return 0;
 }
@@ -623,7 +634,7 @@ static int create_sdw_dailink(struct device *dev, int *be_index,
 			      NULL, &sdw_ops);
 
 		ret = set_codec_init_func(link, dai_links + (*be_index)++,
-					  playback);
+					  playback, group_id);
 		if (ret < 0) {
 			dev_err(dev, "failed to init codec %d", codec_index);
 			return ret;
-- 
2.20.1


  reply	other threads:[~2020-04-14 15:08 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-09 18:58 [PATCH 00/13] ASoC: Intel: machine drivers update for 5.8 Pierre-Louis Bossart
2020-04-09 18:58 ` [PATCH 01/13] ASoC: Intel: sof_da7219_max98373: Add BE dailink for dmic16k Pierre-Louis Bossart
2020-04-14 14:48   ` Applied "ASoC: Intel: sof_da7219_max98373: Add BE dailink for dmic16k" to the asoc tree Mark Brown
2020-04-09 18:58 ` [PATCH 02/13] ASoC: intel/skl/hda - set autosuspend timeout for hda codecs Pierre-Louis Bossart
2020-04-14 14:48   ` Applied "ASoC: intel/skl/hda - set autosuspend timeout for hda codecs" to the asoc tree Mark Brown
2020-04-09 18:58 ` [PATCH 03/13] ALSA: hda: Add ElkhartLake HDMI codec vid Pierre-Louis Bossart
2020-04-11 10:29   ` Takashi Iwai
2020-04-14 16:09     ` Kai Vehmanen
2020-04-14 16:32       ` Takashi Iwai
2020-04-14 16:36       ` Pierre-Louis Bossart
2020-04-14 14:48   ` Applied "ALSA: hda: Add ElkhartLake HDMI codec vid" to the asoc tree Mark Brown
2020-04-09 18:58 ` [PATCH 04/13] ASoC: SOF: Intel: add PCI ID for ElkhartLake Pierre-Louis Bossart
2020-04-14 14:48   ` Applied "ASoC: SOF: Intel: add PCI ID for ElkhartLake" to the asoc tree Mark Brown
2020-04-09 18:58 ` [PATCH 05/13] ASoC: Intel: boards: support Elkhart Lake with rt5660 Pierre-Louis Bossart
2020-04-14 14:48   ` Applied "ASoC: Intel: boards: support Elkhart Lake with rt5660" to the asoc tree Mark Brown
2020-04-09 18:58 ` [PATCH 06/13] ASoC: intel: sof_sdw: init all aggregated codecs Pierre-Louis Bossart
2020-04-14 14:47   ` Mark Brown [this message]
2020-04-09 18:58 ` [PATCH 07/13] ASoC: Intel: sof-da7219-max98373: add DMIC widget and route Pierre-Louis Bossart
2020-04-14 14:47   ` Applied "ASoC: Intel: sof-da7219-max98373: add DMIC widget and route" to the asoc tree Mark Brown
2020-04-09 18:58 ` [PATCH 08/13] ASoC: Intel: sof_sdw_hdmi: fix compilation issue in fallback mode Pierre-Louis Bossart
2020-04-14 14:47   ` Applied "ASoC: Intel: sof_sdw_hdmi: fix compilation issue in fallback mode" to the asoc tree Mark Brown
2020-04-09 18:58 ` [PATCH 09/13] ASoC: Intel: sof_sdw_hdmi: remove codec_dai use Pierre-Louis Bossart
2020-04-14 14:47   ` Applied "ASoC: Intel: sof_sdw_hdmi: remove codec_dai use" to the asoc tree Mark Brown
2020-04-09 18:58 ` [PATCH 10/13] ASoC: Intel: sof_sdw_rt1308: remove codec dai use Pierre-Louis Bossart
2020-04-14 14:47   ` Applied "ASoC: Intel: sof_sdw_rt1308: remove codec dai use" to the asoc tree Mark Brown
2020-04-09 18:58 ` [PATCH 11/13] ASoC: Intel: sof_sdw_rt5682: remove codec_dai use Pierre-Louis Bossart
2020-04-14 14:47   ` Applied "ASoC: Intel: sof_sdw_rt5682: remove codec_dai use" to the asoc tree Mark Brown
2020-04-09 18:58 ` [PATCH 12/13] ASoC: Intel: sof_sdw_rt700: remove codec_dai use Pierre-Louis Bossart
2020-04-14 14:47   ` Applied "ASoC: Intel: sof_sdw_rt700: remove codec_dai use" to the asoc tree Mark Brown
2020-04-09 18:58 ` [PATCH 13/13] ASoC: Intel: sof_sdw_rt711: remove codec_dai use Pierre-Louis Bossart
2020-04-14 14:47   ` Applied "ASoC: Intel: sof_sdw_rt711: remove codec_dai use" 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=applied-20200409185827.16255-7-pierre-louis.bossart@linux.intel.com \
    --to=broonie@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=guennadi.liakhovetski@linux.intel.com \
    --cc=kai.vehmanen@linux.intel.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=ranjani.sridharan@linux.intel.com \
    --cc=tiwai@suse.de \
    --cc=yung-chuan.liao@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).