All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kai Vehmanen <kai.vehmanen@linux.intel.com>
To: alsa-devel@alsa-project.org, broonie@kernel.org
Cc: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>,
	kai.vehmanen@linux.intel.com,
	pierre-louis.bossart@linux.intel.com,
	ranjani.sridharan@linux.intel.com, daniel.baluta@nxp.com,
	randerwang <rander.wang@linux.intel.com>
Subject: [PATCH 5/8] ASoC: SOF: Intel: sdw: relax sdw machine select constraints
Date: Fri, 15 May 2020 16:59:55 +0300	[thread overview]
Message-ID: <20200515135958.17511-6-kai.vehmanen@linux.intel.com> (raw)
In-Reply-To: <20200515135958.17511-1-kai.vehmanen@linux.intel.com>

From: randerwang <rander.wang@linux.intel.com>

On some platforms such as Up Extreme all links are enabled but only one
link can be used by external codec. Instead of exact match of two masks,
first check whether link_mask of mach is subset of link_mask supported
by hw and then go on searching link_adr.

Signed-off-by: randerwang <rander.wang@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
---
 sound/soc/sof/intel/hda.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c
index 578ac7b036b0..63ca920c8e6e 100644
--- a/sound/soc/sof/intel/hda.c
+++ b/sound/soc/sof/intel/hda.c
@@ -1107,7 +1107,15 @@ static int hda_sdw_machine_select(struct snd_sof_dev *sdev)
 	if (link_mask && !pdata->machine) {
 		for (mach = pdata->desc->alt_machines;
 		     mach && mach->link_mask; mach++) {
-			if (mach->link_mask != link_mask)
+			/*
+			 * On some platforms such as Up Extreme all links
+			 * are enabled but only one link can be used by
+			 * external codec. Instead of exact match of two masks,
+			 * first check whether link_mask of mach is subset of
+			 * link_mask supported by hw and then go on searching
+			 * link_adr
+			 */
+			if (~link_mask & mach->link_mask)
 				continue;
 
 			/* No need to match adr if there is no links defined */
-- 
2.26.0


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

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-15 13:59 [PATCH 0/8] ASoC: SOF: Intel and IMX updates for 5.8 Kai Vehmanen
2020-05-15 13:59 ` [PATCH 1/8] ASoC: SOF: Do nothing when DSP PM callbacks are not set Kai Vehmanen
2020-05-15 13:59 ` [PATCH 2/8] ASoC: SOF: add a power_down_notify method Kai Vehmanen
2020-05-15 13:59 ` [PATCH 3/8] ASoC: SOF: inform DSP that driver is going to be removed Kai Vehmanen
2020-05-15 13:59 ` [PATCH 4/8] ASoC: SOF: topology: add support to smart amplifier Kai Vehmanen
2020-05-15 13:59 ` Kai Vehmanen [this message]
2020-05-15 13:59 ` [PATCH 6/8] ASoC: SOF: define INFO_ flags in dsp_ops Kai Vehmanen
2020-05-15 13:59 ` [PATCH 7/8] ASoC: SOF: imx: make dsp_ops static Kai Vehmanen
2020-05-15 13:59 ` [PATCH 8/8] ASoC: SOF: imx: make imx8m_dsp_ops static Kai Vehmanen
2020-05-18 16:40 ` [PATCH 0/8] ASoC: SOF: Intel and IMX updates for 5.8 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=20200515135958.17511-6-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=guennadi.liakhovetski@linux.intel.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=rander.wang@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 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.