diff options
author | Mark Brown <broonie@kernel.org> | 2019-07-06 14:25:26 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-07-06 14:25:26 +0300 |
commit | 043b35f281f5f141e7a928d27492133ef33b8119 (patch) | |
tree | 30a9598866d6b8d44ee6b3fe88506881f23e0203 /sound/soc/intel/boards/bytcht_es8316.c | |
parent | 0dceaf7c798de953c74073cc77be40b7be49abbc (diff) | |
parent | 87a6fe80d56be85bda093c4dd8a3e6535bda7e4a (diff) | |
download | linux-043b35f281f5f141e7a928d27492133ef33b8119.tar.xz |
Merge branch 'asoc-5.3' into asoc-next
Diffstat (limited to 'sound/soc/intel/boards/bytcht_es8316.c')
-rw-r--r-- | sound/soc/intel/boards/bytcht_es8316.c | 51 |
1 files changed, 26 insertions, 25 deletions
diff --git a/sound/soc/intel/boards/bytcht_es8316.c b/sound/soc/intel/boards/bytcht_es8316.c index 2fe1ce879123..fac09be3cade 100644 --- a/sound/soc/intel/boards/bytcht_es8316.c +++ b/sound/soc/intel/boards/bytcht_es8316.c @@ -22,9 +22,6 @@ #include <linux/module.h> #include <linux/platform_device.h> #include <linux/slab.h> -#include <asm/cpu_device_id.h> -#include <asm/intel-family.h> -#include <asm/platform_sst_audio.h> #include <sound/jack.h> #include <sound/pcm.h> #include <sound/pcm_params.h> @@ -32,6 +29,7 @@ #include <sound/soc-acpi.h> #include "../atom/sst-atom-controls.h" #include "../common/sst-dsp.h" +#include "../common/soc-intel-quirks.h" /* jd-inv + terminating entry */ #define MAX_NO_PROPS 2 @@ -301,32 +299,43 @@ static const struct snd_soc_ops byt_cht_es8316_aif1_ops = { .startup = byt_cht_es8316_aif1_startup, }; +SND_SOC_DAILINK_DEF(dummy, + DAILINK_COMP_ARRAY(COMP_DUMMY())); + +SND_SOC_DAILINK_DEF(media, + DAILINK_COMP_ARRAY(COMP_CPU("media-cpu-dai"))); + +SND_SOC_DAILINK_DEF(deepbuffer, + DAILINK_COMP_ARRAY(COMP_CPU("deepbuffer-cpu-dai"))); + +SND_SOC_DAILINK_DEF(ssp2_port, + DAILINK_COMP_ARRAY(COMP_CPU("ssp2-port"))); +SND_SOC_DAILINK_DEF(ssp2_codec, + DAILINK_COMP_ARRAY(COMP_CODEC("i2c-ESSX8316:00", "ES8316 HiFi"))); + +SND_SOC_DAILINK_DEF(platform, + DAILINK_COMP_ARRAY(COMP_PLATFORM("sst-mfld-platform"))); + static struct snd_soc_dai_link byt_cht_es8316_dais[] = { [MERR_DPCM_AUDIO] = { .name = "Audio Port", .stream_name = "Audio", - .cpu_dai_name = "media-cpu-dai", - .codec_dai_name = "snd-soc-dummy-dai", - .codec_name = "snd-soc-dummy", - .platform_name = "sst-mfld-platform", .nonatomic = true, .dynamic = 1, .dpcm_playback = 1, .dpcm_capture = 1, .ops = &byt_cht_es8316_aif1_ops, + SND_SOC_DAILINK_REG(media, dummy, platform), }, [MERR_DPCM_DEEP_BUFFER] = { .name = "Deep-Buffer Audio Port", .stream_name = "Deep-Buffer Audio", - .cpu_dai_name = "deepbuffer-cpu-dai", - .codec_dai_name = "snd-soc-dummy-dai", - .codec_name = "snd-soc-dummy", - .platform_name = "sst-mfld-platform", .nonatomic = true, .dynamic = 1, .dpcm_playback = 1, .ops = &byt_cht_es8316_aif1_ops, + SND_SOC_DAILINK_REG(deepbuffer, dummy, platform), }, /* back ends */ @@ -336,11 +345,7 @@ static struct snd_soc_dai_link byt_cht_es8316_dais[] = { */ .name = "SSP2-Codec", .id = 0, - .cpu_dai_name = "ssp2-port", - .platform_name = "sst-mfld-platform", .no_pcm = 1, - .codec_dai_name = "ES8316 HiFi", - .codec_name = "i2c-ESSX8316:00", .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS, .be_hw_params_fixup = byt_cht_es8316_codec_fixup, @@ -348,6 +353,7 @@ static struct snd_soc_dai_link byt_cht_es8316_dais[] = { .dpcm_playback = 1, .dpcm_capture = 1, .init = byt_cht_es8316_init, + SND_SOC_DAILINK_REG(ssp2_port, ssp2_codec, platform), }, }; @@ -422,11 +428,6 @@ static struct snd_soc_card byt_cht_es8316_card = { .resume_post = byt_cht_es8316_resume, }; -static const struct x86_cpu_id baytrail_cpu_ids[] = { - { X86_VENDOR_INTEL, 6, INTEL_FAM6_ATOM_SILVERMONT }, /* Valleyview */ - {} -}; - static const struct acpi_gpio_params first_gpio = { 0, 0, false }; static const struct acpi_gpio_mapping byt_cht_es8316_gpios[] = { @@ -470,7 +471,7 @@ static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev) mach = dev->platform_data; /* fix index of codec dai */ for (i = 0; i < ARRAY_SIZE(byt_cht_es8316_dais); i++) { - if (!strcmp(byt_cht_es8316_dais[i].codec_name, + if (!strcmp(byt_cht_es8316_dais[i].codecs->name, "i2c-ESSX8316:00")) { dai_index = i; break; @@ -483,7 +484,7 @@ static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev) snprintf(codec_name, sizeof(codec_name), "i2c-%s", acpi_dev_name(adev)); put_device(&adev->dev); - byt_cht_es8316_dais[dai_index].codec_name = codec_name; + byt_cht_es8316_dais[dai_index].codecs->name = codec_name; } /* override plaform name, if required */ @@ -499,8 +500,8 @@ static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev) dmi_id = dmi_first_match(byt_cht_es8316_quirk_table); if (dmi_id) { quirk = (unsigned long)dmi_id->driver_data; - } else if (x86_match_cpu(baytrail_cpu_ids) && - mach->mach_params.acpi_ipc_irq_index == 0) { + } else if (soc_intel_is_byt() && + mach->mach_params.acpi_ipc_irq_index == 0) { /* On BYTCR default to SSP0, internal-mic-in2-map, mono-spk */ quirk = BYT_CHT_ES8316_SSP0 | BYT_CHT_ES8316_INTMIC_IN2_MAP | BYT_CHT_ES8316_MONO_SPEAKER; @@ -518,7 +519,7 @@ static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev) log_quirks(dev); if (quirk & BYT_CHT_ES8316_SSP0) - byt_cht_es8316_dais[dai_index].cpu_dai_name = "ssp0-port"; + byt_cht_es8316_dais[dai_index].cpus->dai_name = "ssp0-port"; /* get the clock */ priv->mclk = devm_clk_get(dev, "pmc_plt_clk_3"); |