All of lore.kernel.org
 help / color / mirror / Atom feed
From: Naveen M <naveen.m@intel.com>
To: alsa-devel@alsa-project.org
Cc: tiwai@suse.de, liam.r.girdwood@linux.intel.com,
	vinod.koul@intel.com, broonie@kernel.org, naveen.m@intel.com,
	"Subhransu S. Prusty" <subhransu.s.prusty@intel.com>,
	pierre-louis.bossart@intel.com
Subject: [PATCH v2 3/6] ASoC: Move quirk to identify correct machine driver
Date: Thu, 11 May 2017 18:02:21 +0530	[thread overview]
Message-ID: <1494505944-31378-4-git-send-email-naveen.m@intel.com> (raw)
In-Reply-To: <1494505944-31378-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 193c4d7..592f6af 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-11 12:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-11 12:32 [PATCH v2 0/6] ASoC: Intel: kabylake: Adds rt5663+max98927 machine driver Naveen M
2017-05-11 12:32 ` [PATCH v2 1/6] ASoC: Intel: Convert all machine data to C99 style Naveen M
2017-05-15  5:20   ` Vinod Koul
2017-05-15  5:37     ` [alsa-devel] " Naveen M
2017-05-15  5:37     ` Naveen M
2017-05-11 12:32 ` [PATCH v2 2/6] ASoC: Intel: Create a helper to search for matching machine Naveen M
2017-05-11 12:32 ` Naveen M [this message]
2017-05-11 12:32 ` [PATCH v2 4/6] ASoC: Improve machine driver selection based on quirk data Naveen M
2017-05-24 17:41   ` Applied "ASoC: Improve machine driver selection based on quirk data" to the asoc tree Mark Brown
2017-05-11 12:32 ` [PATCH v2 5/6] ASoC: Intel: Add Kabylake Realtek Maxim machine driver Naveen M
2017-05-11 12:32 ` [PATCH v2 6/6] ASoC: Intel: Add Kabylake RT5663+MAX98927 machine driver entry Naveen M
2017-05-24 17:41   ` Applied "ASoC: Intel: Add Kabylake RT5663+MAX98927 machine driver entry" 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=1494505944-31378-4-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=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.