diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2019-10-02 14:33:11 +0900 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-10-08 13:45:57 +0100 |
commit | db5b4ee95238d2c5e9a97f53257f6b7ea7e1caa0 (patch) | |
tree | 4ab33aff13f5420cda1c4f87f93dc112ff4cd7b8 /sound/soc/sh | |
parent | be513045d6fe8284e0e6f9060415d0c5189e179a (diff) |
ASoC: sh: dma-sh7760: 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/87y2y390fc.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sh')
-rw-r--r-- | sound/soc/sh/dma-sh7760.c | 46 |
1 files changed, 25 insertions, 21 deletions
diff --git a/sound/soc/sh/dma-sh7760.c b/sound/soc/sh/dma-sh7760.c index 5aee11c94f2a..93bb80d089be 100644 --- a/sound/soc/sh/dma-sh7760.c +++ b/sound/soc/sh/dma-sh7760.c @@ -115,7 +115,8 @@ static void camelot_rxdma(void *data) snd_pcm_period_elapsed(cam->rx_ss); } -static int camelot_pcm_open(struct snd_pcm_substream *substream) +static int camelot_pcm_open(struct snd_soc_component *component, + struct snd_pcm_substream *substream) { struct snd_soc_pcm_runtime *rtd = substream->private_data; struct camelot_pcm *cam = &cam_pcm_data[rtd->cpu_dai->id]; @@ -148,7 +149,8 @@ static int camelot_pcm_open(struct snd_pcm_substream *substream) return 0; } -static int camelot_pcm_close(struct snd_pcm_substream *substream) +static int camelot_pcm_close(struct snd_soc_component *component, + struct snd_pcm_substream *substream) { struct snd_soc_pcm_runtime *rtd = substream->private_data; struct camelot_pcm *cam = &cam_pcm_data[rtd->cpu_dai->id]; @@ -168,7 +170,8 @@ static int camelot_pcm_close(struct snd_pcm_substream *substream) return 0; } -static int camelot_hw_params(struct snd_pcm_substream *substream, +static int camelot_hw_params(struct snd_soc_component *component, + struct snd_pcm_substream *substream, struct snd_pcm_hw_params *hw_params) { struct snd_soc_pcm_runtime *rtd = substream->private_data; @@ -191,12 +194,14 @@ static int camelot_hw_params(struct snd_pcm_substream *substream, return 0; } -static int camelot_hw_free(struct snd_pcm_substream *substream) +static int camelot_hw_free(struct snd_soc_component *component, + struct snd_pcm_substream *substream) { return snd_pcm_lib_free_pages(substream); } -static int camelot_prepare(struct snd_pcm_substream *substream) +static int camelot_prepare(struct snd_soc_component *component, + struct snd_pcm_substream *substream) { struct snd_pcm_runtime *runtime = substream->runtime; struct snd_soc_pcm_runtime *rtd = substream->private_data; @@ -244,7 +249,8 @@ static inline void dmabrg_rec_dma_stop(struct camelot_pcm *cam) BRGREG(BRGACR) = acr | ACR_RDS; } -static int camelot_trigger(struct snd_pcm_substream *substream, int cmd) +static int camelot_trigger(struct snd_soc_component *component, + struct snd_pcm_substream *substream, int cmd) { struct snd_soc_pcm_runtime *rtd = substream->private_data; struct camelot_pcm *cam = &cam_pcm_data[rtd->cpu_dai->id]; @@ -270,7 +276,8 @@ static int camelot_trigger(struct snd_pcm_substream *substream, int cmd) return 0; } -static snd_pcm_uframes_t camelot_pos(struct snd_pcm_substream *substream) +static snd_pcm_uframes_t camelot_pos(struct snd_soc_component *component, + struct snd_pcm_substream *substream) { struct snd_pcm_runtime *runtime = substream->runtime; struct snd_soc_pcm_runtime *rtd = substream->private_data; @@ -292,18 +299,8 @@ static snd_pcm_uframes_t camelot_pos(struct snd_pcm_substream *substream) return bytes_to_frames(runtime, pos); } -static const struct snd_pcm_ops camelot_pcm_ops = { - .open = camelot_pcm_open, - .close = camelot_pcm_close, - .ioctl = snd_pcm_lib_ioctl, - .hw_params = camelot_hw_params, - .hw_free = camelot_hw_free, - .prepare = camelot_prepare, - .trigger = camelot_trigger, - .pointer = camelot_pos, -}; - -static int camelot_pcm_new(struct snd_soc_pcm_runtime *rtd) +static int camelot_pcm_new(struct snd_soc_component *component, + struct snd_soc_pcm_runtime *rtd) { struct snd_pcm *pcm = rtd->pcm; @@ -319,8 +316,15 @@ static int camelot_pcm_new(struct snd_soc_pcm_runtime *rtd) } static const struct snd_soc_component_driver sh7760_soc_component = { - .ops = &camelot_pcm_ops, - .pcm_new = camelot_pcm_new, + .open = camelot_pcm_open, + .close = camelot_pcm_close, + .ioctl = snd_soc_pcm_lib_ioctl, + .hw_params = camelot_hw_params, + .hw_free = camelot_hw_free, + .prepare = camelot_prepare, + .trigger = camelot_trigger, + .pointer = camelot_pos, + .pcm_construct = camelot_pcm_new, }; static int sh7760_soc_platform_probe(struct platform_device *pdev) |