Skip to content

Commit 6136d87

Browse files
brentlubroonie
authored andcommitted
ASoC: Intel: sof_rt5682: support ALC1011 on cml boards
For cml boards, ALC1011 speaker amplifier is supported by machine driver cml_rt1011_rt5682. Use same driver name for backward compatibility with existing devices on market. Reviewed-by: Chao Song <chao.song@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/20240411220347.131267-11-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 551fb55 commit 6136d87

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

sound/soc/intel/boards/sof_rt5682.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,7 @@ static int sof_audio_probe(struct platform_device *pdev)
606606
{
607607
struct snd_soc_acpi_mach *mach = pdev->dev.platform_data;
608608
struct sof_card_private *ctx;
609+
char *card_name;
609610
bool is_legacy_cpu = false;
610611
int ret;
611612

@@ -631,14 +632,27 @@ static int sof_audio_probe(struct platform_device *pdev)
631632
return -ENOMEM;
632633

633634
if (ctx->codec_type == CODEC_RT5650) {
634-
sof_audio_card_rt5682.name = devm_kstrdup(&pdev->dev, "rt5650",
635-
GFP_KERNEL);
635+
card_name = devm_kstrdup(&pdev->dev, "rt5650", GFP_KERNEL);
636+
if (!card_name)
637+
return -ENOMEM;
638+
639+
sof_audio_card_rt5682.name = card_name;
636640

637641
/* create speaker dai link also */
638642
if (ctx->amp_type == CODEC_NONE)
639643
ctx->amp_type = CODEC_RT5650;
640644
}
641645

646+
if (ctx->amp_type == CODEC_RT1011 && soc_intel_is_cml()) {
647+
/* backward-compatible with existing cml devices */
648+
card_name = devm_kstrdup(&pdev->dev, "cml_rt1011_rt5682",
649+
GFP_KERNEL);
650+
if (!card_name)
651+
return -ENOMEM;
652+
653+
sof_audio_card_rt5682.name = card_name;
654+
}
655+
642656
if (is_legacy_cpu) {
643657
ctx->rt5682.is_legacy_cpu = true;
644658
ctx->dmic_be_num = 0;

0 commit comments

Comments
 (0)