aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/intel/boards/sof_rt5682.c
diff options
context:
space:
mode:
authorSathyanarayana Nujella <sathyanarayana.nujella@intel.com>2020-03-25 16:32:44 -0500
committerMark Brown <broonie@kernel.org>2020-03-26 17:55:29 +0000
commite2e404a6164e526193f78717de060cd9b27b3b90 (patch)
tree7e7733437b4c95b4a0da3a237a25c94978ae7893 /sound/soc/intel/boards/sof_rt5682.c
parentASoC: intel: sof_da7219_max98373: Add speaker switch (diff)
downloadlinux-dev-e2e404a6164e526193f78717de060cd9b27b3b90.tar.xz
linux-dev-e2e404a6164e526193f78717de060cd9b27b3b90.zip
ASoC: Intel: sof_rt5682: Add support for tgl-max98373-rt5682
This patch does the below: 1. Adds the driver data and updates quirk info for TGL with Max98373 speaker amp and ALC5682 headset codec. 2. Added max98373 speaker related code to common file for re-use. Signed-off-by: Jairaj Arava <jairaj.arava@intel.com> Signed-off-by: Sathyanarayana Nujella <sathyanarayana.nujella@intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200325213245.28247-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/intel/boards/sof_rt5682.c')
-rw-r--r--sound/soc/intel/boards/sof_rt5682.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/sound/soc/intel/boards/sof_rt5682.c b/sound/soc/intel/boards/sof_rt5682.c
index 6defe7c85c32..2eeaa14e59c0 100644
--- a/sound/soc/intel/boards/sof_rt5682.c
+++ b/sound/soc/intel/boards/sof_rt5682.c
@@ -23,6 +23,7 @@
#include "../../codecs/hdac_hdmi.h"
#include "../common/soc-intel-quirks.h"
#include "hda_dsp_common.h"
+#include "sof_maxim_common.h"
#define NAME_SIZE 32
@@ -41,6 +42,7 @@
#define SOF_RT5682_NUM_HDMIDEV(quirk) \
((quirk << SOF_RT5682_NUM_HDMIDEV_SHIFT) & SOF_RT5682_NUM_HDMIDEV_MASK)
#define SOF_RT1015_SPEAKER_AMP_PRESENT BIT(13)
+#define SOF_MAX98373_SPEAKER_AMP_PRESENT BIT(14)
/* Default: MCLK on, MCLK 19.2M, SSP0 */
static unsigned long sof_rt5682_quirk = SOF_RT5682_MCLK_EN |
@@ -637,6 +639,12 @@ static struct snd_soc_dai_link *sof_card_dai_links_create(struct device *dev,
links[id].num_codecs = ARRAY_SIZE(rt1015_components);
links[id].init = speaker_codec_init_lr;
links[id].ops = &sof_rt1015_ops;
+ } else if (sof_rt5682_quirk &
+ SOF_MAX98373_SPEAKER_AMP_PRESENT) {
+ links[id].codecs = max_98373_components;
+ links[id].num_codecs = ARRAY_SIZE(max_98373_components);
+ links[id].init = max98373_spk_codec_init;
+ links[id].ops = &max_98373_ops;
} else {
links[id].codecs = max98357a_component;
links[id].num_codecs = ARRAY_SIZE(max98357a_component);
@@ -745,6 +753,9 @@ static int sof_audio_probe(struct platform_device *pdev)
if (sof_rt5682_quirk & SOF_SPEAKER_AMP_PRESENT)
sof_audio_card_rt5682.num_links++;
+ if (sof_rt5682_quirk & SOF_MAX98373_SPEAKER_AMP_PRESENT)
+ sof_max98373_codec_conf(&sof_audio_card_rt5682);
+
dai_links = sof_card_dai_links_create(&pdev->dev, ssp_codec, ssp_amp,
dmic_be_num, hdmi_num);
if (!dai_links)
@@ -811,6 +822,15 @@ static const struct platform_device_id board_ids[] = {
SOF_RT1015_SPEAKER_AMP_PRESENT |
SOF_RT5682_SSP_AMP(1)),
},
+ {
+ .name = "tgl_max98373_rt5682",
+ .driver_data = (kernel_ulong_t)(SOF_RT5682_MCLK_EN |
+ SOF_RT5682_SSP_CODEC(0) |
+ SOF_SPEAKER_AMP_PRESENT |
+ SOF_MAX98373_SPEAKER_AMP_PRESENT |
+ SOF_RT5682_SSP_AMP(1) |
+ SOF_RT5682_NUM_HDMIDEV(4)),
+ },
{ }
};
@@ -833,3 +853,4 @@ MODULE_LICENSE("GPL v2");
MODULE_ALIAS("platform:sof_rt5682");
MODULE_ALIAS("platform:tgl_max98357a_rt5682");
MODULE_ALIAS("platform:jsl_rt5682_rt1015");
+MODULE_ALIAS("platform:tgl_max98373_rt5682");