aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/intel/boards/bytcht_es8316.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/intel/boards/bytcht_es8316.c')
-rw-r--r--sound/soc/intel/boards/bytcht_es8316.c61
1 files changed, 27 insertions, 34 deletions
diff --git a/sound/soc/intel/boards/bytcht_es8316.c b/sound/soc/intel/boards/bytcht_es8316.c
index 128b57932a92..fac09be3cade 100644
--- a/sound/soc/intel/boards/bytcht_es8316.c
+++ b/sound/soc/intel/boards/bytcht_es8316.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-only
/*
* bytcht_es8316.c - ASoc Machine driver for Intel Baytrail/Cherrytrail
* platforms with Everest ES8316 SoC
@@ -8,15 +9,6 @@
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
#include <linux/acpi.h>
@@ -30,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>
@@ -40,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
@@ -309,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 */
@@ -344,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,
@@ -356,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),
},
};
@@ -430,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[] = {
@@ -478,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;
@@ -491,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 */
@@ -507,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;
@@ -526,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");