mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-18 02:04:05 +08:00
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>
This commit is contained in:
parent
9dcefa7232
commit
be513045d6
@ -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,
|
||||
};
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user