ASoC: Intel: sof_rt5682: support MAX98357A on glk boards
authorBrent Lu <brent.lu@intel.com>
Fri, 26 Apr 2024 15:25:21 +0000 (10:25 -0500)
committerMark Brown <broonie@kernel.org>
Mon, 29 Apr 2024 14:49:14 +0000 (23:49 +0900)
For glk boards, MAX98357A speaker amplifier is supported by machine
driver glk_rt5682_mx98357a with sound card name glkrt5682max. Use same
name for backward compatibility with existing devices on market.

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-16-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/boards/sof_rt5682.c

index 80ecf31c936a4be320c1a7e021cf572b4f09314b..efca7604040ebdc8834a27c5e6b998e85f423a56 100644 (file)
@@ -698,6 +698,20 @@ static int sof_audio_probe(struct platform_device *pdev)
 
                /* overwrite the DAI link order for GLK boards */
                ctx->link_order_overwrite = GLK_LINK_ORDER;
+
+               /* backward-compatible with existing devices */
+               switch (ctx->amp_type) {
+               case CODEC_MAX98357A:
+                       card_name = devm_kstrdup(&pdev->dev, "glkrt5682max",
+                                                GFP_KERNEL);
+                       if (!card_name)
+                               return -ENOMEM;
+
+                       sof_audio_card_rt5682.name = card_name;
+                       break;
+               default:
+                       break;
+               }
        } else if (soc_intel_is_cml()) {
                /* backward-compatible with existing devices */
                switch (ctx->amp_type) {