alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Naveen M <naveen.m@intel.com>
To: alsa-devel@alsa-project.org
Cc: vinod.koul@intel.com, liam.r.girdwood@linux.intel.com,
	broonie@kernel.org, naveen.m@intel.com,
	"Subhransu S. Prusty" <subhransu.s.prusty@intel.com>,
	pierre-louis.bossart@intel.com
Subject: [PATCH 2/6] ASoC: Move quirk to identify correct machine driver
Date: Mon,  8 May 2017 14:48:56 +0530	[thread overview]
Message-ID: <1494235140-29369-3-git-send-email-naveen.m@intel.com> (raw)
In-Reply-To: <1494235140-29369-1-git-send-email-naveen.m@intel.com>

sst_acpi_mach has a quirk field to handle board specific quirks.
Patch moves quirk call to sst_acpi_find_machine() instead of calling
it in respective driver

Signed-off-by: Naveen M <naveen.m@intel.com>
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
---
 sound/soc/intel/atom/sst/sst_acpi.c     |  2 --
 sound/soc/intel/common/sst-match-acpi.c | 12 +++++++++---
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/sound/soc/intel/atom/sst/sst_acpi.c b/sound/soc/intel/atom/sst/sst_acpi.c
index dd250b8..3e6650e 100644
--- a/sound/soc/intel/atom/sst/sst_acpi.c
+++ b/sound/soc/intel/atom/sst/sst_acpi.c
@@ -303,8 +303,6 @@ static int sst_acpi_probe(struct platform_device *pdev)
 		dev_err(dev, "No matching machine driver found\n");
 		return -ENODEV;
 	}
-	if (mach->machine_quirk)
-		mach = mach->machine_quirk(mach);
 
 	pdata = mach->pdata;
 
diff --git a/sound/soc/intel/common/sst-match-acpi.c b/sound/soc/intel/common/sst-match-acpi.c
index f4af3d1..88e4977 100644
--- a/sound/soc/intel/common/sst-match-acpi.c
+++ b/sound/soc/intel/common/sst-match-acpi.c
@@ -81,9 +81,15 @@ struct sst_acpi_mach *sst_acpi_find_machine(struct sst_acpi_mach *machines)
 {
 	struct sst_acpi_mach *mach;
 
-	for (mach = machines; mach->id[0]; mach++)
-		if (sst_acpi_check_hid(mach->id) == true)
-			return mach;
+	for (mach = machines; mach->id[0]; mach++) {
+		if (sst_acpi_check_hid(mach->id) == true) {
+			if (mach->machine_quirk == NULL)
+				return mach;
+
+			if (mach->machine_quirk(mach) != NULL)
+				return mach;
+		}
+	}
 	return NULL;
 }
 EXPORT_SYMBOL_GPL(sst_acpi_find_machine);
-- 
1.9.1

  parent reply	other threads:[~2017-05-08  9:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-08  9:18 [PATCH 0/6] ASoC: Intel: kabylake: Adds rt5663+max98927 machine driver Naveen M
2017-05-08  9:18 ` [PATCH 1/6] ASoC: Intel: Create a helper to search for matching machine Naveen M
2017-05-24 17:41   ` Applied "ASoC: Intel: Create a helper to search for matching machine" to the asoc tree Mark Brown
2017-05-08  9:18 ` Naveen M [this message]
2017-05-24 17:41   ` Applied "ASoC: Move quirk to identify correct machine driver" " Mark Brown
2017-05-08  9:18 ` [PATCH 3/6] ASoC: Add quirk data to support multiple codecs Naveen M
2017-05-09  6:17   ` Takashi Iwai
2017-05-09 10:26     ` Vinod Koul
2017-05-08  9:18 ` [PATCH 4/6] ASoC: Improve machine driver selection based on quirk data Naveen M
2017-05-08  9:18 ` [PATCH 5/6] ASoC: Intel: Add Kabylake Realtek Maxim machine driver Naveen M
2017-05-24 17:41   ` Applied "ASoC: Intel: Add Kabylake Realtek Maxim machine driver" to the asoc tree Mark Brown
2017-05-08  9:19 ` [PATCH 6/6] ASoC: Intel: Add Kabylake RT5663+MAX98927 machine driver entry Naveen M

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=1494235140-29369-3-git-send-email-naveen.m@intel.com \
    --to=naveen.m@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=pierre-louis.bossart@intel.com \
    --cc=subhransu.s.prusty@intel.com \
    --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 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).