diff options
author | Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> | 2016-08-12 17:27:53 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-08-15 10:14:57 -0400 |
commit | e214f5e78aca81080c156a68a263d31d51d0ea17 (patch) | |
tree | 55695b9d7a0ef29d8ab081b64f1c8e87aa74426d /sound | |
parent | 038a50e735c85a7a9fbcda090785a588443ffa26 (diff) |
ASoC: Intel: bytcr_rt5640: default routing and quirks on Baytrail-CR
Auto routing based on Baytrail/Baytrail-CR detection
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/intel/boards/bytcr_rt5640.c | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/sound/soc/intel/boards/bytcr_rt5640.c b/sound/soc/intel/boards/bytcr_rt5640.c index 42c7bd20f54d..c4a3c5778b38 100644 --- a/sound/soc/intel/boards/bytcr_rt5640.c +++ b/sound/soc/intel/boards/bytcr_rt5640.c | |||
@@ -24,6 +24,8 @@ | |||
24 | #include <linux/device.h> | 24 | #include <linux/device.h> |
25 | #include <linux/dmi.h> | 25 | #include <linux/dmi.h> |
26 | #include <linux/slab.h> | 26 | #include <linux/slab.h> |
27 | #include <asm/cpu_device_id.h> | ||
28 | #include <asm/platform_sst_audio.h> | ||
27 | #include <sound/pcm.h> | 29 | #include <sound/pcm.h> |
28 | #include <sound/pcm_params.h> | 30 | #include <sound/pcm_params.h> |
29 | #include <sound/soc.h> | 31 | #include <sound/soc.h> |
@@ -31,6 +33,7 @@ | |||
31 | #include "../../codecs/rt5640.h" | 33 | #include "../../codecs/rt5640.h" |
32 | #include "../atom/sst-atom-controls.h" | 34 | #include "../atom/sst-atom-controls.h" |
33 | #include "../common/sst-acpi.h" | 35 | #include "../common/sst-acpi.h" |
36 | #include "../common/sst-dsp.h" | ||
34 | 37 | ||
35 | enum { | 38 | enum { |
36 | BYT_RT5640_DMIC1_MAP, | 39 | BYT_RT5640_DMIC1_MAP, |
@@ -189,7 +192,8 @@ static const struct dmi_system_id byt_rt5640_quirk_table[] = { | |||
189 | }, | 192 | }, |
190 | .driver_data = (unsigned long *)(BYT_RT5640_IN1_MAP | | 193 | .driver_data = (unsigned long *)(BYT_RT5640_IN1_MAP | |
191 | BYT_RT5640_MONO_SPEAKER | | 194 | BYT_RT5640_MONO_SPEAKER | |
192 | BYT_RT5640_DIFF_MIC | 195 | BYT_RT5640_DIFF_MIC | |
196 | BYT_RT5640_SSP0_AIF2 | ||
193 | ), | 197 | ), |
194 | }, | 198 | }, |
195 | { | 199 | { |
@@ -464,6 +468,18 @@ static char byt_rt5640_codec_name[16]; /* i2c-<HID>:00 with HID being 8 chars */ | |||
464 | static char byt_rt5640_codec_aif_name[12]; /* = "rt5640-aif[1|2]" */ | 468 | static char byt_rt5640_codec_aif_name[12]; /* = "rt5640-aif[1|2]" */ |
465 | static char byt_rt5640_cpu_dai_name[10]; /* = "ssp[0|2]-port" */ | 469 | static char byt_rt5640_cpu_dai_name[10]; /* = "ssp[0|2]-port" */ |
466 | 470 | ||
471 | static bool is_valleyview(void) | ||
472 | { | ||
473 | static const struct x86_cpu_id cpu_ids[] __initconst = { | ||
474 | { X86_VENDOR_INTEL, 6, 55 }, /* Valleyview, Bay Trail */ | ||
475 | {} | ||
476 | }; | ||
477 | |||
478 | if (!x86_match_cpu(cpu_ids)) | ||
479 | return false; | ||
480 | return true; | ||
481 | } | ||
482 | |||
467 | static int snd_byt_rt5640_mc_probe(struct platform_device *pdev) | 483 | static int snd_byt_rt5640_mc_probe(struct platform_device *pdev) |
468 | { | 484 | { |
469 | int ret_val = 0; | 485 | int ret_val = 0; |
@@ -494,6 +510,20 @@ static int snd_byt_rt5640_mc_probe(struct platform_device *pdev) | |||
494 | byt_rt5640_dais[dai_index].codec_name = byt_rt5640_codec_name; | 510 | byt_rt5640_dais[dai_index].codec_name = byt_rt5640_codec_name; |
495 | } | 511 | } |
496 | 512 | ||
513 | /* | ||
514 | * swap SSP0 if bytcr is detected | ||
515 | * (will be overridden if DMI quirk is detected) | ||
516 | */ | ||
517 | if (is_valleyview()) { | ||
518 | struct sst_platform_info *p_info = mach->pdata; | ||
519 | const struct sst_res_info *res_info = p_info->res_info; | ||
520 | |||
521 | /* TODO: use CHAN package info from BIOS to detect AIF1/AIF2 */ | ||
522 | if (res_info->acpi_ipc_irq_index == 0) { | ||
523 | byt_rt5640_quirk |= BYT_RT5640_SSP0_AIF2; | ||
524 | } | ||
525 | } | ||
526 | |||
497 | /* check quirks before creating card */ | 527 | /* check quirks before creating card */ |
498 | dmi_check_system(byt_rt5640_quirk_table); | 528 | dmi_check_system(byt_rt5640_quirk_table); |
499 | 529 | ||