Skip to contentSkip to conversation

ASoC:rt286: set combo jack by dmi

PATCH In review [email protected] 3 participants 3 messages Nov 5, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC:rt286: set combo jack by dmi

From: Bard Liao <[email protected]>

This patch enables combo jack configuration according to dmi.

---
 sound/soc/codecs/rt286.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
sound/soc/codecs/rt286.c +14 -0
index 97daa80..aa572b6 100644
@@ -17,6 +17,7 @@
 #include <linux/i2c.h>
 #include <linux/platform_device.h>
 #include <linux/spi/spi.h>
+#include <linux/dmi.h>
 #include <linux/acpi.h>
 #include <sound/core.h>
 #include <sound/pcm.h>
@@ -1205,6 +1206,16 @@ static const struct acpi_device_id rt286_acpi_match[] = {
 };
 MODULE_DEVICE_TABLE(acpi, rt286_acpi_match);
 
+static struct dmi_system_id intel_platform[] __initdata = {
+	{
+		.ident = "Intel Wilson Beach",
+		.matches = {
+			DMI_MATCH(DMI_BOARD_NAME, "Wilson Beach SDS")
+		}
+	},
+	{ }
+};
+
 static int rt286_i2c_probe(struct i2c_client *i2c,
 			   const struct i2c_device_id *id)
 {
@@ -1240,6 +1251,9 @@ static int rt286_i2c_probe(struct i2c_client *i2c,
 	if (pdata)
 		rt286->pdata = *pdata;
 
+	if (dmi_check_system(intel_platform))
+		rt286->pdata.cbj_en = true;
+
 	regmap_write(rt286->regmap, RT286_SET_AUDIO_POWER, AC_PWRST_D3);
 
 	for (i = 0; i < RT286_POWER_REG_LEN; i++)
Signature · 1 line
1.8.1.1.439.g50a6b54
maintainer
#1 lore raw

sound/soc/codecs/rt286.c static const struct acpi_device_id rt286_acpi_match[] = { · line 1210

Quoted 2 lines · On Wed, Nov 05, 2014 at 01:09:26PM +0800, [email protected] wrote:
sound/soc/codecs/rt286.c +2 -0
+static struct dmi_system_id intel_platform[] __initdata = {
+	{

This is fine but can you please rename the variable from intel_platform to something more meaningful like the name of the reference design these are derived from or something? That way if we need to add some other quirk (and I guess we will) we won't have to rename this table - I guess anything that's using a DMI quirk will be some Intel based platform.

#2 lore raw
Quoted 11 lines

-----Original Message-----
From: Mark Brown [mailto:[email protected]]
Sent: Thursday, November 06, 2014 1:23 AM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Jie, Yang
Subject: Re: [PATCH] ASoC:rt286: set combo jack by dmi

On Wed, Nov 05, 2014 at 01:09:26PM +0800, [email protected] wrote:

Quoted 8 lines

sound/soc/codecs/rt286.c static const struct acpi_device_id rt286_acpi_match[] = { · line 1210

Quoted 2 lines
sound/soc/codecs/rt286.c +2 -0
+static struct dmi_system_id intel_platform[] __initdata = {
+	{

This is fine but can you please rename the variable from intel_platform to something more meaningful like the name of the reference design these are derived from or something? That way if we need to add some other quirk (and I guess we will) we won't have to rename this table - I guess anything that's using a DMI quirk will be some Intel based platform.

[Keyon] maybe we can use something like 'combo_jack_platform'?