1 // SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause)
3 // This file is provided under a dual BSD/GPLv2 license. When using or
4 // redistributing this file, you may do so under either license.
6 // Copyright(c) 2021 Advanced Micro Devices, Inc.
8 // Authors: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
11 * Hardware interface for Audio DSP on Renoir platform
14 #include <linux/platform_device.h>
15 #include <linux/module.h>
18 #include "../sof-audio.h"
20 #include "acp-dsp-offset.h"
22 #define I2S_BT_INSTANCE 0
23 #define I2S_SP_INSTANCE 1
24 #define PDM_DMIC_INSTANCE 2
25 #define I2S_SP_VIRTUAL_INSTANCE 3
27 static struct snd_soc_dai_driver renoir_sof_dai
[] = {
29 .id
= I2S_BT_INSTANCE
,
32 .rates
= SNDRV_PCM_RATE_8000_96000
,
33 .formats
= SNDRV_PCM_FMTBIT_S16_LE
| SNDRV_PCM_FMTBIT_S8
|
34 SNDRV_PCM_FMTBIT_U8
| SNDRV_PCM_FMTBIT_S32_LE
,
41 .rates
= SNDRV_PCM_RATE_8000_48000
,
42 .formats
= SNDRV_PCM_FMTBIT_S16_LE
| SNDRV_PCM_FMTBIT_S8
|
43 SNDRV_PCM_FMTBIT_U8
| SNDRV_PCM_FMTBIT_S32_LE
,
44 /* Supporting only stereo for I2S BT controller capture */
53 .id
= I2S_SP_INSTANCE
,
56 .rates
= SNDRV_PCM_RATE_8000_96000
,
57 .formats
= SNDRV_PCM_FMTBIT_S16_LE
| SNDRV_PCM_FMTBIT_S8
|
58 SNDRV_PCM_FMTBIT_U8
| SNDRV_PCM_FMTBIT_S32_LE
,
65 .rates
= SNDRV_PCM_RATE_8000_48000
,
66 .formats
= SNDRV_PCM_FMTBIT_S16_LE
| SNDRV_PCM_FMTBIT_S8
|
67 SNDRV_PCM_FMTBIT_U8
| SNDRV_PCM_FMTBIT_S32_LE
,
68 /* Supporting only stereo for I2S SP controller capture */
76 [PDM_DMIC_INSTANCE
] = {
77 .id
= PDM_DMIC_INSTANCE
,
78 .name
= "acp-sof-dmic",
80 .rates
= SNDRV_PCM_RATE_8000_48000
,
81 .formats
= SNDRV_PCM_FMTBIT_S32_LE
,
89 [I2S_SP_VIRTUAL_INSTANCE
] = {
90 .id
= I2S_SP_VIRTUAL_INSTANCE
,
91 .name
= "acp-sof-sp-virtual",
93 .rates
= SNDRV_PCM_RATE_8000_96000
,
94 .formats
= SNDRV_PCM_FMTBIT_S16_LE
| SNDRV_PCM_FMTBIT_S8
|
95 SNDRV_PCM_FMTBIT_U8
| SNDRV_PCM_FMTBIT_S32_LE
,
105 struct snd_sof_dsp_ops sof_renoir_ops
;
106 EXPORT_SYMBOL_NS(sof_renoir_ops
, "SND_SOC_SOF_AMD_COMMON");
108 int sof_renoir_ops_init(struct snd_sof_dev
*sdev
)
110 /* common defaults */
111 memcpy(&sof_renoir_ops
, &sof_acp_common_ops
, sizeof(struct snd_sof_dsp_ops
));
113 sof_renoir_ops
.drv
= renoir_sof_dai
;
114 sof_renoir_ops
.num_drv
= ARRAY_SIZE(renoir_sof_dai
);