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) 2022 Advanced Micro Devices, Inc.
8 // Authors: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
11 * Hardware interface for Audio DSP on Rembrandt 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_HS_INSTANCE 0
23 #define I2S_BT_INSTANCE 1
24 #define I2S_SP_INSTANCE 2
25 #define PDM_DMIC_INSTANCE 3
26 #define I2S_HS_VIRTUAL_INSTANCE 4
28 static struct snd_soc_dai_driver rembrandt_sof_dai
[] = {
30 .id
= I2S_HS_INSTANCE
,
33 .rates
= SNDRV_PCM_RATE_8000_96000
,
34 .formats
= SNDRV_PCM_FMTBIT_S16_LE
| SNDRV_PCM_FMTBIT_S8
|
35 SNDRV_PCM_FMTBIT_U8
| SNDRV_PCM_FMTBIT_S32_LE
,
42 .rates
= SNDRV_PCM_RATE_8000_48000
,
43 .formats
= SNDRV_PCM_FMTBIT_S16_LE
| SNDRV_PCM_FMTBIT_S8
|
44 SNDRV_PCM_FMTBIT_U8
| SNDRV_PCM_FMTBIT_S32_LE
,
45 /* Supporting only stereo for I2S HS controller capture */
54 .id
= I2S_BT_INSTANCE
,
57 .rates
= SNDRV_PCM_RATE_8000_96000
,
58 .formats
= SNDRV_PCM_FMTBIT_S16_LE
| SNDRV_PCM_FMTBIT_S8
|
59 SNDRV_PCM_FMTBIT_U8
| SNDRV_PCM_FMTBIT_S32_LE
,
66 .rates
= SNDRV_PCM_RATE_8000_48000
,
67 .formats
= SNDRV_PCM_FMTBIT_S16_LE
| SNDRV_PCM_FMTBIT_S8
|
68 SNDRV_PCM_FMTBIT_U8
| SNDRV_PCM_FMTBIT_S32_LE
,
69 /* Supporting only stereo for I2S BT controller capture */
78 .id
= I2S_SP_INSTANCE
,
81 .rates
= SNDRV_PCM_RATE_8000_96000
,
82 .formats
= SNDRV_PCM_FMTBIT_S16_LE
| SNDRV_PCM_FMTBIT_S8
|
83 SNDRV_PCM_FMTBIT_U8
| SNDRV_PCM_FMTBIT_S32_LE
,
90 .rates
= SNDRV_PCM_RATE_8000_48000
,
91 .formats
= SNDRV_PCM_FMTBIT_S16_LE
| SNDRV_PCM_FMTBIT_S8
|
92 SNDRV_PCM_FMTBIT_U8
| SNDRV_PCM_FMTBIT_S32_LE
,
93 /* Supporting only stereo for I2S SP controller capture */
101 [PDM_DMIC_INSTANCE
] = {
102 .id
= PDM_DMIC_INSTANCE
,
103 .name
= "acp-sof-dmic",
105 .rates
= SNDRV_PCM_RATE_8000_48000
,
106 .formats
= SNDRV_PCM_FMTBIT_S32_LE
,
114 [I2S_HS_VIRTUAL_INSTANCE
] = {
115 .id
= I2S_HS_VIRTUAL_INSTANCE
,
116 .name
= "acp-sof-hs-virtual",
118 .rates
= SNDRV_PCM_RATE_8000_96000
,
119 .formats
= SNDRV_PCM_FMTBIT_S16_LE
| SNDRV_PCM_FMTBIT_S8
|
120 SNDRV_PCM_FMTBIT_U8
| SNDRV_PCM_FMTBIT_S32_LE
,
130 struct snd_sof_dsp_ops sof_rembrandt_ops
;
131 EXPORT_SYMBOL_NS(sof_rembrandt_ops
, "SND_SOC_SOF_AMD_COMMON");
133 int sof_rembrandt_ops_init(struct snd_sof_dev
*sdev
)
135 /* common defaults */
136 memcpy(&sof_rembrandt_ops
, &sof_acp_common_ops
, sizeof(struct snd_sof_dsp_ops
));
138 sof_rembrandt_ops
.drv
= rembrandt_sof_dai
;
139 sof_rembrandt_ops
.num_drv
= ARRAY_SIZE(rembrandt_sof_dai
);