Commit dc06bd0f authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: bcm: cygnus-pcm: remove snd_pcm_ops

snd_pcm_ops is no longer needed.
Let's use component driver callback.
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87eezv90db.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 85efbc91
...@@ -376,7 +376,8 @@ static void disable_intr(struct snd_pcm_substream *substream) ...@@ -376,7 +376,8 @@ static void disable_intr(struct snd_pcm_substream *substream)
} }
static int cygnus_pcm_trigger(struct snd_pcm_substream *substream, int cmd) static int cygnus_pcm_trigger(struct snd_soc_component *component,
struct snd_pcm_substream *substream, int cmd)
{ {
int ret = 0; int ret = 0;
...@@ -577,7 +578,8 @@ static irqreturn_t cygnus_dma_irq(int irq, void *data) ...@@ -577,7 +578,8 @@ static irqreturn_t cygnus_dma_irq(int irq, void *data)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
static int cygnus_pcm_open(struct snd_pcm_substream *substream) static int cygnus_pcm_open(struct snd_soc_component *component,
struct snd_pcm_substream *substream)
{ {
struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct snd_pcm_runtime *runtime = substream->runtime; struct snd_pcm_runtime *runtime = substream->runtime;
...@@ -613,7 +615,8 @@ static int cygnus_pcm_open(struct snd_pcm_substream *substream) ...@@ -613,7 +615,8 @@ static int cygnus_pcm_open(struct snd_pcm_substream *substream)
return 0; return 0;
} }
static int cygnus_pcm_close(struct snd_pcm_substream *substream) static int cygnus_pcm_close(struct snd_soc_component *component,
struct snd_pcm_substream *substream)
{ {
struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct cygnus_aio_port *aio; struct cygnus_aio_port *aio;
...@@ -633,8 +636,9 @@ static int cygnus_pcm_close(struct snd_pcm_substream *substream) ...@@ -633,8 +636,9 @@ static int cygnus_pcm_close(struct snd_pcm_substream *substream)
return 0; return 0;
} }
static int cygnus_pcm_hw_params(struct snd_pcm_substream *substream, static int cygnus_pcm_hw_params(struct snd_soc_component *component,
struct snd_pcm_hw_params *params) struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params)
{ {
struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct snd_pcm_runtime *runtime = substream->runtime; struct snd_pcm_runtime *runtime = substream->runtime;
...@@ -649,7 +653,8 @@ static int cygnus_pcm_hw_params(struct snd_pcm_substream *substream, ...@@ -649,7 +653,8 @@ static int cygnus_pcm_hw_params(struct snd_pcm_substream *substream,
return 0; return 0;
} }
static int cygnus_pcm_hw_free(struct snd_pcm_substream *substream) static int cygnus_pcm_hw_free(struct snd_soc_component *component,
struct snd_pcm_substream *substream)
{ {
struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct cygnus_aio_port *aio; struct cygnus_aio_port *aio;
...@@ -661,7 +666,8 @@ static int cygnus_pcm_hw_free(struct snd_pcm_substream *substream) ...@@ -661,7 +666,8 @@ static int cygnus_pcm_hw_free(struct snd_pcm_substream *substream)
return 0; return 0;
} }
static int cygnus_pcm_prepare(struct snd_pcm_substream *substream) static int cygnus_pcm_prepare(struct snd_soc_component *component,
struct snd_pcm_substream *substream)
{ {
struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct snd_pcm_runtime *runtime = substream->runtime; struct snd_pcm_runtime *runtime = substream->runtime;
...@@ -694,7 +700,8 @@ static int cygnus_pcm_prepare(struct snd_pcm_substream *substream) ...@@ -694,7 +700,8 @@ static int cygnus_pcm_prepare(struct snd_pcm_substream *substream)
return 0; return 0;
} }
static snd_pcm_uframes_t cygnus_pcm_pointer(struct snd_pcm_substream *substream) static snd_pcm_uframes_t cygnus_pcm_pointer(struct snd_soc_component *component,
struct snd_pcm_substream *substream)
{ {
struct cygnus_aio_port *aio; struct cygnus_aio_port *aio;
unsigned int res = 0, cur = 0, base = 0; unsigned int res = 0, cur = 0, base = 0;
...@@ -750,19 +757,8 @@ static int cygnus_pcm_preallocate_dma_buffer(struct snd_pcm *pcm, int stream) ...@@ -750,19 +757,8 @@ static int cygnus_pcm_preallocate_dma_buffer(struct snd_pcm *pcm, int stream)
return 0; return 0;
} }
static void cygnus_dma_free_dma_buffers(struct snd_soc_component *component,
static const struct snd_pcm_ops cygnus_pcm_ops = { struct snd_pcm *pcm)
.open = cygnus_pcm_open,
.close = cygnus_pcm_close,
.ioctl = snd_pcm_lib_ioctl,
.hw_params = cygnus_pcm_hw_params,
.hw_free = cygnus_pcm_hw_free,
.prepare = cygnus_pcm_prepare,
.trigger = cygnus_pcm_trigger,
.pointer = cygnus_pcm_pointer,
};
static void cygnus_dma_free_dma_buffers(struct snd_pcm *pcm)
{ {
struct snd_pcm_substream *substream; struct snd_pcm_substream *substream;
struct snd_dma_buffer *buf; struct snd_dma_buffer *buf;
...@@ -788,7 +784,8 @@ static void cygnus_dma_free_dma_buffers(struct snd_pcm *pcm) ...@@ -788,7 +784,8 @@ static void cygnus_dma_free_dma_buffers(struct snd_pcm *pcm)
} }
} }
static int cygnus_dma_new(struct snd_soc_pcm_runtime *rtd) static int cygnus_dma_new(struct snd_soc_component *component,
struct snd_soc_pcm_runtime *rtd)
{ {
struct snd_card *card = rtd->card->snd_card; struct snd_card *card = rtd->card->snd_card;
struct snd_pcm *pcm = rtd->pcm; struct snd_pcm *pcm = rtd->pcm;
...@@ -810,7 +807,7 @@ static int cygnus_dma_new(struct snd_soc_pcm_runtime *rtd) ...@@ -810,7 +807,7 @@ static int cygnus_dma_new(struct snd_soc_pcm_runtime *rtd)
ret = cygnus_pcm_preallocate_dma_buffer(pcm, ret = cygnus_pcm_preallocate_dma_buffer(pcm,
SNDRV_PCM_STREAM_CAPTURE); SNDRV_PCM_STREAM_CAPTURE);
if (ret) { if (ret) {
cygnus_dma_free_dma_buffers(pcm); cygnus_dma_free_dma_buffers(component, pcm);
return ret; return ret;
} }
} }
...@@ -819,9 +816,16 @@ static int cygnus_dma_new(struct snd_soc_pcm_runtime *rtd) ...@@ -819,9 +816,16 @@ static int cygnus_dma_new(struct snd_soc_pcm_runtime *rtd)
} }
static struct snd_soc_component_driver cygnus_soc_platform = { static struct snd_soc_component_driver cygnus_soc_platform = {
.ops = &cygnus_pcm_ops, .open = cygnus_pcm_open,
.pcm_new = cygnus_dma_new, .close = cygnus_pcm_close,
.pcm_free = cygnus_dma_free_dma_buffers, .ioctl = snd_soc_pcm_lib_ioctl,
.hw_params = cygnus_pcm_hw_params,
.hw_free = cygnus_pcm_hw_free,
.prepare = cygnus_pcm_prepare,
.trigger = cygnus_pcm_trigger,
.pointer = cygnus_pcm_pointer,
.pcm_construct = cygnus_dma_new,
.pcm_destruct = cygnus_dma_free_dma_buffers,
}; };
int cygnus_soc_platform_register(struct device *dev, int cygnus_soc_platform_register(struct device *dev,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment