diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2019-10-02 08:33:06 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-10-08 15:45:39 +0300 |
commit | be513045d6fe8284e0e6f9060415d0c5189e179a (patch) | |
tree | dcccf7e0e2c0eb2981cebdfd109b31988bbbf967 /sound/soc/sh | |
parent | 9dcefa7232d3fd5a7141454849d46ed24c7af867 (diff) | |
download | linux-be513045d6fe8284e0e6f9060415d0c5189e179a.tar.xz |
ASoC: sh: fsi: 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/87zhij90fh.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/fsi.c | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c index 3447dbdba1f1..e384fdc8d60e 100644 --- a/sound/soc/sh/fsi.c +++ b/sound/soc/sh/fsi.c @@ -1718,7 +1718,8 @@ static const struct snd_pcm_hardware fsi_pcm_hardware = { .fifo_size = 256, }; -static int fsi_pcm_open(struct snd_pcm_substream *substream) +static int fsi_pcm_open(struct snd_soc_component *component, + struct snd_pcm_substream *substream) { struct snd_pcm_runtime *runtime = substream->runtime; int ret = 0; @@ -1731,19 +1732,22 @@ static int fsi_pcm_open(struct snd_pcm_substream *substream) return ret; } -static int fsi_hw_params(struct snd_pcm_substream *substream, +static int fsi_hw_params(struct snd_soc_component *component, + struct snd_pcm_substream *substream, struct snd_pcm_hw_params *hw_params) { return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); } -static int fsi_hw_free(struct snd_pcm_substream *substream) +static int fsi_hw_free(struct snd_soc_component *component, + struct snd_pcm_substream *substream) { return snd_pcm_lib_free_pages(substream); } -static snd_pcm_uframes_t fsi_pointer(struct snd_pcm_substream *substream) +static snd_pcm_uframes_t fsi_pointer(struct snd_soc_component *component, + struct snd_pcm_substream *substream) { struct fsi_priv *fsi = fsi_get_priv(substream); struct fsi_stream *io = fsi_stream_get(fsi, substream); @@ -1751,14 +1755,6 @@ static snd_pcm_uframes_t fsi_pointer(struct snd_pcm_substream *substream) return fsi_sample2frame(fsi, io->buff_sample_pos); } -static const struct snd_pcm_ops fsi_pcm_ops = { - .open = fsi_pcm_open, - .ioctl = snd_pcm_lib_ioctl, - .hw_params = fsi_hw_params, - .hw_free = fsi_hw_free, - .pointer = fsi_pointer, -}; - /* * snd_soc_component */ @@ -1766,7 +1762,8 @@ static const struct snd_pcm_ops fsi_pcm_ops = { #define PREALLOC_BUFFER (32 * 1024) #define PREALLOC_BUFFER_MAX (32 * 1024) -static int fsi_pcm_new(struct snd_soc_pcm_runtime *rtd) +static int fsi_pcm_new(struct snd_soc_component *component, + struct snd_soc_pcm_runtime *rtd) { snd_pcm_lib_preallocate_pages_for_all( rtd->pcm, @@ -1817,8 +1814,12 @@ static struct snd_soc_dai_driver fsi_soc_dai[] = { static const struct snd_soc_component_driver fsi_soc_component = { .name = "fsi", - .ops = &fsi_pcm_ops, - .pcm_new = fsi_pcm_new, + .open = fsi_pcm_open, + .ioctl = snd_soc_pcm_lib_ioctl, + .hw_params = fsi_hw_params, + .hw_free = fsi_hw_free, + .pointer = fsi_pointer, + .pcm_construct = fsi_pcm_new, }; /* |