Skip to content

Commit 5a2bc76

Browse files
brentlubroonie
authored andcommitted
ASoC: Intel: sof_da7219: support MAX98390 on cml boards
For cml boards, MAX98390 speaker amplifier is supported by machine driver bxt_da7219_max98357a with sound card name cml_max98390_da7219. Use same name for backward compatibility with existing devices on market. 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 a0cf86d commit 5a2bc76

File tree

1 file changed

+28
-5
lines changed

1 file changed

+28
-5
lines changed

sound/soc/intel/boards/sof_da7219.c

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ static int audio_probe(struct platform_device *pdev)
313313
{
314314
struct snd_soc_acpi_mach *mach = pdev->dev.platform_data;
315315
struct sof_card_private *ctx;
316+
char *card_name;
316317
unsigned long board_quirk = 0;
317318
int ret;
318319

@@ -332,6 +333,21 @@ static int audio_probe(struct platform_device *pdev)
332333
if (board_quirk & SOF_DA7219_CML_BOARD) {
333334
/* overwrite the DAI link order for CML boards */
334335
ctx->link_order_overwrite = CML_LINK_ORDER;
336+
337+
/* backward-compatible with existing devices */
338+
switch (ctx->amp_type) {
339+
case CODEC_MAX98390:
340+
card_name = devm_kstrdup(&pdev->dev,
341+
"cml_max98390_da7219",
342+
GFP_KERNEL);
343+
if (!card_name)
344+
return -ENOMEM;
345+
346+
card_da7219.name = card_name;
347+
break;
348+
default:
349+
break;
350+
}
335351
} else if (board_quirk & SOF_DA7219_JSL_BOARD) {
336352
ctx->da7219.is_jsl_board = true;
337353

@@ -341,13 +357,20 @@ static int audio_probe(struct platform_device *pdev)
341357
/* backward-compatible with existing devices */
342358
switch (ctx->amp_type) {
343359
case CODEC_MAX98360A:
344-
card_da7219.name = devm_kstrdup(&pdev->dev,
345-
"da7219max98360a",
346-
GFP_KERNEL);
360+
card_name = devm_kstrdup(&pdev->dev, "da7219max98360a",
361+
GFP_KERNEL);
362+
if (!card_name)
363+
return -ENOMEM;
364+
365+
card_da7219.name = card_name;
347366
break;
348367
case CODEC_MAX98373:
349-
card_da7219.name = devm_kstrdup(&pdev->dev, "da7219max",
350-
GFP_KERNEL);
368+
card_name = devm_kstrdup(&pdev->dev, "da7219max",
369+
GFP_KERNEL);
370+
if (!card_name)
371+
return -ENOMEM;
372+
373+
card_da7219.name = card_name;
351374
break;
352375
default:
353376
break;

0 commit comments

Comments
 (0)