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

TOMOYO Linux Cross Reference
Linux/sound/soc/sof/amd/renoir.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) 2021 Advanced Micro Devices, Inc.
  7 //
  8 // Authors: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
  9 
 10 /*
 11  * Hardware interface for Audio DSP on Renoir 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_BT_INSTANCE         0
 23 #define I2S_SP_INSTANCE         1
 24 #define PDM_DMIC_INSTANCE       2
 25 #define I2S_SP_VIRTUAL_INSTANCE 3
 26 
 27 static struct snd_soc_dai_driver renoir_sof_dai[] = {
 28         [I2S_BT_INSTANCE] = {
 29                 .id = I2S_BT_INSTANCE,
 30                 .name = "acp-sof-bt",
 31                 .playback = {
 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,
 35                         .channels_min = 2,
 36                         .channels_max = 8,
 37                         .rate_min = 8000,
 38                         .rate_max = 96000,
 39                 },
 40                 .capture = {
 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 */
 45                         .channels_min = 2,
 46                         .channels_max = 2,
 47                         .rate_min = 8000,
 48                         .rate_max = 48000,
 49                 },
 50         },
 51 
 52         [I2S_SP_INSTANCE] = {
 53                 .id = I2S_SP_INSTANCE,
 54                 .name = "acp-sof-sp",
 55                 .playback = {
 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,
 59                         .channels_min = 2,
 60                         .channels_max = 8,
 61                         .rate_min = 8000,
 62                         .rate_max = 96000,
 63                 },
 64                 .capture = {
 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 */
 69                         .channels_min = 2,
 70                         .channels_max = 2,
 71                         .rate_min = 8000,
 72                         .rate_max = 48000,
 73                 },
 74         },
 75 
 76         [PDM_DMIC_INSTANCE] = {
 77                 .id = PDM_DMIC_INSTANCE,
 78                 .name = "acp-sof-dmic",
 79                 .capture = {
 80                         .rates = SNDRV_PCM_RATE_8000_48000,
 81                         .formats = SNDRV_PCM_FMTBIT_S32_LE,
 82                         .channels_min = 2,
 83                         .channels_max = 4,
 84                         .rate_min = 8000,
 85                         .rate_max = 48000,
 86                 },
 87         },
 88 
 89         [I2S_SP_VIRTUAL_INSTANCE] = {
 90                 .id = I2S_SP_VIRTUAL_INSTANCE,
 91                 .name = "acp-sof-sp-virtual",
 92                 .playback = {
 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,
 96                         .channels_min = 2,
 97                         .channels_max = 8,
 98                         .rate_min = 8000,
 99                         .rate_max = 96000,
100                 },
101         },
102 };
103 
104 /* Renoir ops */
105 struct snd_sof_dsp_ops sof_renoir_ops;
106 EXPORT_SYMBOL_NS(sof_renoir_ops, SND_SOC_SOF_AMD_COMMON);
107 
108 int sof_renoir_ops_init(struct snd_sof_dev *sdev)
109 {
110         /* common defaults */
111         memcpy(&sof_renoir_ops, &sof_acp_common_ops, sizeof(struct snd_sof_dsp_ops));
112 
113         sof_renoir_ops.drv = renoir_sof_dai;
114         sof_renoir_ops.num_drv = ARRAY_SIZE(renoir_sof_dai);
115 
116         return 0;
117 }
118 

~ [ 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