ASoC: Intel: sof_rt5682: add glk_rt5682_def for glk boards

Add the board config glk_rt5682_def to rt5682 machine driver for all
glk boards using default SSP port allocation (headphone codec on SSP2,
speaker amplifiers on SSP1).

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20240426152529.38345-15-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Brent Lu 2024-04-26 10:25:20 -05:00 committed by Mark Brown
parent 8d6114b81d
commit 44567d3d62
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -635,6 +635,14 @@ sof_card_dai_links_create(struct device *dev, struct snd_soc_card *card,
return 0;
}
#define GLK_LINK_ORDER SOF_LINK_ORDER(SOF_LINK_AMP, \
SOF_LINK_CODEC, \
SOF_LINK_DMIC01, \
SOF_LINK_IDISP_HDMI, \
SOF_LINK_NONE, \
SOF_LINK_NONE, \
SOF_LINK_NONE)
static int sof_audio_probe(struct platform_device *pdev)
{
struct snd_soc_acpi_mach *mach = pdev->dev.platform_data;
@ -676,24 +684,34 @@ static int sof_audio_probe(struct platform_device *pdev)
ctx->amp_type = CODEC_RT5650;
}
if (ctx->amp_type == CODEC_RT1011 && soc_intel_is_cml()) {
/* backward-compatible with existing cml devices */
card_name = devm_kstrdup(&pdev->dev, "cml_rt1011_rt5682",
GFP_KERNEL);
if (!card_name)
return -ENOMEM;
sof_audio_card_rt5682.name = card_name;
}
if (mach->mach_params.codec_mask & IDISP_CODEC_MASK)
ctx->hdmi.idisp_codec = true;
if (is_legacy_cpu) {
ctx->rt5682.is_legacy_cpu = true;
ctx->dmic_be_num = 0;
/* HDMI is not supported by SOF on Baytrail/CherryTrail */
ctx->hdmi_num = 0;
} else {
if (mach->mach_params.codec_mask & IDISP_CODEC_MASK)
ctx->hdmi.idisp_codec = true;
} else if (soc_intel_is_glk()) {
/* dmic16k not support */
ctx->dmic_be_num = 1;
/* overwrite the DAI link order for GLK boards */
ctx->link_order_overwrite = GLK_LINK_ORDER;
} else if (soc_intel_is_cml()) {
/* backward-compatible with existing devices */
switch (ctx->amp_type) {
case CODEC_RT1011:
card_name = devm_kstrdup(&pdev->dev, "cml_rt1011_rt5682",
GFP_KERNEL);
if (!card_name)
return -ENOMEM;
sof_audio_card_rt5682.name = card_name;
break;
default:
break;
}
}
/* need to get main clock from pmc */
@ -768,6 +786,12 @@ static const struct platform_device_id board_ids[] = {
{
.name = "sof_rt5682",
},
{
.name = "glk_rt5682_def",
.driver_data = (kernel_ulong_t)(SOF_RT5682_MCLK_EN |
SOF_SSP_PORT_CODEC(2) |
SOF_SSP_PORT_AMP(1)),
},
{
.name = "cml_rt5682_def",
.driver_data = (kernel_ulong_t)(SOF_RT5682_MCLK_EN |