diff mbox

[1/2] ASoC:rt286: set combo jack by dmi

Message ID 1415239200-13788-1-git-send-email-bardliao@realtek.com (mailing list archive)
State Accepted
Commit 6c67cde2aa88bb06cd039aa0f61b26df887075d7
Headers show

Commit Message

Bard Liao Nov. 6, 2014, 1:59 a.m. UTC
From: Bard Liao <bardliao@realtek.com>

This patch enables combo jack configuration according to dmi.

Signed-off-by: Bard Liao <bardliao@realtek.com>
---
* rename intel_platform to force_combo_jack_table
---
---
 sound/soc/codecs/rt286.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

Comments

Mark Brown Nov. 6, 2014, 5:51 a.m. UTC | #1
On Thu, Nov 06, 2014 at 09:59:59AM +0800, bardliao@realtek.com wrote:
> From: Bard Liao <bardliao@realtek.com>
> 
> This patch enables combo jack configuration according to dmi.

Applied both, please try to follow the normal style for subject lines
(missing spaces).
diff mbox

Patch

diff --git a/sound/soc/codecs/rt286.c b/sound/soc/codecs/rt286.c
index 97daa80..d4acb64 100644
--- a/sound/soc/codecs/rt286.c
+++ b/sound/soc/codecs/rt286.c
@@ -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 force_combo_jack_table[] __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(force_combo_jack_table))
+		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++)