1 // SPDX-License-Identifier: GPL-2.0-only
3 * Machine driver for AMD Pink Sardine platform using DMIC
5 * Copyright 2022 Advanced Micro Devices, Inc.
9 #include <sound/soc-dapm.h>
10 #include <linux/module.h>
11 #include <sound/pcm.h>
12 #include <sound/pcm_params.h>
14 #include <linux/dmi.h>
18 #define DRV_NAME "acp_ps_mach"
20 SND_SOC_DAILINK_DEF(acp63_pdm
,
21 DAILINK_COMP_ARRAY(COMP_CPU("acp_ps_pdm_dma.0")));
23 SND_SOC_DAILINK_DEF(dmic_codec
,
24 DAILINK_COMP_ARRAY(COMP_CODEC("dmic-codec.0",
27 SND_SOC_DAILINK_DEF(pdm_platform
,
28 DAILINK_COMP_ARRAY(COMP_PLATFORM("acp_ps_pdm_dma.0")));
30 static struct snd_soc_dai_link acp63_dai_pdm
[] = {
32 .name
= "acp63-dmic-capture",
33 .stream_name
= "DMIC capture",
35 SND_SOC_DAILINK_REG(acp63_pdm
, dmic_codec
, pdm_platform
),
39 static struct snd_soc_card acp63_card
= {
42 .dai_link
= acp63_dai_pdm
,
46 static int acp63_probe(struct platform_device
*pdev
)
48 struct acp63_pdm
*machine
= NULL
;
49 struct snd_soc_card
*card
;
52 platform_set_drvdata(pdev
, &acp63_card
);
53 card
= platform_get_drvdata(pdev
);
54 acp63_card
.dev
= &pdev
->dev
;
56 snd_soc_card_set_drvdata(card
, machine
);
57 ret
= devm_snd_soc_register_card(&pdev
->dev
, card
);
59 return dev_err_probe(&pdev
->dev
, ret
,
60 "snd_soc_register_card(%s) failed\n",
67 static struct platform_driver acp63_mach_driver
= {
69 .name
= "acp_ps_mach",
70 .pm
= &snd_soc_pm_ops
,
75 module_platform_driver(acp63_mach_driver
);
77 MODULE_AUTHOR("Syed.SabaKareem@amd.com");
78 MODULE_DESCRIPTION("AMD Pink Sardine support for DMIC");
79 MODULE_LICENSE("GPL v2");
80 MODULE_ALIAS("platform:" DRV_NAME
);