ASoC: pxa: remove snd_pcm_ops
snd_pcm_ops is no longer needed. Let's use component driver callback. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87o8yz90e9.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
540e59c68b
commit
f8772e17de
|
@ -10,6 +10,7 @@ struct snd_pcm_substream;
|
|||
struct snd_pcm_hw_params;
|
||||
struct snd_soc_pcm_runtime;
|
||||
struct snd_pcm;
|
||||
struct snd_soc_component;
|
||||
|
||||
extern int pxa2xx_pcm_hw_params(struct snd_pcm_substream *substream,
|
||||
struct snd_pcm_hw_params *params);
|
||||
|
@ -23,8 +24,29 @@ extern int pxa2xx_pcm_mmap(struct snd_pcm_substream *substream,
|
|||
struct vm_area_struct *vma);
|
||||
extern int pxa2xx_pcm_preallocate_dma_buffer(struct snd_pcm *pcm, int stream);
|
||||
extern void pxa2xx_pcm_free_dma_buffers(struct snd_pcm *pcm);
|
||||
extern int pxa2xx_soc_pcm_new(struct snd_soc_pcm_runtime *rtd);
|
||||
extern const struct snd_pcm_ops pxa2xx_pcm_ops;
|
||||
extern void pxa2xx_soc_pcm_free(struct snd_soc_component *component,
|
||||
struct snd_pcm *pcm);
|
||||
extern int pxa2xx_soc_pcm_new(struct snd_soc_component *component,
|
||||
struct snd_soc_pcm_runtime *rtd);
|
||||
extern int pxa2xx_soc_pcm_open(struct snd_soc_component *component,
|
||||
struct snd_pcm_substream *substream);
|
||||
extern int pxa2xx_soc_pcm_close(struct snd_soc_component *component,
|
||||
struct snd_pcm_substream *substream);
|
||||
extern int pxa2xx_soc_pcm_hw_params(struct snd_soc_component *component,
|
||||
struct snd_pcm_substream *substream,
|
||||
struct snd_pcm_hw_params *params);
|
||||
extern int pxa2xx_soc_pcm_hw_free(struct snd_soc_component *component,
|
||||
struct snd_pcm_substream *substream);
|
||||
extern int pxa2xx_soc_pcm_prepare(struct snd_soc_component *component,
|
||||
struct snd_pcm_substream *substream);
|
||||
extern int pxa2xx_soc_pcm_trigger(struct snd_soc_component *component,
|
||||
struct snd_pcm_substream *substream, int cmd);
|
||||
extern snd_pcm_uframes_t
|
||||
pxa2xx_soc_pcm_pointer(struct snd_soc_component *component,
|
||||
struct snd_pcm_substream *substream);
|
||||
extern int pxa2xx_soc_pcm_mmap(struct snd_soc_component *component,
|
||||
struct snd_pcm_substream *substream,
|
||||
struct vm_area_struct *vma);
|
||||
|
||||
/* AC97 */
|
||||
|
||||
|
|
|
@ -175,7 +175,15 @@ void pxa2xx_pcm_free_dma_buffers(struct snd_pcm *pcm)
|
|||
}
|
||||
EXPORT_SYMBOL(pxa2xx_pcm_free_dma_buffers);
|
||||
|
||||
int pxa2xx_soc_pcm_new(struct snd_soc_pcm_runtime *rtd)
|
||||
void pxa2xx_soc_pcm_free(struct snd_soc_component *component,
|
||||
struct snd_pcm *pcm)
|
||||
{
|
||||
pxa2xx_pcm_free_dma_buffers(pcm);
|
||||
}
|
||||
EXPORT_SYMBOL(pxa2xx_soc_pcm_free);
|
||||
|
||||
int pxa2xx_soc_pcm_new(struct snd_soc_component *component,
|
||||
struct snd_soc_pcm_runtime *rtd)
|
||||
{
|
||||
struct snd_card *card = rtd->card->snd_card;
|
||||
struct snd_pcm *pcm = rtd->pcm;
|
||||
|
@ -203,18 +211,64 @@ int pxa2xx_soc_pcm_new(struct snd_soc_pcm_runtime *rtd)
|
|||
}
|
||||
EXPORT_SYMBOL(pxa2xx_soc_pcm_new);
|
||||
|
||||
const struct snd_pcm_ops pxa2xx_pcm_ops = {
|
||||
.open = pxa2xx_pcm_open,
|
||||
.close = pxa2xx_pcm_close,
|
||||
.ioctl = snd_pcm_lib_ioctl,
|
||||
.hw_params = pxa2xx_pcm_hw_params,
|
||||
.hw_free = pxa2xx_pcm_hw_free,
|
||||
.prepare = pxa2xx_pcm_prepare,
|
||||
.trigger = pxa2xx_pcm_trigger,
|
||||
.pointer = pxa2xx_pcm_pointer,
|
||||
.mmap = pxa2xx_pcm_mmap,
|
||||
};
|
||||
EXPORT_SYMBOL(pxa2xx_pcm_ops);
|
||||
int pxa2xx_soc_pcm_open(struct snd_soc_component *component,
|
||||
struct snd_pcm_substream *substream)
|
||||
{
|
||||
return pxa2xx_pcm_open(substream);
|
||||
}
|
||||
EXPORT_SYMBOL(pxa2xx_soc_pcm_open);
|
||||
|
||||
int pxa2xx_soc_pcm_close(struct snd_soc_component *component,
|
||||
struct snd_pcm_substream *substream)
|
||||
{
|
||||
return pxa2xx_pcm_close(substream);
|
||||
}
|
||||
EXPORT_SYMBOL(pxa2xx_soc_pcm_close);
|
||||
|
||||
int pxa2xx_soc_pcm_hw_params(struct snd_soc_component *component,
|
||||
struct snd_pcm_substream *substream,
|
||||
struct snd_pcm_hw_params *params)
|
||||
{
|
||||
return pxa2xx_pcm_hw_params(substream, params);
|
||||
}
|
||||
EXPORT_SYMBOL(pxa2xx_soc_pcm_hw_params);
|
||||
|
||||
int pxa2xx_soc_pcm_hw_free(struct snd_soc_component *component,
|
||||
struct snd_pcm_substream *substream)
|
||||
{
|
||||
return pxa2xx_pcm_hw_free(substream);
|
||||
}
|
||||
EXPORT_SYMBOL(pxa2xx_soc_pcm_hw_free);
|
||||
|
||||
int pxa2xx_soc_pcm_prepare(struct snd_soc_component *component,
|
||||
struct snd_pcm_substream *substream)
|
||||
{
|
||||
return pxa2xx_pcm_prepare(substream);
|
||||
}
|
||||
EXPORT_SYMBOL(pxa2xx_soc_pcm_prepare);
|
||||
|
||||
int pxa2xx_soc_pcm_trigger(struct snd_soc_component *component,
|
||||
struct snd_pcm_substream *substream, int cmd)
|
||||
{
|
||||
return pxa2xx_pcm_trigger(substream, cmd);
|
||||
}
|
||||
EXPORT_SYMBOL(pxa2xx_soc_pcm_trigger);
|
||||
|
||||
snd_pcm_uframes_t
|
||||
pxa2xx_soc_pcm_pointer(struct snd_soc_component *component,
|
||||
struct snd_pcm_substream *substream)
|
||||
{
|
||||
return pxa2xx_pcm_pointer(substream);
|
||||
}
|
||||
EXPORT_SYMBOL(pxa2xx_soc_pcm_pointer);
|
||||
|
||||
int pxa2xx_soc_pcm_mmap(struct snd_soc_component *component,
|
||||
struct snd_pcm_substream *substream,
|
||||
struct vm_area_struct *vma)
|
||||
{
|
||||
return pxa2xx_pcm_mmap(substream, vma);
|
||||
}
|
||||
EXPORT_SYMBOL(pxa2xx_soc_pcm_mmap);
|
||||
|
||||
MODULE_AUTHOR("Nicolas Pitre");
|
||||
MODULE_DESCRIPTION("Intel PXA2xx sound library");
|
||||
|
|
|
@ -869,9 +869,17 @@ static struct snd_soc_dai_driver pxa_ssp_dai = {
|
|||
|
||||
static const struct snd_soc_component_driver pxa_ssp_component = {
|
||||
.name = "pxa-ssp",
|
||||
.ops = &pxa2xx_pcm_ops,
|
||||
.pcm_new = pxa2xx_soc_pcm_new,
|
||||
.pcm_free = pxa2xx_pcm_free_dma_buffers,
|
||||
.pcm_construct = pxa2xx_soc_pcm_new,
|
||||
.pcm_destruct = pxa2xx_soc_pcm_free,
|
||||
.open = pxa2xx_soc_pcm_open,
|
||||
.close = pxa2xx_soc_pcm_close,
|
||||
.ioctl = snd_soc_pcm_lib_ioctl,
|
||||
.hw_params = pxa2xx_soc_pcm_hw_params,
|
||||
.hw_free = pxa2xx_soc_pcm_hw_free,
|
||||
.prepare = pxa2xx_soc_pcm_prepare,
|
||||
.trigger = pxa2xx_soc_pcm_trigger,
|
||||
.pointer = pxa2xx_soc_pcm_pointer,
|
||||
.mmap = pxa2xx_soc_pcm_mmap,
|
||||
};
|
||||
|
||||
#ifdef CONFIG_OF
|
||||
|
|
|
@ -204,9 +204,17 @@ static struct snd_soc_dai_driver pxa_ac97_dai_driver[] = {
|
|||
|
||||
static const struct snd_soc_component_driver pxa_ac97_component = {
|
||||
.name = "pxa-ac97",
|
||||
.ops = &pxa2xx_pcm_ops,
|
||||
.pcm_new = pxa2xx_soc_pcm_new,
|
||||
.pcm_free = pxa2xx_pcm_free_dma_buffers,
|
||||
.pcm_construct = pxa2xx_soc_pcm_new,
|
||||
.pcm_destruct = pxa2xx_soc_pcm_free,
|
||||
.open = pxa2xx_soc_pcm_open,
|
||||
.close = pxa2xx_soc_pcm_close,
|
||||
.ioctl = snd_soc_pcm_lib_ioctl,
|
||||
.hw_params = pxa2xx_soc_pcm_hw_params,
|
||||
.hw_free = pxa2xx_soc_pcm_hw_free,
|
||||
.prepare = pxa2xx_soc_pcm_prepare,
|
||||
.trigger = pxa2xx_soc_pcm_trigger,
|
||||
.pointer = pxa2xx_soc_pcm_pointer,
|
||||
.mmap = pxa2xx_soc_pcm_mmap,
|
||||
};
|
||||
|
||||
#ifdef CONFIG_OF
|
||||
|
|
|
@ -360,9 +360,17 @@ static struct snd_soc_dai_driver pxa_i2s_dai = {
|
|||
|
||||
static const struct snd_soc_component_driver pxa_i2s_component = {
|
||||
.name = "pxa-i2s",
|
||||
.ops = &pxa2xx_pcm_ops,
|
||||
.pcm_new = pxa2xx_soc_pcm_new,
|
||||
.pcm_free = pxa2xx_pcm_free_dma_buffers,
|
||||
.pcm_construct = pxa2xx_soc_pcm_new,
|
||||
.pcm_destruct = pxa2xx_soc_pcm_free,
|
||||
.open = pxa2xx_soc_pcm_open,
|
||||
.close = pxa2xx_soc_pcm_close,
|
||||
.ioctl = snd_soc_pcm_lib_ioctl,
|
||||
.hw_params = pxa2xx_soc_pcm_hw_params,
|
||||
.hw_free = pxa2xx_soc_pcm_hw_free,
|
||||
.prepare = pxa2xx_soc_pcm_prepare,
|
||||
.trigger = pxa2xx_soc_pcm_trigger,
|
||||
.pointer = pxa2xx_soc_pcm_pointer,
|
||||
.mmap = pxa2xx_soc_pcm_mmap,
|
||||
};
|
||||
|
||||
static int pxa2xx_i2s_drv_probe(struct platform_device *pdev)
|
||||
|
|
|
@ -18,9 +18,17 @@
|
|||
#include <sound/dmaengine_pcm.h>
|
||||
|
||||
static const struct snd_soc_component_driver pxa2xx_soc_platform = {
|
||||
.ops = &pxa2xx_pcm_ops,
|
||||
.pcm_new = pxa2xx_soc_pcm_new,
|
||||
.pcm_free = pxa2xx_pcm_free_dma_buffers,
|
||||
.pcm_construct = pxa2xx_soc_pcm_new,
|
||||
.pcm_destruct = pxa2xx_soc_pcm_free,
|
||||
.open = pxa2xx_soc_pcm_open,
|
||||
.close = pxa2xx_soc_pcm_close,
|
||||
.ioctl = snd_soc_pcm_lib_ioctl,
|
||||
.hw_params = pxa2xx_soc_pcm_hw_params,
|
||||
.hw_free = pxa2xx_soc_pcm_hw_free,
|
||||
.prepare = pxa2xx_soc_pcm_prepare,
|
||||
.trigger = pxa2xx_soc_pcm_trigger,
|
||||
.pointer = pxa2xx_soc_pcm_pointer,
|
||||
.mmap = pxa2xx_soc_pcm_mmap,
|
||||
};
|
||||
|
||||
static int pxa2xx_soc_platform_probe(struct platform_device *pdev)
|
||||
|
|
Loading…
Reference in New Issue