aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBard Liao <bardliao@realtek.com>2014-12-17 22:32:52 -0500
committerMark Brown <broonie@kernel.org>2014-12-22 08:32:18 -0500
commita5a41645d0096f4c9ffd7154270b43daebcb4386 (patch)
tree3c7133728c10b7ec2726ecb9dd0174e43db32c30
parent97bf6af1f928216fd6c5a66e8a57bfa95a659672 (diff)
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>
-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 @@
18#include <linux/platform_device.h> 18#include <linux/platform_device.h>
19#include <linux/acpi.h> 19#include <linux/acpi.h>
20#include <linux/spi/spi.h> 20#include <linux/spi/spi.h>
21#include <linux/dmi.h>
21#include <sound/core.h> 22#include <sound/core.h>
22#include <sound/pcm.h> 23#include <sound/pcm.h>
23#include <sound/pcm_params.h> 24#include <sound/pcm_params.h>
@@ -2549,6 +2550,17 @@ static struct acpi_device_id rt5670_acpi_match[] = {
2549MODULE_DEVICE_TABLE(acpi, rt5670_acpi_match); 2550MODULE_DEVICE_TABLE(acpi, rt5670_acpi_match);
2550#endif 2551#endif
2551 2552
2553static const struct dmi_system_id dmi_platform_intel_braswell[] = {
2554 {
2555 .ident = "Intel Braswell",
2556 .matches = {
2557 DMI_MATCH(DMI_SYS_VENDOR, "Intel Corporation"),
2558 DMI_MATCH(DMI_BOARD_NAME, "Braswell CRB"),
2559 },
2560 },
2561 {}
2562};
2563
2552static int rt5670_i2c_probe(struct i2c_client *i2c, 2564static int rt5670_i2c_probe(struct i2c_client *i2c,
2553 const struct i2c_device_id *id) 2565 const struct i2c_device_id *id)
2554{ 2566{
@@ -2568,6 +2580,12 @@ static int rt5670_i2c_probe(struct i2c_client *i2c,
2568 if (pdata) 2580 if (pdata)
2569 rt5670->pdata = *pdata; 2581 rt5670->pdata = *pdata;
2570 2582
2583 if (dmi_check_system(dmi_platform_intel_braswell)) {
2584 rt5670->pdata.dmic_en = true;
2585 rt5670->pdata.dmic1_data_pin = RT5670_DMIC_DATA_IN2P;
2586 rt5670->pdata.jd_mode = 1;
2587 }
2588
2571 rt5670->regmap = devm_regmap_init_i2c(i2c, &rt5670_regmap); 2589 rt5670->regmap = devm_regmap_init_i2c(i2c, &rt5670_regmap);
2572 if (IS_ERR(rt5670->regmap)) { 2590 if (IS_ERR(rt5670->regmap)) {
2573 ret = PTR_ERR(rt5670->regmap); 2591 ret = PTR_ERR(rt5670->regmap);