Skip to content

Commit 44567d3

Browse files
brentlubroonie
authored andcommitted
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 <[email protected]> Signed-off-by: Brent Lu <[email protected]> Signed-off-by: Pierre-Louis Bossart <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 8d6114b commit 44567d3

File tree

1 file changed

+36
-12
lines changed

1 file changed

+36
-12
lines changed

sound/soc/intel/boards/sof_rt5682.c

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,14 @@ sof_card_dai_links_create(struct device *dev, struct snd_soc_card *card,
635635
return 0;
636636
}
637637

638+
#define GLK_LINK_ORDER SOF_LINK_ORDER(SOF_LINK_AMP, \
639+
SOF_LINK_CODEC, \
640+
SOF_LINK_DMIC01, \
641+
SOF_LINK_IDISP_HDMI, \
642+
SOF_LINK_NONE, \
643+
SOF_LINK_NONE, \
644+
SOF_LINK_NONE)
645+
638646
static int sof_audio_probe(struct platform_device *pdev)
639647
{
640648
struct snd_soc_acpi_mach *mach = pdev->dev.platform_data;
@@ -676,24 +684,34 @@ static int sof_audio_probe(struct platform_device *pdev)
676684
ctx->amp_type = CODEC_RT5650;
677685
}
678686

679-
if (ctx->amp_type == CODEC_RT1011 && soc_intel_is_cml()) {
680-
/* backward-compatible with existing cml devices */
681-
card_name = devm_kstrdup(&pdev->dev, "cml_rt1011_rt5682",
682-
GFP_KERNEL);
683-
if (!card_name)
684-
return -ENOMEM;
685-
686-
sof_audio_card_rt5682.name = card_name;
687-
}
687+
if (mach->mach_params.codec_mask & IDISP_CODEC_MASK)
688+
ctx->hdmi.idisp_codec = true;
688689

689690
if (is_legacy_cpu) {
690691
ctx->rt5682.is_legacy_cpu = true;
691692
ctx->dmic_be_num = 0;
692693
/* HDMI is not supported by SOF on Baytrail/CherryTrail */
693694
ctx->hdmi_num = 0;
694-
} else {
695-
if (mach->mach_params.codec_mask & IDISP_CODEC_MASK)
696-
ctx->hdmi.idisp_codec = true;
695+
} else if (soc_intel_is_glk()) {
696+
/* dmic16k not support */
697+
ctx->dmic_be_num = 1;
698+
699+
/* overwrite the DAI link order for GLK boards */
700+
ctx->link_order_overwrite = GLK_LINK_ORDER;
701+
} else if (soc_intel_is_cml()) {
702+
/* backward-compatible with existing devices */
703+
switch (ctx->amp_type) {
704+
case CODEC_RT1011:
705+
card_name = devm_kstrdup(&pdev->dev, "cml_rt1011_rt5682",
706+
GFP_KERNEL);
707+
if (!card_name)
708+
return -ENOMEM;
709+
710+
sof_audio_card_rt5682.name = card_name;
711+
break;
712+
default:
713+
break;
714+
}
697715
}
698716

699717
/* need to get main clock from pmc */
@@ -768,6 +786,12 @@ static const struct platform_device_id board_ids[] = {
768786
{
769787
.name = "sof_rt5682",
770788
},
789+
{
790+
.name = "glk_rt5682_def",
791+
.driver_data = (kernel_ulong_t)(SOF_RT5682_MCLK_EN |
792+
SOF_SSP_PORT_CODEC(2) |
793+
SOF_SSP_PORT_AMP(1)),
794+
},
771795
{
772796
.name = "cml_rt5682_def",
773797
.driver_data = (kernel_ulong_t)(SOF_RT5682_MCLK_EN |

0 commit comments

Comments
 (0)