mirror of
https://github.com/torvalds/linux.git
synced 2026-12-06 13:23:45 +00:00
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details you should have received a copy of the gnu general public license along with this program if not write to the free software foundation inc 51 franklin st fifth floor boston ma 02110 1301 usa extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 246 file(s). Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Alexios Zavras <[email protected]> Reviewed-by: Allison Randal <[email protected]> Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
73 lines
2.0 KiB
C
73 lines
2.0 KiB
C
// SPDX-License-Identifier: GPL-2.0-only
|
|
/*
|
|
* tegra_pcm.c - Tegra PCM driver
|
|
*
|
|
* Author: Stephen Warren <[email protected]>
|
|
* Copyright (C) 2010,2012 - NVIDIA, Inc.
|
|
*
|
|
* Based on code copyright/by:
|
|
*
|
|
* Copyright (c) 2009-2010, NVIDIA Corporation.
|
|
* Scott Peterson <[email protected]>
|
|
* Vijay Mali <[email protected]>
|
|
*
|
|
* Copyright (C) 2010 Google, Inc.
|
|
* Iliyan Malchev <[email protected]>
|
|
*/
|
|
|
|
#include <linux/module.h>
|
|
#include <sound/core.h>
|
|
#include <sound/pcm.h>
|
|
#include <sound/pcm_params.h>
|
|
#include <sound/soc.h>
|
|
#include <sound/dmaengine_pcm.h>
|
|
|
|
#include "tegra_pcm.h"
|
|
|
|
static const struct snd_pcm_hardware tegra_pcm_hardware = {
|
|
.info = SNDRV_PCM_INFO_MMAP |
|
|
SNDRV_PCM_INFO_MMAP_VALID |
|
|
SNDRV_PCM_INFO_INTERLEAVED,
|
|
.period_bytes_min = 1024,
|
|
.period_bytes_max = PAGE_SIZE,
|
|
.periods_min = 2,
|
|
.periods_max = 8,
|
|
.buffer_bytes_max = PAGE_SIZE * 8,
|
|
.fifo_size = 4,
|
|
};
|
|
|
|
static const struct snd_dmaengine_pcm_config tegra_dmaengine_pcm_config = {
|
|
.pcm_hardware = &tegra_pcm_hardware,
|
|
.prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config,
|
|
.prealloc_buffer_size = PAGE_SIZE * 8,
|
|
};
|
|
|
|
int tegra_pcm_platform_register(struct device *dev)
|
|
{
|
|
return snd_dmaengine_pcm_register(dev, &tegra_dmaengine_pcm_config, 0);
|
|
}
|
|
EXPORT_SYMBOL_GPL(tegra_pcm_platform_register);
|
|
|
|
int tegra_pcm_platform_register_with_chan_names(struct device *dev,
|
|
struct snd_dmaengine_pcm_config *config,
|
|
char *txdmachan, char *rxdmachan)
|
|
{
|
|
*config = tegra_dmaengine_pcm_config;
|
|
config->dma_dev = dev->parent;
|
|
config->chan_names[0] = txdmachan;
|
|
config->chan_names[1] = rxdmachan;
|
|
|
|
return snd_dmaengine_pcm_register(dev, config, 0);
|
|
}
|
|
EXPORT_SYMBOL_GPL(tegra_pcm_platform_register_with_chan_names);
|
|
|
|
void tegra_pcm_platform_unregister(struct device *dev)
|
|
{
|
|
return snd_dmaengine_pcm_unregister(dev);
|
|
}
|
|
EXPORT_SYMBOL_GPL(tegra_pcm_platform_unregister);
|
|
|
|
MODULE_AUTHOR("Stephen Warren <[email protected]>");
|
|
MODULE_DESCRIPTION("Tegra PCM ASoC driver");
|
|
MODULE_LICENSE("GPL");
|