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

TOMOYO Linux Cross Reference
Linux/sound/soc/ti/edma-pcm.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
  2 /*
  3  * edma-pcm.c - eDMA PCM driver using dmaengine for AM3xxx, AM4xxx
  4  *
  5  * Copyright (C) 2014 Texas Instruments, Inc.
  6  *
  7  * Author: Peter Ujfalusi <peter.ujfalusi@ti.com>
  8  *
  9  * Based on: sound/soc/tegra/tegra_pcm.c
 10  */
 11 
 12 #include <linux/module.h>
 13 #include <sound/core.h>
 14 #include <sound/pcm.h>
 15 #include <sound/pcm_params.h>
 16 #include <sound/soc.h>
 17 #include <sound/dmaengine_pcm.h>
 18 
 19 #include "edma-pcm.h"
 20 
 21 static const struct snd_pcm_hardware edma_pcm_hardware = {
 22         .info                   = SNDRV_PCM_INFO_MMAP |
 23                                   SNDRV_PCM_INFO_MMAP_VALID |
 24                                   SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME |
 25                                   SNDRV_PCM_INFO_NO_PERIOD_WAKEUP |
 26                                   SNDRV_PCM_INFO_INTERLEAVED,
 27         .buffer_bytes_max       = 128 * 1024,
 28         .period_bytes_min       = 32,
 29         .period_bytes_max       = 64 * 1024,
 30         .periods_min            = 2,
 31         .periods_max            = 19, /* Limit by edma dmaengine driver */
 32 };
 33 
 34 static const struct snd_dmaengine_pcm_config edma_dmaengine_pcm_config = {
 35         .pcm_hardware = &edma_pcm_hardware,
 36         .prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config,
 37         .prealloc_buffer_size = 128 * 1024,
 38 };
 39 
 40 int edma_pcm_platform_register(struct device *dev)
 41 {
 42         struct snd_dmaengine_pcm_config *config;
 43 
 44         if (dev->of_node)
 45                 return devm_snd_dmaengine_pcm_register(dev,
 46                                                 &edma_dmaengine_pcm_config, 0);
 47 
 48         config = devm_kzalloc(dev, sizeof(*config), GFP_KERNEL);
 49         if (!config)
 50                 return -ENOMEM;
 51 
 52         *config = edma_dmaengine_pcm_config;
 53 
 54         config->chan_names[0] = "tx";
 55         config->chan_names[1] = "rx";
 56 
 57         return devm_snd_dmaengine_pcm_register(dev, config, 0);
 58 }
 59 EXPORT_SYMBOL_GPL(edma_pcm_platform_register);
 60 
 61 MODULE_AUTHOR("Peter Ujfalusi <peter.ujfalusi@ti.com>");
 62 MODULE_DESCRIPTION("eDMA PCM ASoC platform driver");
 63 MODULE_LICENSE("GPL");
 64 

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