[PATCH 0/2] ASoC: Intel: sof_rt5682: add two derivative options
Add support for platforms without amplifier (headset codec only) and without Intel graphics.
Ajye Huang (1): ASoC: Intel: sof_rt5682: Add support for platform without amplifier
Yong Zhi (1): ASoC: Intel: sof_rt5682: add support for systems without i915 audio
sound/soc/intel/boards/sof_rt5682.c | 40 ++++++++++++++----- .../intel/common/soc-acpi-intel-adl-match.c | 6 +++ 2 files changed, 36 insertions(+), 10 deletions(-)
From: Yong Zhi yong.zhi@intel.com
Add support to systems where iDisp HDMI/DP audio codec is disabled for some reason, switch codecs to SoC dummy in the affected DAI links. This allows to reuse existing topologies as hdmi_num is 3 by default.
Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Signed-off-by: Yong Zhi yong.zhi@intel.com Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- sound/soc/intel/boards/sof_rt5682.c | 32 ++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 10 deletions(-)
diff --git a/sound/soc/intel/boards/sof_rt5682.c b/sound/soc/intel/boards/sof_rt5682.c index bd6d2e7dea53..8391bea8ec79 100644 --- a/sound/soc/intel/boards/sof_rt5682.c +++ b/sound/soc/intel/boards/sof_rt5682.c @@ -81,6 +81,7 @@ struct sof_card_private { struct snd_soc_jack sof_headset; struct list_head hdmi_pcm_list; bool common_hdmi_codec_drv; + bool idisp_codec; };
static int sof_rt5682_quirk_cb(const struct dmi_system_id *id) @@ -417,7 +418,7 @@ static int sof_card_late_probe(struct snd_soc_card *card) int i = 0;
/* HDMI is not supported by SOF on Baytrail/CherryTrail */ - if (is_legacy_cpu) + if (is_legacy_cpu || !ctx->idisp_codec) return 0;
if (list_empty(&ctx->hdmi_pcm_list)) @@ -558,11 +559,14 @@ static struct snd_soc_dai_link_component dummy_component[] = { } };
+#define IDISP_CODEC_MASK 0x4 + static struct snd_soc_dai_link *sof_card_dai_links_create(struct device *dev, int ssp_codec, int ssp_amp, int dmic_be_num, - int hdmi_num) + int hdmi_num, + bool idisp_codec) { struct snd_soc_dai_link_component *idisp_components; struct snd_soc_dai_link_component *cpus; @@ -676,13 +680,18 @@ static struct snd_soc_dai_link *sof_card_dai_links_create(struct device *dev, if (!links[id].cpus->dai_name) goto devm_err;
- idisp_components[i - 1].name = "ehdaudio0D2"; - idisp_components[i - 1].dai_name = devm_kasprintf(dev, - GFP_KERNEL, - "intel-hdmi-hifi%d", - i); - if (!idisp_components[i - 1].dai_name) - goto devm_err; + if (idisp_codec) { + idisp_components[i - 1].name = "ehdaudio0D2"; + idisp_components[i - 1].dai_name = devm_kasprintf(dev, + GFP_KERNEL, + "intel-hdmi-hifi%d", + i); + if (!idisp_components[i - 1].dai_name) + goto devm_err; + } else { + idisp_components[i - 1].name = "snd-soc-dummy"; + idisp_components[i - 1].dai_name = "snd-soc-dummy-dai"; + }
links[id].codecs = &idisp_components[i - 1]; links[id].num_codecs = 1; @@ -838,6 +847,9 @@ static int sof_audio_probe(struct platform_device *pdev) /* default number of HDMI DAI's */ if (!hdmi_num) hdmi_num = 3; + + if (mach->mach_params.codec_mask & IDISP_CODEC_MASK) + ctx->idisp_codec = true; }
/* need to get main clock from pmc */ @@ -892,7 +904,7 @@ static int sof_audio_probe(struct platform_device *pdev) sof_audio_card_rt5682.num_links++;
dai_links = sof_card_dai_links_create(&pdev->dev, ssp_codec, ssp_amp, - dmic_be_num, hdmi_num); + dmic_be_num, hdmi_num, ctx->idisp_codec); if (!dai_links) return -ENOMEM;
From: Ajye Huang ajye_huang@compal.corp-partner.google.com
Add a board config adl_rt5682 to support alc5682 headset codec without speaker amplifier. Follow Intel BT offload design by connecting alc5682 to SSP0.
Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Signed-off-by: Ajye Huang ajye_huang@compal.corp-partner.google.com Signed-off-by: Brent Lu brent.lu@intel.com Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- sound/soc/intel/boards/sof_rt5682.c | 8 ++++++++ sound/soc/intel/common/soc-acpi-intel-adl-match.c | 6 ++++++ 2 files changed, 14 insertions(+)
diff --git a/sound/soc/intel/boards/sof_rt5682.c b/sound/soc/intel/boards/sof_rt5682.c index 8391bea8ec79..70541caa7237 100644 --- a/sound/soc/intel/boards/sof_rt5682.c +++ b/sound/soc/intel/boards/sof_rt5682.c @@ -1045,6 +1045,14 @@ static const struct platform_device_id board_ids[] = { SOF_BT_OFFLOAD_SSP(2) | SOF_SSP_BT_OFFLOAD_PRESENT), }, + { + .name = "adl_rt5682", + .driver_data = (kernel_ulong_t)(SOF_RT5682_MCLK_EN | + SOF_RT5682_SSP_CODEC(0) | + SOF_RT5682_NUM_HDMIDEV(4) | + SOF_BT_OFFLOAD_SSP(2) | + SOF_SSP_BT_OFFLOAD_PRESENT), + }, { } }; MODULE_DEVICE_TABLE(platform, board_ids); diff --git a/sound/soc/intel/common/soc-acpi-intel-adl-match.c b/sound/soc/intel/common/soc-acpi-intel-adl-match.c index f32bcb2b2e09..20257f547275 100644 --- a/sound/soc/intel/common/soc-acpi-intel-adl-match.c +++ b/sound/soc/intel/common/soc-acpi-intel-adl-match.c @@ -447,6 +447,12 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_adl_machines[] = { .sof_fw_filename = "sof-adl.ri", .sof_tplg_filename = "sof-adl-max98390-rt5682.tplg", }, + { + .comp_ids = &adl_rt5682_rt5682s_hp, + .drv_name = "adl_rt5682", + .sof_fw_filename = "sof-adl.ri", + .sof_tplg_filename = "sof-adl-rt5682.tplg", + }, {}, }; EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_adl_machines);
On Thu, 20 Jan 2022 17:02:24 -0600, Pierre-Louis Bossart wrote:
Add support for platforms without amplifier (headset codec only) and without Intel graphics.
Ajye Huang (1): ASoC: Intel: sof_rt5682: Add support for platform without amplifier
Yong Zhi (1): ASoC: Intel: sof_rt5682: add support for systems without i915 audio
[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/2] ASoC: Intel: sof_rt5682: add support for systems without i915 audio commit: 22cefca393ea3256fa7afb97cca39d5a088053f4 [2/2] ASoC: Intel: sof_rt5682: Add support for platform without amplifier commit: c8e98eaf2bcb91291b309f7f703dea345cae1411
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks, Mark
participants (2)
-
Mark Brown
-
Pierre-Louis Bossart