Merge tag 'microblaze-3.19-rc1' of git://git.monstr.eu/linux-2.6-microblaze
[deliverable/linux.git] / sound / soc / spear / spear_pcm.c
CommitLineData
241b446f
RK
1/*
2 * ALSA PCM interface for ST SPEAr Processors
3 *
4 * sound/soc/spear/spear_pcm.c
5 *
6 * Copyright (C) 2012 ST Microelectronics
b794dbcd 7 * Rajeev Kumar<rajeevkumar.linux@gmail.com>
241b446f
RK
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#include <linux/module.h>
15#include <linux/dmaengine.h>
241b446f 16#include <linux/platform_device.h>
241b446f
RK
17#include <sound/dmaengine_pcm.h>
18#include <sound/pcm.h>
241b446f
RK
19#include <sound/soc.h>
20#include <sound/spear_dma.h>
ede38884 21#include "spear_pcm.h"
241b446f 22
52c102e5 23static const struct snd_pcm_hardware spear_pcm_hardware = {
241b446f
RK
24 .info = (SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER |
25 SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID |
26 SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME),
27 .buffer_bytes_max = 16 * 1024, /* max buffer size */
28 .period_bytes_min = 2 * 1024, /* 1 msec data minimum period size */
29 .period_bytes_max = 2 * 1024, /* maximum period size */
30 .periods_min = 1, /* min # periods */
31 .periods_max = 8, /* max # of periods */
32 .fifo_size = 0, /* fifo size in bytes */
33};
34
52c102e5
LPC
35static const struct snd_dmaengine_pcm_config spear_dmaengine_pcm_config = {
36 .pcm_hardware = &spear_pcm_hardware,
52c102e5 37 .prealloc_buffer_size = 16 * 1024,
241b446f
RK
38};
39
e1771bcf
SW
40int devm_spear_pcm_platform_register(struct device *dev,
41 struct snd_dmaengine_pcm_config *config,
42 bool (*filter)(struct dma_chan *chan, void *slave))
241b446f 43{
e1771bcf
SW
44 *config = spear_dmaengine_pcm_config;
45 config->compat_filter_fn = filter;
46
47 return snd_dmaengine_pcm_register(dev, config,
52c102e5
LPC
48 SND_DMAENGINE_PCM_FLAG_NO_DT |
49 SND_DMAENGINE_PCM_FLAG_COMPAT);
241b446f 50}
ede38884 51EXPORT_SYMBOL_GPL(devm_spear_pcm_platform_register);
241b446f 52
b794dbcd 53MODULE_AUTHOR("Rajeev Kumar <rajeevkumar.linux@gmail.com>");
241b446f
RK
54MODULE_DESCRIPTION("SPEAr PCM DMA module");
55MODULE_LICENSE("GPL");
This page took 0.122281 seconds and 5 git commands to generate.