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, broonie@kernel.org,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Subject: [PATCH 07/17] ASoC: Intel: Baytrail: add quirk for Lenovo Thinkpad 10
Date: Thu, 26 Jan 2017 14:09:35 -0600	[thread overview]
Message-ID: <1485461385-14544-8-git-send-email-pierre-louis.bossart@linux.intel.com> (raw)
In-Reply-To: <1485461385-14544-1-git-send-email-pierre-louis.bossart@linux.intel.com>

the BIOS reports this codec as RT5640 but it's a rt5670. Use the
quirk mechanism to use the cht_bsw_rt5672 machine driver

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/intel/atom/sst/sst_acpi.c | 37 ++++++++++++++++++++++++++++++++++++-
 1 file changed, 36 insertions(+), 1 deletion(-)

diff --git a/sound/soc/intel/atom/sst/sst_acpi.c b/sound/soc/intel/atom/sst/sst_acpi.c
index 0699ce5..4cf95e7 100644
--- a/sound/soc/intel/atom/sst/sst_acpi.c
+++ b/sound/soc/intel/atom/sst/sst_acpi.c
@@ -400,6 +400,7 @@ static int sst_acpi_remove(struct platform_device *pdev)
 static unsigned long cht_machine_id;
 
 #define CHT_SURFACE_MACH 1
+#define BYT_THINKPAD_10  2
 
 static int cht_surface_quirk_cb(const struct dmi_system_id *id)
 {
@@ -407,6 +408,23 @@ static int cht_surface_quirk_cb(const struct dmi_system_id *id)
 	return 1;
 }
 
+static int byt_thinkpad10_quirk_cb(const struct dmi_system_id *id)
+{
+	cht_machine_id = BYT_THINKPAD_10;
+	return 1;
+}
+
+
+static const struct dmi_system_id byt_table[] = {
+	{
+		.callback = byt_thinkpad10_quirk_cb,
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "20C3001VHH"),
+		},
+	},
+	{ }
+};
 
 static const struct dmi_system_id cht_table[] = {
 	{
@@ -424,6 +442,10 @@ static struct sst_acpi_mach cht_surface_mach = {
 	"10EC5640", "cht-bsw-rt5645", "intel/fw_sst_22a8.bin", "cht-bsw", NULL,
 								&chv_platform_data };
 
+static struct sst_acpi_mach byt_thinkpad_10 = {
+	"10EC5640", "cht-bsw-rt5672", "intel/fw_sst_0f28.bin", "cht-bsw", NULL,
+	                                                        &byt_rvp_platform_data };
+
 static struct sst_acpi_mach *cht_quirk(void *arg)
 {
 	struct sst_acpi_mach *mach = arg;
@@ -436,8 +458,21 @@ static struct sst_acpi_mach *cht_quirk(void *arg)
 		return mach;
 }
 
+static struct sst_acpi_mach *byt_quirk(void *arg)
+{
+	struct sst_acpi_mach *mach = arg;
+
+	dmi_check_system(byt_table);
+
+	if (cht_machine_id == BYT_THINKPAD_10)
+		return &byt_thinkpad_10;
+	else
+		return mach;
+}
+
+
 static struct sst_acpi_mach sst_acpi_bytcr[] = {
-	{"10EC5640", "bytcr_rt5640", "intel/fw_sst_0f28.bin", "bytcr_rt5640", NULL,
+	{"10EC5640", "bytcr_rt5640", "intel/fw_sst_0f28.bin", "bytcr_rt5640", byt_quirk,
 						&byt_rvp_platform_data },
 	{"10EC5642", "bytcr_rt5640", "intel/fw_sst_0f28.bin", "bytcr_rt5640", NULL,
 						&byt_rvp_platform_data },
-- 
2.7.4

  parent reply	other threads:[~2017-01-26 20:10 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-26 20:09 [PATCH 00/17] Baytrail/Cherrytrail audio fixes Pierre-Louis Bossart
2017-01-26 20:09 ` [PATCH 01/17] ASoC: Intel: atom: fix frame polarity Pierre-Louis Bossart
2017-01-31 20:02   ` Applied "ASoC: Intel: atom: fix frame polarity" to the asoc tree Mark Brown
2017-01-26 20:09 ` [PATCH 02/17] ASoC: Intel: boards: remove .pm_ops in all Atom/DPCM machine drivers Pierre-Louis Bossart
2017-01-31 20:02   ` Applied "ASoC: Intel: boards: remove .pm_ops in all Atom/DPCM machine drivers" to the asoc tree Mark Brown
2017-01-26 20:09 ` [PATCH 03/17] ASoC: rt5640: Add "10EC3276" ACPI ID Pierre-Louis Bossart
2017-01-26 20:09 ` [PATCH 04/17] ASoC: Intel: Atom: Add HP Pavilion x2 10-p000 machine entry Pierre-Louis Bossart
2017-01-26 20:09 ` [PATCH 05/17] ASoC: Intel: add support for Realtek 5651 on Cherrytrail Pierre-Louis Bossart
2017-01-31 21:18   ` Applied "ASoC: Intel: add support for Realtek 5651 on Cherrytrail" to the asoc tree Mark Brown
2017-01-26 20:09 ` [PATCH 06/17] ASoC: codecs: rt5670: add quirk for Lenovo Thinkpad 10 Pierre-Louis Bossart
2017-01-31 21:17   ` Applied "ASoC: codecs: rt5670: add quirk for Lenovo Thinkpad 10" to the asoc tree Mark Brown
2017-01-26 20:09 ` Pierre-Louis Bossart [this message]
2017-01-31 21:17   ` Applied "ASoC: Intel: Baytrail: " Mark Brown
2017-01-26 20:09 ` [PATCH 08/17] ASoC: rt5645: add support for RT5648 Pierre-Louis Bossart
2017-01-31 21:17   ` Applied "ASoC: rt5645: add support for RT5648" to the asoc tree Mark Brown
2017-01-26 20:09 ` [PATCH 09/17] ASoc: rt5645: add ACPI ID 10EC3270 Pierre-Louis Bossart
2017-01-31 21:17   ` Applied "ASoc: rt5645: add ACPI ID 10EC3270" to the asoc tree Mark Brown
2017-01-26 20:09 ` [PATCH 10/17] ASoC: Intel: cht_bsw_rt5645: add Baytrail MCLK support Pierre-Louis Bossart
2017-01-31 21:18   ` Applied "ASoC: Intel: cht_bsw_rt5645: add Baytrail MCLK support" to the asoc tree Mark Brown
2017-01-26 20:09 ` [PATCH 11/17] ASoC: Intel: Atom: add machine driver for baytrail-rt5645 hardware Pierre-Louis Bossart
2017-01-31 21:17   ` Applied "ASoC: Intel: Atom: add machine driver for baytrail-rt5645 hardware" to the asoc tree Mark Brown
2017-01-26 20:09 ` [PATCH 12/17] ASoC: Intel: add support for ALC3270 codec Pierre-Louis Bossart
2017-01-31 21:17   ` Applied "ASoC: Intel: add support for ALC3270 codec" to the asoc tree Mark Brown
2017-01-26 20:09 ` [PATCH 13/17] ASoC: Intel: cht_bsw_rt5645: harden ACPI device detection Pierre-Louis Bossart
2017-01-31 21:17   ` Applied "ASoC: Intel: cht_bsw_rt5645: harden ACPI device detection" to the asoc tree Mark Brown
2017-01-26 20:09 ` [PATCH 14/17] ASoC: rt5645: fix error handling for gpio detection Pierre-Louis Bossart
2017-01-31 20:00   ` Mark Brown
2017-01-31 20:29     ` Pierre-Louis Bossart
2017-01-26 20:09 ` [PATCH 15/17] ASoC: Intel: cht-bsw-rt5645: add quirks for SSP0/AIF1/AIF2 routing Pierre-Louis Bossart
2017-01-31 21:17   ` Applied "ASoC: Intel: cht-bsw-rt5645: add quirks for SSP0/AIF1/AIF2 routing" to the asoc tree Mark Brown
2017-01-26 20:09 ` [PATCH 16/17] ASoC: Intel: cht-bsw-rt5645: select ASRC source based on routing quirk Pierre-Louis Bossart
2017-01-31 21:17   ` Applied "ASoC: Intel: cht-bsw-rt5645: select ASRC source based on routing quirk" to the asoc tree Mark Brown
2017-01-26 20:09 ` [PATCH 17/17] ASoC: Intel: cht-bsw-rt5645: fix DAI formats Pierre-Louis Bossart
2017-01-31 21:17   ` Applied "ASoC: Intel: cht-bsw-rt5645: fix DAI formats" 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=1485461385-14544-8-git-send-email-pierre-louis.bossart@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=tiwai@suse.de \
    /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.