Commit 171d1785 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: uniphier: use snd_compress_ops

We can use snd_compress_ops.
Let's switch to use it.
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87sggyvdld.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 3a5ccf25
...@@ -16,8 +16,10 @@ ...@@ -16,8 +16,10 @@
#include "aio.h" #include "aio.h"
static int uniphier_aio_compr_prepare(struct snd_compr_stream *cstream); static int uniphier_aio_compr_prepare(struct snd_soc_component *component,
static int uniphier_aio_compr_hw_free(struct snd_compr_stream *cstream); struct snd_compr_stream *cstream);
static int uniphier_aio_compr_hw_free(struct snd_soc_component *component,
struct snd_compr_stream *cstream);
static int uniphier_aio_comprdma_new(struct snd_soc_pcm_runtime *rtd) static int uniphier_aio_comprdma_new(struct snd_soc_pcm_runtime *rtd)
{ {
...@@ -70,7 +72,8 @@ static int uniphier_aio_comprdma_free(struct snd_soc_pcm_runtime *rtd) ...@@ -70,7 +72,8 @@ static int uniphier_aio_comprdma_free(struct snd_soc_pcm_runtime *rtd)
return 0; return 0;
} }
static int uniphier_aio_compr_open(struct snd_compr_stream *cstream) static int uniphier_aio_compr_open(struct snd_soc_component *component,
struct snd_compr_stream *cstream)
{ {
struct snd_soc_pcm_runtime *rtd = cstream->private_data; struct snd_soc_pcm_runtime *rtd = cstream->private_data;
struct uniphier_aio *aio = uniphier_priv(asoc_rtd_to_cpu(rtd, 0)); struct uniphier_aio *aio = uniphier_priv(asoc_rtd_to_cpu(rtd, 0));
...@@ -95,14 +98,15 @@ static int uniphier_aio_compr_open(struct snd_compr_stream *cstream) ...@@ -95,14 +98,15 @@ static int uniphier_aio_compr_open(struct snd_compr_stream *cstream)
return 0; return 0;
} }
static int uniphier_aio_compr_free(struct snd_compr_stream *cstream) static int uniphier_aio_compr_free(struct snd_soc_component *component,
struct snd_compr_stream *cstream)
{ {
struct snd_soc_pcm_runtime *rtd = cstream->private_data; struct snd_soc_pcm_runtime *rtd = cstream->private_data;
struct uniphier_aio *aio = uniphier_priv(asoc_rtd_to_cpu(rtd, 0)); struct uniphier_aio *aio = uniphier_priv(asoc_rtd_to_cpu(rtd, 0));
struct uniphier_aio_sub *sub = &aio->sub[cstream->direction]; struct uniphier_aio_sub *sub = &aio->sub[cstream->direction];
int ret; int ret;
ret = uniphier_aio_compr_hw_free(cstream); ret = uniphier_aio_compr_hw_free(component, cstream);
if (ret) if (ret)
return ret; return ret;
ret = uniphier_aio_comprdma_free(rtd); ret = uniphier_aio_comprdma_free(rtd);
...@@ -114,7 +118,8 @@ static int uniphier_aio_compr_free(struct snd_compr_stream *cstream) ...@@ -114,7 +118,8 @@ static int uniphier_aio_compr_free(struct snd_compr_stream *cstream)
return 0; return 0;
} }
static int uniphier_aio_compr_get_params(struct snd_compr_stream *cstream, static int uniphier_aio_compr_get_params(struct snd_soc_component *component,
struct snd_compr_stream *cstream,
struct snd_codec *params) struct snd_codec *params)
{ {
struct snd_soc_pcm_runtime *rtd = cstream->private_data; struct snd_soc_pcm_runtime *rtd = cstream->private_data;
...@@ -126,7 +131,8 @@ static int uniphier_aio_compr_get_params(struct snd_compr_stream *cstream, ...@@ -126,7 +131,8 @@ static int uniphier_aio_compr_get_params(struct snd_compr_stream *cstream,
return 0; return 0;
} }
static int uniphier_aio_compr_set_params(struct snd_compr_stream *cstream, static int uniphier_aio_compr_set_params(struct snd_soc_component *component,
struct snd_compr_stream *cstream,
struct snd_compr_params *params) struct snd_compr_params *params)
{ {
struct snd_soc_pcm_runtime *rtd = cstream->private_data; struct snd_soc_pcm_runtime *rtd = cstream->private_data;
...@@ -155,14 +161,15 @@ static int uniphier_aio_compr_set_params(struct snd_compr_stream *cstream, ...@@ -155,14 +161,15 @@ static int uniphier_aio_compr_set_params(struct snd_compr_stream *cstream,
aio_port_reset(sub); aio_port_reset(sub);
aio_src_reset(sub); aio_src_reset(sub);
ret = uniphier_aio_compr_prepare(cstream); ret = uniphier_aio_compr_prepare(component, cstream);
if (ret) if (ret)
return ret; return ret;
return 0; return 0;
} }
static int uniphier_aio_compr_hw_free(struct snd_compr_stream *cstream) static int uniphier_aio_compr_hw_free(struct snd_soc_component *component,
struct snd_compr_stream *cstream)
{ {
struct snd_soc_pcm_runtime *rtd = cstream->private_data; struct snd_soc_pcm_runtime *rtd = cstream->private_data;
struct uniphier_aio *aio = uniphier_priv(asoc_rtd_to_cpu(rtd, 0)); struct uniphier_aio *aio = uniphier_priv(asoc_rtd_to_cpu(rtd, 0));
...@@ -173,7 +180,8 @@ static int uniphier_aio_compr_hw_free(struct snd_compr_stream *cstream) ...@@ -173,7 +180,8 @@ static int uniphier_aio_compr_hw_free(struct snd_compr_stream *cstream)
return 0; return 0;
} }
static int uniphier_aio_compr_prepare(struct snd_compr_stream *cstream) static int uniphier_aio_compr_prepare(struct snd_soc_component *component,
struct snd_compr_stream *cstream)
{ {
struct snd_soc_pcm_runtime *rtd = cstream->private_data; struct snd_soc_pcm_runtime *rtd = cstream->private_data;
struct snd_compr_runtime *runtime = cstream->runtime; struct snd_compr_runtime *runtime = cstream->runtime;
...@@ -210,7 +218,8 @@ static int uniphier_aio_compr_prepare(struct snd_compr_stream *cstream) ...@@ -210,7 +218,8 @@ static int uniphier_aio_compr_prepare(struct snd_compr_stream *cstream)
return 0; return 0;
} }
static int uniphier_aio_compr_trigger(struct snd_compr_stream *cstream, static int uniphier_aio_compr_trigger(struct snd_soc_component *component,
struct snd_compr_stream *cstream,
int cmd) int cmd)
{ {
struct snd_soc_pcm_runtime *rtd = cstream->private_data; struct snd_soc_pcm_runtime *rtd = cstream->private_data;
...@@ -243,7 +252,8 @@ static int uniphier_aio_compr_trigger(struct snd_compr_stream *cstream, ...@@ -243,7 +252,8 @@ static int uniphier_aio_compr_trigger(struct snd_compr_stream *cstream,
return ret; return ret;
} }
static int uniphier_aio_compr_pointer(struct snd_compr_stream *cstream, static int uniphier_aio_compr_pointer(struct snd_soc_component *component,
struct snd_compr_stream *cstream,
struct snd_compr_tstamp *tstamp) struct snd_compr_tstamp *tstamp)
{ {
struct snd_soc_pcm_runtime *rtd = cstream->private_data; struct snd_soc_pcm_runtime *rtd = cstream->private_data;
...@@ -316,7 +326,8 @@ static int aio_compr_send_to_hw(struct uniphier_aio_sub *sub, ...@@ -316,7 +326,8 @@ static int aio_compr_send_to_hw(struct uniphier_aio_sub *sub,
return 0; return 0;
} }
static int uniphier_aio_compr_copy(struct snd_compr_stream *cstream, static int uniphier_aio_compr_copy(struct snd_soc_component *component,
struct snd_compr_stream *cstream,
char __user *buf, size_t count) char __user *buf, size_t count)
{ {
struct snd_soc_pcm_runtime *rtd = cstream->private_data; struct snd_soc_pcm_runtime *rtd = cstream->private_data;
...@@ -375,7 +386,8 @@ static int uniphier_aio_compr_copy(struct snd_compr_stream *cstream, ...@@ -375,7 +386,8 @@ static int uniphier_aio_compr_copy(struct snd_compr_stream *cstream,
return cnt; return cnt;
} }
static int uniphier_aio_compr_get_caps(struct snd_compr_stream *cstream, static int uniphier_aio_compr_get_caps(struct snd_soc_component *component,
struct snd_compr_stream *cstream,
struct snd_compr_caps *caps) struct snd_compr_caps *caps)
{ {
caps->num_codecs = 1; caps->num_codecs = 1;
...@@ -401,7 +413,8 @@ static const struct snd_compr_codec_caps caps_iec = { ...@@ -401,7 +413,8 @@ static const struct snd_compr_codec_caps caps_iec = {
.descriptor[0].formats = 0, .descriptor[0].formats = 0,
}; };
static int uniphier_aio_compr_get_codec_caps(struct snd_compr_stream *stream, static int uniphier_aio_compr_get_codec_caps(struct snd_soc_component *component,
struct snd_compr_stream *stream,
struct snd_compr_codec_caps *codec) struct snd_compr_codec_caps *codec)
{ {
if (codec->codec == SND_AUDIOCODEC_IEC61937) if (codec->codec == SND_AUDIOCODEC_IEC61937)
...@@ -412,7 +425,7 @@ static int uniphier_aio_compr_get_codec_caps(struct snd_compr_stream *stream, ...@@ -412,7 +425,7 @@ static int uniphier_aio_compr_get_codec_caps(struct snd_compr_stream *stream,
return 0; return 0;
} }
const struct snd_compr_ops uniphier_aio_compr_ops = { const struct snd_compress_ops uniphier_aio_compress_ops = {
.open = uniphier_aio_compr_open, .open = uniphier_aio_compr_open,
.free = uniphier_aio_compr_free, .free = uniphier_aio_compr_free,
.get_params = uniphier_aio_compr_get_params, .get_params = uniphier_aio_compr_get_params,
......
...@@ -227,7 +227,7 @@ static const struct snd_soc_component_driver uniphier_soc_platform = { ...@@ -227,7 +227,7 @@ static const struct snd_soc_component_driver uniphier_soc_platform = {
.pointer = uniphier_aiodma_pointer, .pointer = uniphier_aiodma_pointer,
.mmap = uniphier_aiodma_mmap, .mmap = uniphier_aiodma_mmap,
.pcm_construct = uniphier_aiodma_new, .pcm_construct = uniphier_aiodma_new,
.compr_ops = &uniphier_aio_compr_ops, .compress_ops = &uniphier_aio_compress_ops,
}; };
static const struct regmap_config aiodma_regmap_config = { static const struct regmap_config aiodma_regmap_config = {
......
...@@ -304,7 +304,7 @@ static inline struct uniphier_aio *uniphier_priv(struct snd_soc_dai *dai) ...@@ -304,7 +304,7 @@ static inline struct uniphier_aio *uniphier_priv(struct snd_soc_dai *dai)
} }
int uniphier_aiodma_soc_register_platform(struct platform_device *pdev); int uniphier_aiodma_soc_register_platform(struct platform_device *pdev);
extern const struct snd_compr_ops uniphier_aio_compr_ops; extern const struct snd_compress_ops uniphier_aio_compress_ops;
int uniphier_aio_dai_probe(struct snd_soc_dai *dai); int uniphier_aio_dai_probe(struct snd_soc_dai *dai);
int uniphier_aio_dai_remove(struct snd_soc_dai *dai); int uniphier_aio_dai_remove(struct snd_soc_dai *dai);
......
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