alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Add audio support for Microsoft Surface 3 tablet
@ 2016-07-04  4:56 Stephen Just
  2016-07-04  5:06 ` [PATCH 1/3] ASoC: rt5645: Add support for " Stephen Just
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Stephen Just @ 2016-07-04  4:56 UTC (permalink / raw)
  To: patch; +Cc: alsa-devel, Mark Brown, Stephen Just

This series adds audio support for the Surface 3 tablet.

This tablet identifes an rt5645 audio codec using the ACPI
identifer 10EC5640, which is already associated with the rt5640,
thus a quirk is required to have the correct drivers loaded.

Additionally, in order for jack-detection and the tablet's internal
microphone to work, the Surface 3 must be configured in the audio codec
driver similarly to other devices.

Resolves: https://bugzilla.kernel.org/show_bug.cgi?id=98001

UCM configuration to be added to alsa-lib is included in patch 3,
not included in the diffstat below.

Stephen Just (2):
  ASoC: rt5645: Add support for Surface 3 tablet
  ASoC: Intel: Atom: add quirk for CHT w/ RT5645

 sound/soc/codecs/rt5645.c               |  7 +++++++
 sound/soc/intel/atom/sst/sst_acpi.c     | 28 +++++++++++++++++++++++++++-
 sound/soc/intel/boards/cht_bsw_rt5645.c |  1 +
 3 files changed, 35 insertions(+), 1 deletion(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/3] ASoC: rt5645: Add support for Surface 3 tablet
  2016-07-04  4:56 [PATCH 0/3] Add audio support for Microsoft Surface 3 tablet Stephen Just
@ 2016-07-04  5:06 ` Stephen Just
  2016-07-08 12:31   ` Applied "ASoC: rt5645: Add ACPI ID 10EC5640" to the asoc tree Mark Brown
  2016-07-04  5:06 ` [PATCH 2/3] ASoC: Intel: Atom: add quirk for CHT w/ RT5645 Stephen Just
       [not found] ` <20160704050607.32213-4-stephenjust@gmail.com>
  2 siblings, 1 reply; 5+ messages in thread
From: Stephen Just @ 2016-07-04  5:06 UTC (permalink / raw)
  To: patch; +Cc: Vinod Koul, alsa-devel, Mark Brown, Stephen Just

* Add a dmi match for Surface 3
* Add ACPI match "10EC5640"

The Surface 3 tablet identifies the codec in ACPI as
10EC5640, but other devices use this identifier to match
the rt5640 codec. However, the probe code for each driver
will filter out mismatches.

Cc: Mark Brown <broonie@kernel.org>
Cc: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Stephen Just <stephenjust@gmail.com>
---
 sound/soc/codecs/rt5645.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c
index 3c6594d..761ca88 100644
--- a/sound/soc/codecs/rt5645.c
+++ b/sound/soc/codecs/rt5645.c
@@ -3531,6 +3531,7 @@ MODULE_DEVICE_TABLE(i2c, rt5645_i2c_id);
 static const struct acpi_device_id rt5645_acpi_match[] = {
 	{ "10EC5645", 0 },
 	{ "10EC5650", 0 },
+	{ "10EC5640", 0 },
 	{},
 };
 MODULE_DEVICE_TABLE(acpi, rt5645_acpi_match);
@@ -3561,6 +3562,12 @@ static const struct dmi_system_id dmi_platform_intel_braswell[] = {
 			DMI_MATCH(DMI_PRODUCT_NAME, "Setzer"),
 		},
 	},
+	{
+		.ident = "Microsoft Surface 3",
+		.matches = {
+			DMI_MATCH(DMI_PRODUCT_NAME, "Surface 3"),
+		},
+	},
 	{ }
 };
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/3] ASoC: Intel: Atom: add quirk for CHT w/ RT5645
  2016-07-04  4:56 [PATCH 0/3] Add audio support for Microsoft Surface 3 tablet Stephen Just
  2016-07-04  5:06 ` [PATCH 1/3] ASoC: rt5645: Add support for " Stephen Just
@ 2016-07-04  5:06 ` Stephen Just
       [not found] ` <20160704050607.32213-4-stephenjust@gmail.com>
  2 siblings, 0 replies; 5+ messages in thread
From: Stephen Just @ 2016-07-04  5:06 UTC (permalink / raw)
  To: patch
  Cc: Vinod Koul, alsa-devel, Mark Brown, Pierre-Louis Bossart,
	Stephen Just

The Surface 3 uses an RT5645 audio codec, but the ACPI
identifier used is that for the RT5640. Use a DMI match
to override the driver_data provided by ACPI to workaround
ID conflict.

Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Stephen Just <stephenjust@gmail.com>
---
 sound/soc/intel/atom/sst/sst_acpi.c     | 29 ++++++++++++++++++++++++++++-
 sound/soc/intel/boards/cht_bsw_rt5645.c |  1 +
 2 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/sound/soc/intel/atom/sst/sst_acpi.c b/sound/soc/intel/atom/sst/sst_acpi.c
index 3bc4b63..ef40608 100644
--- a/sound/soc/intel/atom/sst/sst_acpi.c
+++ b/sound/soc/intel/atom/sst/sst_acpi.c
@@ -19,6 +19,7 @@
  */
 
 #include <linux/module.h>
+#include <linux/dmi.h>
 #include <linux/fs.h>
 #include <linux/interrupt.h>
 #include <linux/slab.h>
@@ -131,6 +132,8 @@ static struct sst_platform_info chv_platform_data = {
 	.platform = "sst-mfld-platform",
 };
 
+static const struct dmi_system_id dmi_platform_quirk_table[];
+
 static int sst_platform_get_resources(struct intel_sst_drv *ctx)
 {
 	struct resource *rsrc;
@@ -224,6 +227,7 @@ static int sst_acpi_probe(struct platform_device *pdev)
 	struct platform_device *mdev;
 	struct platform_device *plat_dev;
 	struct sst_platform_info *pdata;
+	const struct dmi_system_id *dmi_match;
 	unsigned int dev_id;
 
 	id = acpi_match_device(dev->driver->acpi_match_table, dev);
@@ -231,7 +235,13 @@ static int sst_acpi_probe(struct platform_device *pdev)
 		return -ENODEV;
 	dev_dbg(dev, "for %s", id->id);
 
-	mach = (struct sst_acpi_mach *)id->driver_data;
+	/* check for quirk when getting driver_data */
+	dmi_match = dmi_first_match(dmi_platform_quirk_table);
+	if (dmi_match)
+		mach = (struct sst_acpi_mach *)dmi_match->driver_data;
+	else
+		mach = (struct sst_acpi_mach *)id->driver_data;
+
 	mach = sst_acpi_find_machine(mach);
 	if (mach == NULL) {
 		dev_err(dev, "No matching machine driver found\n");
@@ -345,7 +355,24 @@ static struct sst_acpi_mach sst_acpi_chv[] = {
 	/* some CHT-T platforms rely on RT5640, use Baytrail machine driver */
 	{"10EC5640", "bytcr_rt5640", "intel/fw_sst_22a8.bin", "bytcr_rt5640", NULL,
 						&chv_platform_data },
+	{},
+};
 
+static struct sst_acpi_mach sst_acpi_chv_quirk[] = {
+	/* some CHT-T platforms rely on RT5645 but use the ID from RT5640 */
+	{"10EC5640", "cht-bsw-rt5645", "intel/fw_sst_22a8.bin", "cht-bsw", NULL,
+						&chv_platform_data },
+	{},
+};
+
+static const struct dmi_system_id dmi_platform_quirk_table[] = {
+	{
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Surface 3"),
+		},
+		.driver_data = (unsigned long *) &sst_acpi_chv_quirk,
+	},
 	{},
 };
 
diff --git a/sound/soc/intel/boards/cht_bsw_rt5645.c b/sound/soc/intel/boards/cht_bsw_rt5645.c
index d7ef292..bf99efb 100644
--- a/sound/soc/intel/boards/cht_bsw_rt5645.c
+++ b/sound/soc/intel/boards/cht_bsw_rt5645.c
@@ -340,6 +340,7 @@ static struct snd_soc_card snd_soc_card_chtrt5650 = {
 };
 
 static struct cht_acpi_card snd_soc_cards[] = {
+	{"10EC5640", CODEC_TYPE_RT5645, &snd_soc_card_chtrt5645},
 	{"10EC5645", CODEC_TYPE_RT5645, &snd_soc_card_chtrt5645},
 	{"10EC5650", CODEC_TYPE_RT5650, &snd_soc_card_chtrt5650},
 };
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 3/3] [alsa-lib] conf/ucm: chtrt5645: Add UCM config for chtrt5645
       [not found] ` <20160704050607.32213-4-stephenjust@gmail.com>
@ 2016-07-04  8:58   ` Mark Brown
  0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2016-07-04  8:58 UTC (permalink / raw)
  To: Stephen Just; +Cc: alsa-devel, patch


[-- Attachment #1.1: Type: text/plain, Size: 295 bytes --]

On Sun, Jul 03, 2016 at 11:06:07PM -0600, Stephen Just wrote:
> Add a UCM configuration for the rt5645 codec on Intel's Cherry-Trail
> platform. Tested on the Microsoft Surface 3.

This is not a kernel patch, it should be sent separately and sent to the
alsa-lib maintainers (at least Taksahi).

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Applied "ASoC: rt5645: Add ACPI ID 10EC5640" to the asoc tree
  2016-07-04  5:06 ` [PATCH 1/3] ASoC: rt5645: Add support for " Stephen Just
@ 2016-07-08 12:31   ` Mark Brown
  0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2016-07-08 12:31 UTC (permalink / raw)
  To: Vinod Koul; +Cc: Sachin Mokashi, alsa-devel, Mark Brown, patch, Stephen Just

The patch

   ASoC: rt5645: Add ACPI ID 10EC5640

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 79c89031e0b6de9e3dc2318b211f1872c99753f7 Mon Sep 17 00:00:00 2001
From: Vinod Koul <vinod.koul@intel.com>
Date: Fri, 8 Jul 2016 15:39:50 +0530
Subject: [PATCH] ASoC: rt5645: Add ACPI ID 10EC5640

Some CHT platforms use RT5645 codec which has entry 10EC5640 so add it.
Also add DMI quirk for jack detection.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=98001
[Jack detection]
Suggested-by: Stephen Just <stephenjust@gmail.com>
Signed-off-by: Sachin Mokashi <sachinx.mokashi@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/codecs/rt5645.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c
index dbf05600b5ff..e5556a19c995 100644
--- a/sound/soc/codecs/rt5645.c
+++ b/sound/soc/codecs/rt5645.c
@@ -3543,6 +3543,7 @@ MODULE_DEVICE_TABLE(i2c, rt5645_i2c_id);
 static const struct acpi_device_id rt5645_acpi_match[] = {
 	{ "10EC5645", 0 },
 	{ "10EC5650", 0 },
+	{ "10EC5640", 0 },
 	{},
 };
 MODULE_DEVICE_TABLE(acpi, rt5645_acpi_match);
@@ -3573,6 +3574,12 @@ static const struct dmi_system_id dmi_platform_intel_braswell[] = {
 			DMI_MATCH(DMI_PRODUCT_NAME, "Setzer"),
 		},
 	},
+	{
+		.ident = "Microsoft Surface 3",
+		.matches = {
+			DMI_MATCH(DMI_PRODUCT_NAME, "Surface 3"),
+		},
+	},
 	{ }
 };
 
-- 
2.8.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-07-08 12:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-04  4:56 [PATCH 0/3] Add audio support for Microsoft Surface 3 tablet Stephen Just
2016-07-04  5:06 ` [PATCH 1/3] ASoC: rt5645: Add support for " Stephen Just
2016-07-08 12:31   ` Applied "ASoC: rt5645: Add ACPI ID 10EC5640" to the asoc tree Mark Brown
2016-07-04  5:06 ` [PATCH 2/3] ASoC: Intel: Atom: add quirk for CHT w/ RT5645 Stephen Just
     [not found] ` <20160704050607.32213-4-stephenjust@gmail.com>
2016-07-04  8:58   ` [PATCH 3/3] [alsa-lib] conf/ucm: chtrt5645: Add UCM config for chtrt5645 Mark Brown

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).