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

ASoC: sh: fsi: 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/87zhij90fh.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 9dcefa72
...@@ -1718,7 +1718,8 @@ static const struct snd_pcm_hardware fsi_pcm_hardware = { ...@@ -1718,7 +1718,8 @@ static const struct snd_pcm_hardware fsi_pcm_hardware = {
.fifo_size = 256, .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; struct snd_pcm_runtime *runtime = substream->runtime;
int ret = 0; int ret = 0;
...@@ -1731,19 +1732,22 @@ static int fsi_pcm_open(struct snd_pcm_substream *substream) ...@@ -1731,19 +1732,22 @@ static int fsi_pcm_open(struct snd_pcm_substream *substream)
return ret; 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) struct snd_pcm_hw_params *hw_params)
{ {
return snd_pcm_lib_malloc_pages(substream, return snd_pcm_lib_malloc_pages(substream,
params_buffer_bytes(hw_params)); 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); 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_priv *fsi = fsi_get_priv(substream);
struct fsi_stream *io = fsi_stream_get(fsi, 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) ...@@ -1751,14 +1755,6 @@ static snd_pcm_uframes_t fsi_pointer(struct snd_pcm_substream *substream)
return fsi_sample2frame(fsi, io->buff_sample_pos); 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 * snd_soc_component
*/ */
...@@ -1766,7 +1762,8 @@ static const struct snd_pcm_ops fsi_pcm_ops = { ...@@ -1766,7 +1762,8 @@ static const struct snd_pcm_ops fsi_pcm_ops = {
#define PREALLOC_BUFFER (32 * 1024) #define PREALLOC_BUFFER (32 * 1024)
#define PREALLOC_BUFFER_MAX (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( snd_pcm_lib_preallocate_pages_for_all(
rtd->pcm, rtd->pcm,
...@@ -1817,8 +1814,12 @@ static struct snd_soc_dai_driver fsi_soc_dai[] = { ...@@ -1817,8 +1814,12 @@ static struct snd_soc_dai_driver fsi_soc_dai[] = {
static const struct snd_soc_component_driver fsi_soc_component = { static const struct snd_soc_component_driver fsi_soc_component = {
.name = "fsi", .name = "fsi",
.ops = &fsi_pcm_ops, .open = fsi_pcm_open,
.pcm_new = fsi_pcm_new, .ioctl = snd_soc_pcm_lib_ioctl,
.hw_params = fsi_hw_params,
.hw_free = fsi_hw_free,
.pointer = fsi_pointer,
.pcm_construct = fsi_pcm_new,
}; };
/* /*
......
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