All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: alsa-devel@alsa-project.org
Cc: tiwai@suse.de,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	liam.r.girdwood@linux.intel.com, vinod.koul@intel.com,
	broonie@kernel.org, andriy.shevchenko@linux.intel.com
Subject: [PATCH 7/7] ASoC: Intel: common: add quirk for APL RVP boards
Date: Wed, 31 Oct 2018 20:07:18 -0500	[thread overview]
Message-ID: <20181101010718.2878-8-pierre-louis.bossart@linux.intel.com> (raw)
In-Reply-To: <20181101010718.2878-1-pierre-louis.bossart@linux.intel.com>

For some reason the RVP/LeafHill SSDT exposes an INT34C3 ID which is
used on other boards to point to the TDF8532 amplifier. Yay BIOS.

Add a DMI-quirk to ignore this ID and check for other valid machine
driver descriptors.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 .../intel/common/soc-acpi-intel-bxt-match.c   | 35 +++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/sound/soc/intel/common/soc-acpi-intel-bxt-match.c b/sound/soc/intel/common/soc-acpi-intel-bxt-match.c
index 2756fa4ab552..752a1bbff7f7 100644
--- a/sound/soc/intel/common/soc-acpi-intel-bxt-match.c
+++ b/sound/soc/intel/common/soc-acpi-intel-bxt-match.c
@@ -6,9 +6,43 @@
  *
  */
 
+#include <linux/dmi.h>
 #include <sound/soc-acpi.h>
 #include <sound/soc-acpi-intel-match.h>
 
+static unsigned long apl_machine_id;
+
+#define APL_RVP  1
+
+static int apl_rvp_quirk_cb(const struct dmi_system_id *id)
+{
+	apl_machine_id = APL_RVP;
+	return 1;
+}
+
+static const struct dmi_system_id apl_table[] = {
+	{
+		.callback = apl_rvp_quirk_cb,
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Intel Corp."),
+			DMI_MATCH(DMI_BOARD_NAME, "Apollolake RVP1A"),
+		},
+	},
+	{},
+};
+
+static struct snd_soc_acpi_mach *apl_quirk(void *arg)
+{
+	struct snd_soc_acpi_mach *mach = arg;
+
+	dmi_check_system(apl_table);
+
+	if (apl_machine_id == APL_RVP)
+		return NULL;
+	else
+		return mach;
+}
+
 static struct snd_soc_acpi_codecs bxt_codecs = {
 	.num_codecs = 1,
 	.codecs = {"MX98357A"}
@@ -50,6 +84,7 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_bxt_machines[] = {
 	{
 		.id = "INT34C3",
 		.drv_name = "bxt_tdf8532",
+		.machine_quirk = apl_quirk,
 		.sof_fw_filename = "intel/sof-apl.ri",
 		.sof_tplg_filename = "intel/sof-apl-tdf8532.tplg",
 		.asoc_plat_name = "0000:00:0e.0",
-- 
2.17.1

  parent reply	other threads:[~2018-11-01  1:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-01  1:07 [PATCH 0/7] ASoC: Intel: cleanups Pierre-Louis Bossart
2018-11-01  1:07 ` [PATCH 1/7] ASoC: acpi: define common interface for machine driver configuration Pierre-Louis Bossart
2018-11-01  1:07 ` [PATCH 2/7] ASoC: Intel: use standard interface for Hdaudio machine driver Pierre-Louis Bossart
2018-11-01  1:07 ` [PATCH 3/7] ASoC: Intel: use standard interface for Atom machine drivers Pierre-Louis Bossart
2018-11-01  1:07 ` [PATCH 4/7] ASoC: Intel: boards: fix Skylake typo Pierre-Louis Bossart
2018-11-01  1:07 ` [PATCH 5/7] ASoC: Intel: remove GFP_ATOMIC, use GFP_KERNEL Pierre-Louis Bossart
2018-11-01  1:07 ` [PATCH 6/7] ASoC: Intel: common: add SOF information for APL RVP Pierre-Louis Bossart
2018-11-01  1:07 ` Pierre-Louis Bossart [this message]
2018-11-01  2:35   ` [PATCH 7/7] ASoC: Intel: common: add quirk for APL RVP boards Keyon Jie
2018-11-01 14:11   ` Andy Shevchenko
2018-11-01 15:08     ` Pierre-Louis Bossart
2018-11-01 14:12 ` [PATCH 0/7] ASoC: Intel: cleanups Andy Shevchenko

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=20181101010718.2878-8-pierre-louis.bossart@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=broonie@kernel.org \
    --cc=liam.r.girdwood@linux.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.