summary refs log tree commit diff
path: root/sound/soc/codecs/rt5670.c
diff options
context:
space:
mode:
authorBard Liao <bardliao@realtek.com>2014-12-18 11:32:52 +0800
committerMark Brown <broonie@kernel.org>2015-03-02 16:19:46 +0000
commit223c055aa0eb7e606eb7132e339ce66bb8d7be0d (patch)
treeb27003e5a6a106aa51c8d1fde69e84659fbbfd31 /sound/soc/codecs/rt5670.c
parent7371bd1f4aeb4e1c44b8c1ba8e36ebba4250b59c (diff)
downloadlinux-223c055aa0eb7e606eb7132e339ce66bb8d7be0d.tar.gz
ASoC: rt5670: set platform data by dmi
This patch set specific data according to dmi data.

Signed-off-by: Jin, Yao <yao.jin@intel.com>
Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/rt5670.c')
-rw-r--r--sound/soc/codecs/rt5670.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/sound/soc/codecs/rt5670.c b/sound/soc/codecs/rt5670.c
index 8a0833de1665..cd47ef1f5561 100644
--- a/sound/soc/codecs/rt5670.c
+++ b/sound/soc/codecs/rt5670.c
@@ -18,6 +18,7 @@
 #include <linux/platform_device.h>
 #include <linux/acpi.h>
 #include <linux/spi/spi.h>
+#include <linux/dmi.h>
 #include <sound/core.h>
 #include <sound/pcm.h>
 #include <sound/pcm_params.h>
@@ -2549,6 +2550,17 @@ static struct acpi_device_id rt5670_acpi_match[] = {
 MODULE_DEVICE_TABLE(acpi, rt5670_acpi_match);
 #endif
 
+static const struct dmi_system_id dmi_platform_intel_braswell[] = {
+	{
+		.ident = "Intel Braswell",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Intel Corporation"),
+			DMI_MATCH(DMI_BOARD_NAME, "Braswell CRB"),
+		},
+	},
+	{}
+};
+
 static int rt5670_i2c_probe(struct i2c_client *i2c,
 		    const struct i2c_device_id *id)
 {
@@ -2568,6 +2580,12 @@ static int rt5670_i2c_probe(struct i2c_client *i2c,
 	if (pdata)
 		rt5670->pdata = *pdata;
 
+	if (dmi_check_system(dmi_platform_intel_braswell)) {
+		rt5670->pdata.dmic_en = true;
+		rt5670->pdata.dmic1_data_pin = RT5670_DMIC_DATA_IN2P;
+		rt5670->pdata.jd_mode = 1;
+	}
+
 	rt5670->regmap = devm_regmap_init_i2c(i2c, &rt5670_regmap);
 	if (IS_ERR(rt5670->regmap)) {
 		ret = PTR_ERR(rt5670->regmap);