mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-16 00:34:20 +08:00
9bdca822cb
As we are now passing the filter data as pointers to the drivers, we can take the final step and also pass the filter function the same way. I'm keeping this change separate, as there it's less obvious that this is a net win. Upsides of this are: - The ASoC drivers are completely independent from the DMA engine implementation, which simplifies the Kconfig logic and in theory allows the same sound drivers to be built in a kernel that supports different kinds of dmaengine drivers. - Consistency with other subsystems and drivers On the other hand, we have a few downsides: - The s3c24xx-dma driver now needs to be built-in for the ac97 platform device to be instantiated on s3c2440. - samsung_dmaengine_pcm_config cannot be marked 'const' any more because the filter function pointer needs to be set at runtime. This is safe as long we don't have multiple different DMA engines in thet same system at runtime, but is nonetheless ugly. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
33 lines
859 B
C
33 lines
859 B
C
/*
|
|
* dma.h --
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
* under the terms of the GNU General Public License as published by the
|
|
* Free Software Foundation; either version 2 of the License, or (at your
|
|
* option) any later version.
|
|
*
|
|
* ALSA PCM interface for the Samsung SoC
|
|
*/
|
|
|
|
#ifndef _S3C_AUDIO_H
|
|
#define _S3C_AUDIO_H
|
|
|
|
#include <sound/dmaengine_pcm.h>
|
|
#include <linux/dmaengine.h>
|
|
|
|
struct s3c_dma_params {
|
|
void *slave; /* Channel ID */
|
|
dma_addr_t dma_addr;
|
|
int dma_size; /* Size of the DMA transfer */
|
|
char *ch_name;
|
|
struct snd_dmaengine_dai_dma_data dma_data;
|
|
};
|
|
|
|
void samsung_asoc_init_dma_data(struct snd_soc_dai *dai,
|
|
struct s3c_dma_params *playback,
|
|
struct s3c_dma_params *capture);
|
|
int samsung_asoc_dma_platform_register(struct device *dev,
|
|
dma_filter_fn fn);
|
|
|
|
#endif
|