0001
0002
0003
0004
0005
0006
0007 #include <sound/soc.h>
0008 #include <sound/soc-dapm.h>
0009 #include <linux/module.h>
0010 #include <sound/pcm.h>
0011 #include <sound/pcm_params.h>
0012 #include <linux/io.h>
0013
0014 #include "rn_acp3x.h"
0015
0016 #define DRV_NAME "acp_pdm_mach"
0017
0018 SND_SOC_DAILINK_DEF(acp_pdm,
0019 DAILINK_COMP_ARRAY(COMP_CPU("acp_rn_pdm_dma.0")));
0020
0021 SND_SOC_DAILINK_DEF(dmic_codec,
0022 DAILINK_COMP_ARRAY(COMP_CODEC("dmic-codec.0",
0023 "dmic-hifi")));
0024
0025 SND_SOC_DAILINK_DEF(platform,
0026 DAILINK_COMP_ARRAY(COMP_PLATFORM("acp_rn_pdm_dma.0")));
0027
0028 static struct snd_soc_dai_link acp_dai_pdm[] = {
0029 {
0030 .name = "acp3x-dmic-capture",
0031 .stream_name = "DMIC capture",
0032 .capture_only = 1,
0033 SND_SOC_DAILINK_REG(acp_pdm, dmic_codec, platform),
0034 },
0035 };
0036
0037 static struct snd_soc_card acp_card = {
0038 .name = "acp",
0039 .owner = THIS_MODULE,
0040 .dai_link = acp_dai_pdm,
0041 .num_links = 1,
0042 };
0043
0044 static int acp_probe(struct platform_device *pdev)
0045 {
0046 int ret;
0047 struct acp_pdm *machine = NULL;
0048 struct snd_soc_card *card;
0049
0050 card = &acp_card;
0051 acp_card.dev = &pdev->dev;
0052
0053 platform_set_drvdata(pdev, card);
0054 snd_soc_card_set_drvdata(card, machine);
0055 ret = devm_snd_soc_register_card(&pdev->dev, card);
0056 if (ret) {
0057 return dev_err_probe(&pdev->dev, ret,
0058 "snd_soc_register_card(%s) failed\n",
0059 card->name);
0060 }
0061 return 0;
0062 }
0063
0064 static struct platform_driver acp_mach_driver = {
0065 .driver = {
0066 .name = "acp_pdm_mach",
0067 .pm = &snd_soc_pm_ops,
0068 },
0069 .probe = acp_probe,
0070 };
0071
0072 module_platform_driver(acp_mach_driver);
0073
0074 MODULE_AUTHOR("Vijendar.Mukunda@amd.com");
0075 MODULE_LICENSE("GPL v2");
0076 MODULE_ALIAS("platform:" DRV_NAME);