mirror of
https://abf.rosa.ru/djam/kernel-5.15.git
synced 2025-02-23 18:42:55 +00:00
82 lines
3 KiB
Diff
82 lines
3 KiB
Diff
![]() |
From 8e36b0949f9e542aeca53a8c34c4205b4106311e Mon Sep 17 00:00:00 2001
|
||
|
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
|
||
|
Date: Tue, 8 Mar 2022 13:26:08 -0600
|
||
|
Subject: [PATCH 411/424] ASoC: Intel: sof_es8336: extend machine driver to
|
||
|
support ES8326 codec
|
||
|
MIME-Version: 1.0
|
||
|
Content-Type: text/plain; charset=UTF-8
|
||
|
Content-Transfer-Encoding: 8bit
|
||
|
|
||
|
The ES8326 requires a different codec driver than ES8316/8336, fixup
|
||
|
the codec name and dai name depending on the ACPI _HID exposed in the
|
||
|
DSDT.
|
||
|
|
||
|
Also add the select in Kconfig
|
||
|
|
||
|
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
|
||
|
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
|
||
|
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
|
||
|
Link: https://lore.kernel.org/r/20220308192610.392950-19-pierre-louis.bossart@linux.intel.com
|
||
|
Signed-off-by: Mark Brown <broonie@kernel.org>
|
||
|
---
|
||
|
sound/soc/intel/boards/Kconfig | 3 ++-
|
||
|
sound/soc/intel/boards/sof_es8336.c | 10 +++++++---
|
||
|
2 files changed, 9 insertions(+), 4 deletions(-)
|
||
|
|
||
|
diff --git a/sound/soc/intel/boards/Kconfig b/sound/soc/intel/boards/Kconfig
|
||
|
index 89b6430e7..20874faa3 100644
|
||
|
--- a/sound/soc/intel/boards/Kconfig
|
||
|
+++ b/sound/soc/intel/boards/Kconfig
|
||
|
@@ -512,11 +512,12 @@ config SND_SOC_INTEL_SOF_PCM512x_MACH
|
||
|
If unsure select "N".
|
||
|
|
||
|
config SND_SOC_INTEL_SOF_ES8336_MACH
|
||
|
- tristate "SOF with ES8336 codec in I2S mode"
|
||
|
+ tristate "SOF with ES8336 or ES8326 codec in I2S mode"
|
||
|
depends on I2C && ACPI && GPIOLIB
|
||
|
depends on MFD_INTEL_LPSS || COMPILE_TEST
|
||
|
depends on SND_HDA_CODEC_HDMI && SND_SOC_SOF_HDA_AUDIO_CODEC
|
||
|
select SND_SOC_ES8316
|
||
|
+ select SND_SOC_ES8326
|
||
|
select SND_SOC_DMIC
|
||
|
select SND_SOC_INTEL_HDA_DSP_COMMON
|
||
|
help
|
||
|
diff --git a/sound/soc/intel/boards/sof_es8336.c b/sound/soc/intel/boards/sof_es8336.c
|
||
|
index 932a80e62..32f530304 100644
|
||
|
--- a/sound/soc/intel/boards/sof_es8336.c
|
||
|
+++ b/sound/soc/intel/boards/sof_es8336.c
|
||
|
@@ -292,7 +292,7 @@ static struct snd_soc_dai_link_component platform_component[] = {
|
||
|
}
|
||
|
};
|
||
|
|
||
|
-SND_SOC_DAILINK_DEF(ssp1_codec,
|
||
|
+SND_SOC_DAILINK_DEF(es8336_codec,
|
||
|
DAILINK_COMP_ARRAY(COMP_CODEC("i2c-ESSX8336:00", "ES8316 HiFi")));
|
||
|
|
||
|
static struct snd_soc_dai_link_component dmic_component[] = {
|
||
|
@@ -356,8 +356,8 @@ static struct snd_soc_dai_link *sof_card_dai_links_create(struct device *dev,
|
||
|
goto devm_err;
|
||
|
|
||
|
links[id].id = id;
|
||
|
- links[id].codecs = ssp1_codec;
|
||
|
- links[id].num_codecs = ARRAY_SIZE(ssp1_codec);
|
||
|
+ links[id].codecs = es8336_codec;
|
||
|
+ links[id].num_codecs = ARRAY_SIZE(es8336_codec);
|
||
|
links[id].platforms = platform_component;
|
||
|
links[id].num_platforms = ARRAY_SIZE(platform_component);
|
||
|
links[id].init = sof_es8316_init;
|
||
|
@@ -539,6 +539,10 @@ static int sof_es8336_probe(struct platform_device *pdev)
|
||
|
"i2c-%s", acpi_dev_name(adev));
|
||
|
put_device(&adev->dev);
|
||
|
dai_links[0].codecs->name = codec_name;
|
||
|
+
|
||
|
+ /* also fixup codec dai name if relevant */
|
||
|
+ if (!strncmp(mach->id, "ESSX8326", SND_ACPI_I2C_ID_LEN))
|
||
|
+ dai_links[0].codecs->dai_name = "ES8326 HiFi";
|
||
|
} else {
|
||
|
dev_err(dev, "Error cannot find '%s' dev\n", mach->id);
|
||
|
return -ENXIO;
|
||
|
--
|
||
|
2.35.2
|
||
|
|