WIP FPC-III support
[linux/fpc-iii.git] / sound / soc / amd / renoir / acp3x-rn.c
blob306134b89a827e9a53e60045283ff5f601bce077
1 // SPDX-License-Identifier: GPL-2.0+
2 //
3 // Machine driver for AMD Renoir platform using DMIC
4 //
5 //Copyright 2020 Advanced Micro Devices, Inc.
7 #include <sound/soc.h>
8 #include <sound/soc-dapm.h>
9 #include <linux/module.h>
10 #include <sound/pcm.h>
11 #include <sound/pcm_params.h>
12 #include <linux/io.h>
14 #include "rn_acp3x.h"
16 #define DRV_NAME "acp_pdm_mach"
18 SND_SOC_DAILINK_DEF(acp_pdm,
19 DAILINK_COMP_ARRAY(COMP_CPU("acp_rn_pdm_dma.0")));
21 SND_SOC_DAILINK_DEF(dmic_codec,
22 DAILINK_COMP_ARRAY(COMP_CODEC("dmic-codec.0",
23 "dmic-hifi")));
25 SND_SOC_DAILINK_DEF(platform,
26 DAILINK_COMP_ARRAY(COMP_PLATFORM("acp_rn_pdm_dma.0")));
28 static struct snd_soc_dai_link acp_dai_pdm[] = {
30 .name = "acp3x-dmic-capture",
31 .stream_name = "DMIC capture",
32 .capture_only = 1,
33 SND_SOC_DAILINK_REG(acp_pdm, dmic_codec, platform),
37 static struct snd_soc_card acp_card = {
38 .name = "acp",
39 .owner = THIS_MODULE,
40 .dai_link = acp_dai_pdm,
41 .num_links = 1,
44 static int acp_probe(struct platform_device *pdev)
46 int ret;
47 struct acp_pdm *machine = NULL;
48 struct snd_soc_card *card;
50 card = &acp_card;
51 acp_card.dev = &pdev->dev;
53 platform_set_drvdata(pdev, card);
54 snd_soc_card_set_drvdata(card, machine);
55 ret = devm_snd_soc_register_card(&pdev->dev, card);
56 if (ret) {
57 dev_err(&pdev->dev,
58 "snd_soc_register_card(%s) failed: %d\n",
59 acp_card.name, ret);
60 return ret;
62 return 0;
65 static struct platform_driver acp_mach_driver = {
66 .driver = {
67 .name = "acp_pdm_mach",
68 .pm = &snd_soc_pm_ops,
70 .probe = acp_probe,
73 module_platform_driver(acp_mach_driver);
75 MODULE_AUTHOR("Vijendar.Mukunda@amd.com");
76 MODULE_LICENSE("GPL v2");
77 MODULE_ALIAS("platform:" DRV_NAME);