~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/sound/soc/sof/amd/acp63.c

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 // SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause)
  2 //
  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.
  5 //
  6 // Copyright(c) 2023 Advanced Micro Devices, Inc.
  7 //
  8 // Authors: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
  9 
 10 /*
 11  * Hardware interface for Audio DSP on ACP6.3 version based platform
 12  */
 13 
 14 #include <linux/platform_device.h>
 15 #include <linux/module.h>
 16 
 17 #include "../ops.h"
 18 #include "../sof-audio.h"
 19 #include "acp.h"
 20 #include "acp-dsp-offset.h"
 21 
 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
 27 
 28 static struct snd_soc_dai_driver acp63_sof_dai[] = {
 29         [I2S_HS_INSTANCE] = {
 30                 .id = I2S_HS_INSTANCE,
 31                 .name = "acp-sof-hs",
 32                 .playback = {
 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,
 36                         .channels_min = 2,
 37                         .channels_max = 8,
 38                         .rate_min = 8000,
 39                         .rate_max = 96000,
 40                 },
 41                 .capture = {
 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 */
 46                         .channels_min = 2,
 47                         .channels_max = 2,
 48                         .rate_min = 8000,
 49                         .rate_max = 48000,
 50                 },
 51         },
 52 
 53         [I2S_BT_INSTANCE] = {
 54                 .id = I2S_BT_INSTANCE,
 55                 .name = "acp-sof-bt",
 56                 .playback = {
 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,
 60                         .channels_min = 2,
 61                         .channels_max = 8,
 62                         .rate_min = 8000,
 63                         .rate_max = 96000,
 64                 },
 65                 .capture = {
 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 */
 70                         .channels_min = 2,
 71                         .channels_max = 2,
 72                         .rate_min = 8000,
 73                         .rate_max = 48000,
 74                 },
 75         },
 76 
 77         [I2S_SP_INSTANCE] = {
 78                 .id = I2S_SP_INSTANCE,
 79                 .name = "acp-sof-sp",
 80                 .playback = {
 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,
 84                         .channels_min = 2,
 85                         .channels_max = 8,
 86                         .rate_min = 8000,
 87                         .rate_max = 96000,
 88                 },
 89                 .capture = {
 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 */
 94                         .channels_min = 2,
 95                         .channels_max = 2,
 96                         .rate_min = 8000,
 97                         .rate_max = 48000,
 98                 },
 99         },
100 
101         [PDM_DMIC_INSTANCE] = {
102                 .id = PDM_DMIC_INSTANCE,
103                 .name = "acp-sof-dmic",
104                 .capture = {
105                         .rates = SNDRV_PCM_RATE_8000_48000,
106                         .formats = SNDRV_PCM_FMTBIT_S32_LE,
107                         .channels_min = 2,
108                         .channels_max = 4,
109                         .rate_min = 8000,
110                         .rate_max = 48000,
111                 },
112         },
113 
114         [I2S_HS_VIRTUAL_INSTANCE] = {
115                 .id = I2S_HS_VIRTUAL_INSTANCE,
116                 .name = "acp-sof-hs-virtual",
117                 .playback = {
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,
121                         .channels_min = 2,
122                         .channels_max = 8,
123                         .rate_min = 8000,
124                         .rate_max = 96000,
125                 },
126         },
127 };
128 
129 /* Phoenix ops */
130 struct snd_sof_dsp_ops sof_acp63_ops;
131 EXPORT_SYMBOL_NS(sof_acp63_ops, SND_SOC_SOF_AMD_COMMON);
132 
133 int sof_acp63_ops_init(struct snd_sof_dev *sdev)
134 {
135         /* common defaults */
136         memcpy(&sof_acp63_ops, &sof_acp_common_ops, sizeof(struct snd_sof_dsp_ops));
137 
138         sof_acp63_ops.drv = acp63_sof_dai;
139         sof_acp63_ops.num_drv = ARRAY_SIZE(acp63_sof_dai);
140 
141         return 0;
142 }
143 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php