Commit 8baa3b5a authored by Mark Brown's avatar Mark Brown

Merge series "ASoC: add snd_compress_ops and replace" from Kuninori Morimoto...

Merge series "ASoC: add snd_compress_ops and replace" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

Hi Mark

Current snd_soc_component_driver has compr_ops,
but it is created for ALSA, not for ALSA SoC.
This means it doesn't know the callback is for which component,
thus, each callback needs to get component via lookup function.

It is not good design, and will not work in the future,
because ASoC can have multipul same name component which
current lookup function can't handle.

This v2 patch-set adds new snd_compress_ops and call
callbacks with component.
v1 is here

Link: https://lore.kernel.org/alsa-devel/87blnqpuqp.wl-kuninori.morimoto.gx@renesas.com/

Kuninori Morimoto (8):
  ASoC: soc-compress: add snd_compress_ops
  ASoC: codec: wm_adsp: use snd_compress_ops
  ASoC: uniphier: use snd_compress_ops
  ASoC: qcom: q6sp6: use snd_compress_ops
  ASoC: intel: atom: use snd_compress_ops
  ASoC: sof: use snd_compress_ops
  ASoC: sprd: use snd_compress_ops
  ASoC: soc-compress: remove snd_compr_ops

 include/sound/soc-component.h                 | 40 ++++++++-
 sound/soc/codecs/cs47l15.c                    |  9 +-
 sound/soc/codecs/cs47l24.c                    |  8 +-
 sound/soc/codecs/cs47l35.c                    |  9 +-
 sound/soc/codecs/cs47l85.c                    |  9 +-
 sound/soc/codecs/cs47l90.c                    |  9 +-
 sound/soc/codecs/cs47l92.c                    |  9 +-
 sound/soc/codecs/wm5102.c                     |  9 +-
 sound/soc/codecs/wm5110.c                     |  8 +-
 sound/soc/codecs/wm_adsp.c                    | 18 ++--
 sound/soc/codecs/wm_adsp.h                    | 18 ++--
 .../intel/atom/sst-mfld-platform-compress.c   | 43 +++++----
 sound/soc/intel/atom/sst-mfld-platform-pcm.c  |  2 +-
 sound/soc/intel/atom/sst-mfld-platform.h      |  2 +-
 sound/soc/qcom/qdsp6/q6asm-dai.c              | 51 ++++++-----
 sound/soc/soc-compress.c                      | 89 ++++++++++---------
 sound/soc/sof/compress.c                      |  7 +-
 sound/soc/sof/compress.h                      |  7 +-
 sound/soc/sof/pcm.c                           |  4 +-
 sound/soc/sof/sof-priv.h                      |  2 +-
 sound/soc/sprd/sprd-pcm-compress.c            | 49 +++++-----
 sound/soc/sprd/sprd-pcm-dma.c                 |  2 +-
 sound/soc/sprd/sprd-pcm-dma.h                 |  2 +-
 sound/soc/uniphier/aio-compress.c             | 45 ++++++----
 sound/soc/uniphier/aio-dma.c                  |  2 +-
 sound/soc/uniphier/aio.h                      |  2 +-
 26 files changed, 265 insertions(+), 190 deletions(-)

--
2.17.1
parents 52e8a94b e7cbe528
...@@ -25,6 +25,44 @@ ...@@ -25,6 +25,44 @@
order++) order++)
/* component interface */ /* component interface */
struct snd_compress_ops {
int (*open)(struct snd_soc_component *component,
struct snd_compr_stream *stream);
int (*free)(struct snd_soc_component *component,
struct snd_compr_stream *stream);
int (*set_params)(struct snd_soc_component *component,
struct snd_compr_stream *stream,
struct snd_compr_params *params);
int (*get_params)(struct snd_soc_component *component,
struct snd_compr_stream *stream,
struct snd_codec *params);
int (*set_metadata)(struct snd_soc_component *component,
struct snd_compr_stream *stream,
struct snd_compr_metadata *metadata);
int (*get_metadata)(struct snd_soc_component *component,
struct snd_compr_stream *stream,
struct snd_compr_metadata *metadata);
int (*trigger)(struct snd_soc_component *component,
struct snd_compr_stream *stream, int cmd);
int (*pointer)(struct snd_soc_component *component,
struct snd_compr_stream *stream,
struct snd_compr_tstamp *tstamp);
int (*copy)(struct snd_soc_component *component,
struct snd_compr_stream *stream, char __user *buf,
size_t count);
int (*mmap)(struct snd_soc_component *component,
struct snd_compr_stream *stream,
struct vm_area_struct *vma);
int (*ack)(struct snd_soc_component *component,
struct snd_compr_stream *stream, size_t bytes);
int (*get_caps)(struct snd_soc_component *component,
struct snd_compr_stream *stream,
struct snd_compr_caps *caps);
int (*get_codec_caps)(struct snd_soc_component *component,
struct snd_compr_stream *stream,
struct snd_compr_codec_caps *codec);
};
struct snd_soc_component_driver { struct snd_soc_component_driver {
const char *name; const char *name;
...@@ -108,7 +146,7 @@ struct snd_soc_component_driver { ...@@ -108,7 +146,7 @@ struct snd_soc_component_driver {
struct snd_pcm_substream *substream, struct snd_pcm_substream *substream,
struct vm_area_struct *vma); struct vm_area_struct *vma);
const struct snd_compr_ops *compr_ops; const struct snd_compress_ops *compress_ops;
/* probe ordering - for components with runtime dependencies */ /* probe ordering - for components with runtime dependencies */
int probe_order; int probe_order;
......
...@@ -1229,11 +1229,10 @@ static struct snd_soc_dai_driver cs47l15_dai[] = { ...@@ -1229,11 +1229,10 @@ static struct snd_soc_dai_driver cs47l15_dai[] = {
}, },
}; };
static int cs47l15_open(struct snd_compr_stream *stream) static int cs47l15_open(struct snd_soc_component *component,
struct snd_compr_stream *stream)
{ {
struct snd_soc_pcm_runtime *rtd = stream->private_data; struct snd_soc_pcm_runtime *rtd = stream->private_data;
struct snd_soc_component *component =
snd_soc_rtdcom_lookup(rtd, DRV_NAME);
struct cs47l15 *cs47l15 = snd_soc_component_get_drvdata(component); struct cs47l15 *cs47l15 = snd_soc_component_get_drvdata(component);
struct madera_priv *priv = &cs47l15->core; struct madera_priv *priv = &cs47l15->core;
struct madera *madera = priv->madera; struct madera *madera = priv->madera;
...@@ -1329,7 +1328,7 @@ static unsigned int cs47l15_digital_vu[] = { ...@@ -1329,7 +1328,7 @@ static unsigned int cs47l15_digital_vu[] = {
MADERA_DAC_DIGITAL_VOLUME_5R, MADERA_DAC_DIGITAL_VOLUME_5R,
}; };
static const struct snd_compr_ops cs47l15_compr_ops = { static const struct snd_compress_ops cs47l15_compress_ops = {
.open = &cs47l15_open, .open = &cs47l15_open,
.free = &wm_adsp_compr_free, .free = &wm_adsp_compr_free,
.set_params = &wm_adsp_compr_set_params, .set_params = &wm_adsp_compr_set_params,
...@@ -1345,7 +1344,7 @@ static const struct snd_soc_component_driver soc_component_dev_cs47l15 = { ...@@ -1345,7 +1344,7 @@ static const struct snd_soc_component_driver soc_component_dev_cs47l15 = {
.set_sysclk = &madera_set_sysclk, .set_sysclk = &madera_set_sysclk,
.set_pll = &cs47l15_set_fll, .set_pll = &cs47l15_set_fll,
.name = DRV_NAME, .name = DRV_NAME,
.compr_ops = &cs47l15_compr_ops, .compress_ops = &cs47l15_compress_ops,
.controls = cs47l15_snd_controls, .controls = cs47l15_snd_controls,
.num_controls = ARRAY_SIZE(cs47l15_snd_controls), .num_controls = ARRAY_SIZE(cs47l15_snd_controls),
.dapm_widgets = cs47l15_dapm_widgets, .dapm_widgets = cs47l15_dapm_widgets,
......
...@@ -1068,10 +1068,10 @@ static struct snd_soc_dai_driver cs47l24_dai[] = { ...@@ -1068,10 +1068,10 @@ static struct snd_soc_dai_driver cs47l24_dai[] = {
}, },
}; };
static int cs47l24_open(struct snd_compr_stream *stream) static int cs47l24_open(struct snd_soc_component *component,
struct snd_compr_stream *stream)
{ {
struct snd_soc_pcm_runtime *rtd = stream->private_data; struct snd_soc_pcm_runtime *rtd = stream->private_data;
struct snd_soc_component *component = snd_soc_rtdcom_lookup(rtd, DRV_NAME);
struct cs47l24_priv *priv = snd_soc_component_get_drvdata(component); struct cs47l24_priv *priv = snd_soc_component_get_drvdata(component);
struct arizona *arizona = priv->core.arizona; struct arizona *arizona = priv->core.arizona;
int n_adsp; int n_adsp;
...@@ -1178,7 +1178,7 @@ static unsigned int cs47l24_digital_vu[] = { ...@@ -1178,7 +1178,7 @@ static unsigned int cs47l24_digital_vu[] = {
ARIZONA_DAC_DIGITAL_VOLUME_4L, ARIZONA_DAC_DIGITAL_VOLUME_4L,
}; };
static struct snd_compr_ops cs47l24_compr_ops = { static struct snd_compress_ops cs47l24_compress_ops = {
.open = cs47l24_open, .open = cs47l24_open,
.free = wm_adsp_compr_free, .free = wm_adsp_compr_free,
.set_params = wm_adsp_compr_set_params, .set_params = wm_adsp_compr_set_params,
...@@ -1194,7 +1194,7 @@ static const struct snd_soc_component_driver soc_component_dev_cs47l24 = { ...@@ -1194,7 +1194,7 @@ static const struct snd_soc_component_driver soc_component_dev_cs47l24 = {
.set_sysclk = arizona_set_sysclk, .set_sysclk = arizona_set_sysclk,
.set_pll = cs47l24_set_fll, .set_pll = cs47l24_set_fll,
.name = DRV_NAME, .name = DRV_NAME,
.compr_ops = &cs47l24_compr_ops, .compress_ops = &cs47l24_compress_ops,
.controls = cs47l24_snd_controls, .controls = cs47l24_snd_controls,
.num_controls = ARRAY_SIZE(cs47l24_snd_controls), .num_controls = ARRAY_SIZE(cs47l24_snd_controls),
.dapm_widgets = cs47l24_dapm_widgets, .dapm_widgets = cs47l24_dapm_widgets,
......
...@@ -1504,11 +1504,10 @@ static struct snd_soc_dai_driver cs47l35_dai[] = { ...@@ -1504,11 +1504,10 @@ static struct snd_soc_dai_driver cs47l35_dai[] = {
}, },
}; };
static int cs47l35_open(struct snd_compr_stream *stream) static int cs47l35_open(struct snd_soc_component *component,
struct snd_compr_stream *stream)
{ {
struct snd_soc_pcm_runtime *rtd = stream->private_data; struct snd_soc_pcm_runtime *rtd = stream->private_data;
struct snd_soc_component *component =
snd_soc_rtdcom_lookup(rtd, DRV_NAME);
struct cs47l35 *cs47l35 = snd_soc_component_get_drvdata(component); struct cs47l35 *cs47l35 = snd_soc_component_get_drvdata(component);
struct madera_priv *priv = &cs47l35->core; struct madera_priv *priv = &cs47l35->core;
struct madera *madera = priv->madera; struct madera *madera = priv->madera;
...@@ -1622,7 +1621,7 @@ static unsigned int cs47l35_digital_vu[] = { ...@@ -1622,7 +1621,7 @@ static unsigned int cs47l35_digital_vu[] = {
MADERA_DAC_DIGITAL_VOLUME_5R, MADERA_DAC_DIGITAL_VOLUME_5R,
}; };
static const struct snd_compr_ops cs47l35_compr_ops = { static const struct snd_compress_ops cs47l35_compress_ops = {
.open = &cs47l35_open, .open = &cs47l35_open,
.free = &wm_adsp_compr_free, .free = &wm_adsp_compr_free,
.set_params = &wm_adsp_compr_set_params, .set_params = &wm_adsp_compr_set_params,
...@@ -1638,7 +1637,7 @@ static const struct snd_soc_component_driver soc_component_dev_cs47l35 = { ...@@ -1638,7 +1637,7 @@ static const struct snd_soc_component_driver soc_component_dev_cs47l35 = {
.set_sysclk = &madera_set_sysclk, .set_sysclk = &madera_set_sysclk,
.set_pll = &cs47l35_set_fll, .set_pll = &cs47l35_set_fll,
.name = DRV_NAME, .name = DRV_NAME,
.compr_ops = &cs47l35_compr_ops, .compress_ops = &cs47l35_compress_ops,
.controls = cs47l35_snd_controls, .controls = cs47l35_snd_controls,
.num_controls = ARRAY_SIZE(cs47l35_snd_controls), .num_controls = ARRAY_SIZE(cs47l35_snd_controls),
.dapm_widgets = cs47l35_dapm_widgets, .dapm_widgets = cs47l35_dapm_widgets,
......
...@@ -2447,11 +2447,10 @@ static struct snd_soc_dai_driver cs47l85_dai[] = { ...@@ -2447,11 +2447,10 @@ static struct snd_soc_dai_driver cs47l85_dai[] = {
}, },
}; };
static int cs47l85_open(struct snd_compr_stream *stream) static int cs47l85_open(struct snd_soc_component *component,
struct snd_compr_stream *stream)
{ {
struct snd_soc_pcm_runtime *rtd = stream->private_data; struct snd_soc_pcm_runtime *rtd = stream->private_data;
struct snd_soc_component *component =
snd_soc_rtdcom_lookup(rtd, DRV_NAME);
struct cs47l85 *cs47l85 = snd_soc_component_get_drvdata(component); struct cs47l85 *cs47l85 = snd_soc_component_get_drvdata(component);
struct madera_priv *priv = &cs47l85->core; struct madera_priv *priv = &cs47l85->core;
struct madera *madera = priv->madera; struct madera *madera = priv->madera;
...@@ -2566,7 +2565,7 @@ static const unsigned int cs47l85_digital_vu[] = { ...@@ -2566,7 +2565,7 @@ static const unsigned int cs47l85_digital_vu[] = {
MADERA_DAC_DIGITAL_VOLUME_6R, MADERA_DAC_DIGITAL_VOLUME_6R,
}; };
static const struct snd_compr_ops cs47l85_compr_ops = { static const struct snd_compress_ops cs47l85_compress_ops = {
.open = &cs47l85_open, .open = &cs47l85_open,
.free = &wm_adsp_compr_free, .free = &wm_adsp_compr_free,
.set_params = &wm_adsp_compr_set_params, .set_params = &wm_adsp_compr_set_params,
...@@ -2582,7 +2581,7 @@ static const struct snd_soc_component_driver soc_component_dev_cs47l85 = { ...@@ -2582,7 +2581,7 @@ static const struct snd_soc_component_driver soc_component_dev_cs47l85 = {
.set_sysclk = &madera_set_sysclk, .set_sysclk = &madera_set_sysclk,
.set_pll = &cs47l85_set_fll, .set_pll = &cs47l85_set_fll,
.name = DRV_NAME, .name = DRV_NAME,
.compr_ops = &cs47l85_compr_ops, .compress_ops = &cs47l85_compress_ops,
.controls = cs47l85_snd_controls, .controls = cs47l85_snd_controls,
.num_controls = ARRAY_SIZE(cs47l85_snd_controls), .num_controls = ARRAY_SIZE(cs47l85_snd_controls),
.dapm_widgets = cs47l85_dapm_widgets, .dapm_widgets = cs47l85_dapm_widgets,
......
...@@ -2358,11 +2358,10 @@ static struct snd_soc_dai_driver cs47l90_dai[] = { ...@@ -2358,11 +2358,10 @@ static struct snd_soc_dai_driver cs47l90_dai[] = {
}, },
}; };
static int cs47l90_open(struct snd_compr_stream *stream) static int cs47l90_open(struct snd_soc_component *component,
struct snd_compr_stream *stream)
{ {
struct snd_soc_pcm_runtime *rtd = stream->private_data; struct snd_soc_pcm_runtime *rtd = stream->private_data;
struct snd_soc_component *component =
snd_soc_rtdcom_lookup(rtd, DRV_NAME);
struct cs47l90 *cs47l90 = snd_soc_component_get_drvdata(component); struct cs47l90 *cs47l90 = snd_soc_component_get_drvdata(component);
struct madera_priv *priv = &cs47l90->core; struct madera_priv *priv = &cs47l90->core;
struct madera *madera = priv->madera; struct madera *madera = priv->madera;
...@@ -2473,7 +2472,7 @@ static unsigned int cs47l90_digital_vu[] = { ...@@ -2473,7 +2472,7 @@ static unsigned int cs47l90_digital_vu[] = {
MADERA_DAC_DIGITAL_VOLUME_5R, MADERA_DAC_DIGITAL_VOLUME_5R,
}; };
static const struct snd_compr_ops cs47l90_compr_ops = { static const struct snd_compress_ops cs47l90_compress_ops = {
.open = &cs47l90_open, .open = &cs47l90_open,
.free = &wm_adsp_compr_free, .free = &wm_adsp_compr_free,
.set_params = &wm_adsp_compr_set_params, .set_params = &wm_adsp_compr_set_params,
...@@ -2489,7 +2488,7 @@ static const struct snd_soc_component_driver soc_component_dev_cs47l90 = { ...@@ -2489,7 +2488,7 @@ static const struct snd_soc_component_driver soc_component_dev_cs47l90 = {
.set_sysclk = &madera_set_sysclk, .set_sysclk = &madera_set_sysclk,
.set_pll = &cs47l90_set_fll, .set_pll = &cs47l90_set_fll,
.name = DRV_NAME, .name = DRV_NAME,
.compr_ops = &cs47l90_compr_ops, .compress_ops = &cs47l90_compress_ops,
.controls = cs47l90_snd_controls, .controls = cs47l90_snd_controls,
.num_controls = ARRAY_SIZE(cs47l90_snd_controls), .num_controls = ARRAY_SIZE(cs47l90_snd_controls),
.dapm_widgets = cs47l90_dapm_widgets, .dapm_widgets = cs47l90_dapm_widgets,
......
...@@ -1830,11 +1830,10 @@ static struct snd_soc_dai_driver cs47l92_dai[] = { ...@@ -1830,11 +1830,10 @@ static struct snd_soc_dai_driver cs47l92_dai[] = {
}, },
}; };
static int cs47l92_open(struct snd_compr_stream *stream) static int cs47l92_open(struct snd_soc_component *component,
struct snd_compr_stream *stream)
{ {
struct snd_soc_pcm_runtime *rtd = stream->private_data; struct snd_soc_pcm_runtime *rtd = stream->private_data;
struct snd_soc_component *component =
snd_soc_rtdcom_lookup(rtd, DRV_NAME);
struct cs47l92 *cs47l92 = snd_soc_component_get_drvdata(component); struct cs47l92 *cs47l92 = snd_soc_component_get_drvdata(component);
struct madera_priv *priv = &cs47l92->core; struct madera_priv *priv = &cs47l92->core;
struct madera *madera = priv->madera; struct madera *madera = priv->madera;
...@@ -1933,7 +1932,7 @@ static unsigned int cs47l92_digital_vu[] = { ...@@ -1933,7 +1932,7 @@ static unsigned int cs47l92_digital_vu[] = {
MADERA_DAC_DIGITAL_VOLUME_5R, MADERA_DAC_DIGITAL_VOLUME_5R,
}; };
static const struct snd_compr_ops cs47l92_compr_ops = { static const struct snd_compress_ops cs47l92_compress_ops = {
.open = &cs47l92_open, .open = &cs47l92_open,
.free = &wm_adsp_compr_free, .free = &wm_adsp_compr_free,
.set_params = &wm_adsp_compr_set_params, .set_params = &wm_adsp_compr_set_params,
...@@ -1949,7 +1948,7 @@ static const struct snd_soc_component_driver soc_component_dev_cs47l92 = { ...@@ -1949,7 +1948,7 @@ static const struct snd_soc_component_driver soc_component_dev_cs47l92 = {
.set_sysclk = &madera_set_sysclk, .set_sysclk = &madera_set_sysclk,
.set_pll = &cs47l92_set_fll, .set_pll = &cs47l92_set_fll,
.name = DRV_NAME, .name = DRV_NAME,
.compr_ops = &cs47l92_compr_ops, .compress_ops = &cs47l92_compress_ops,
.controls = cs47l92_snd_controls, .controls = cs47l92_snd_controls,
.num_controls = ARRAY_SIZE(cs47l92_snd_controls), .num_controls = ARRAY_SIZE(cs47l92_snd_controls),
.dapm_widgets = cs47l92_dapm_widgets, .dapm_widgets = cs47l92_dapm_widgets,
......
...@@ -1909,10 +1909,9 @@ static struct snd_soc_dai_driver wm5102_dai[] = { ...@@ -1909,10 +1909,9 @@ static struct snd_soc_dai_driver wm5102_dai[] = {
}, },
}; };
static int wm5102_open(struct snd_compr_stream *stream) static int wm5102_open(struct snd_soc_component *component,
struct snd_compr_stream *stream)
{ {
struct snd_soc_pcm_runtime *rtd = stream->private_data;
struct snd_soc_component *component = snd_soc_rtdcom_lookup(rtd, DRV_NAME);
struct wm5102_priv *priv = snd_soc_component_get_drvdata(component); struct wm5102_priv *priv = snd_soc_component_get_drvdata(component);
return wm_adsp_compr_open(&priv->core.adsp[0], stream); return wm_adsp_compr_open(&priv->core.adsp[0], stream);
...@@ -1992,7 +1991,7 @@ static unsigned int wm5102_digital_vu[] = { ...@@ -1992,7 +1991,7 @@ static unsigned int wm5102_digital_vu[] = {
ARIZONA_DAC_DIGITAL_VOLUME_5R, ARIZONA_DAC_DIGITAL_VOLUME_5R,
}; };
static struct snd_compr_ops wm5102_compr_ops = { static struct snd_compress_ops wm5102_compress_ops = {
.open = wm5102_open, .open = wm5102_open,
.free = wm_adsp_compr_free, .free = wm_adsp_compr_free,
.set_params = wm_adsp_compr_set_params, .set_params = wm_adsp_compr_set_params,
...@@ -2008,7 +2007,7 @@ static const struct snd_soc_component_driver soc_component_dev_wm5102 = { ...@@ -2008,7 +2007,7 @@ static const struct snd_soc_component_driver soc_component_dev_wm5102 = {
.set_sysclk = arizona_set_sysclk, .set_sysclk = arizona_set_sysclk,
.set_pll = wm5102_set_fll, .set_pll = wm5102_set_fll,
.name = DRV_NAME, .name = DRV_NAME,
.compr_ops = &wm5102_compr_ops, .compress_ops = &wm5102_compress_ops,
.controls = wm5102_snd_controls, .controls = wm5102_snd_controls,
.num_controls = ARRAY_SIZE(wm5102_snd_controls), .num_controls = ARRAY_SIZE(wm5102_snd_controls),
.dapm_widgets = wm5102_dapm_widgets, .dapm_widgets = wm5102_dapm_widgets,
......
...@@ -2237,10 +2237,10 @@ static struct snd_soc_dai_driver wm5110_dai[] = { ...@@ -2237,10 +2237,10 @@ static struct snd_soc_dai_driver wm5110_dai[] = {
}, },
}; };
static int wm5110_open(struct snd_compr_stream *stream) static int wm5110_open(struct snd_soc_component *component,
struct snd_compr_stream *stream)
{ {
struct snd_soc_pcm_runtime *rtd = stream->private_data; struct snd_soc_pcm_runtime *rtd = stream->private_data;
struct snd_soc_component *component = snd_soc_rtdcom_lookup(rtd, DRV_NAME);
struct wm5110_priv *priv = snd_soc_component_get_drvdata(component); struct wm5110_priv *priv = snd_soc_component_get_drvdata(component);
struct arizona *arizona = priv->core.arizona; struct arizona *arizona = priv->core.arizona;
int n_adsp; int n_adsp;
...@@ -2355,7 +2355,7 @@ static unsigned int wm5110_digital_vu[] = { ...@@ -2355,7 +2355,7 @@ static unsigned int wm5110_digital_vu[] = {
ARIZONA_DAC_DIGITAL_VOLUME_6R, ARIZONA_DAC_DIGITAL_VOLUME_6R,
}; };
static struct snd_compr_ops wm5110_compr_ops = { static struct snd_compress_ops wm5110_compress_ops = {
.open = wm5110_open, .open = wm5110_open,
.free = wm_adsp_compr_free, .free = wm_adsp_compr_free,
.set_params = wm_adsp_compr_set_params, .set_params = wm_adsp_compr_set_params,
...@@ -2371,7 +2371,7 @@ static const struct snd_soc_component_driver soc_component_dev_wm5110 = { ...@@ -2371,7 +2371,7 @@ static const struct snd_soc_component_driver soc_component_dev_wm5110 = {
.set_sysclk = arizona_set_sysclk, .set_sysclk = arizona_set_sysclk,
.set_pll = wm5110_set_fll, .set_pll = wm5110_set_fll,
.name = DRV_NAME, .name = DRV_NAME,
.compr_ops = &wm5110_compr_ops, .compress_ops = &wm5110_compress_ops,
.controls = wm5110_snd_controls, .controls = wm5110_snd_controls,
.num_controls = ARRAY_SIZE(wm5110_snd_controls), .num_controls = ARRAY_SIZE(wm5110_snd_controls),
.dapm_widgets = wm5110_dapm_widgets, .dapm_widgets = wm5110_dapm_widgets,
......
...@@ -3509,7 +3509,8 @@ int wm_adsp_compr_open(struct wm_adsp *dsp, struct snd_compr_stream *stream) ...@@ -3509,7 +3509,8 @@ int wm_adsp_compr_open(struct wm_adsp *dsp, struct snd_compr_stream *stream)
} }
EXPORT_SYMBOL_GPL(wm_adsp_compr_open); EXPORT_SYMBOL_GPL(wm_adsp_compr_open);
int wm_adsp_compr_free(struct snd_compr_stream *stream) int wm_adsp_compr_free(struct snd_soc_component *component,
struct snd_compr_stream *stream)
{ {
struct wm_adsp_compr *compr = stream->runtime->private_data; struct wm_adsp_compr *compr = stream->runtime->private_data;
struct wm_adsp *dsp = compr->dsp; struct wm_adsp *dsp = compr->dsp;
...@@ -3583,7 +3584,8 @@ static inline unsigned int wm_adsp_compr_frag_words(struct wm_adsp_compr *compr) ...@@ -3583,7 +3584,8 @@ static inline unsigned int wm_adsp_compr_frag_words(struct wm_adsp_compr *compr)
return compr->size.fragment_size / WM_ADSP_DATA_WORD_SIZE; return compr->size.fragment_size / WM_ADSP_DATA_WORD_SIZE;
} }
int wm_adsp_compr_set_params(struct snd_compr_stream *stream, int wm_adsp_compr_set_params(struct snd_soc_component *component,
struct snd_compr_stream *stream,
struct snd_compr_params *params) struct snd_compr_params *params)
{ {
struct wm_adsp_compr *compr = stream->runtime->private_data; struct wm_adsp_compr *compr = stream->runtime->private_data;
...@@ -3610,7 +3612,8 @@ int wm_adsp_compr_set_params(struct snd_compr_stream *stream, ...@@ -3610,7 +3612,8 @@ int wm_adsp_compr_set_params(struct snd_compr_stream *stream,
} }
EXPORT_SYMBOL_GPL(wm_adsp_compr_set_params); EXPORT_SYMBOL_GPL(wm_adsp_compr_set_params);
int wm_adsp_compr_get_caps(struct snd_compr_stream *stream, int wm_adsp_compr_get_caps(struct snd_soc_component *component,
struct snd_compr_stream *stream,
struct snd_compr_caps *caps) struct snd_compr_caps *caps)
{ {
struct wm_adsp_compr *compr = stream->runtime->private_data; struct wm_adsp_compr *compr = stream->runtime->private_data;
...@@ -3976,7 +3979,8 @@ static int wm_adsp_buffer_get_error(struct wm_adsp_compr_buf *buf) ...@@ -3976,7 +3979,8 @@ static int wm_adsp_buffer_get_error(struct wm_adsp_compr_buf *buf)
return 0; return 0;
} }
int wm_adsp_compr_trigger(struct snd_compr_stream *stream, int cmd) int wm_adsp_compr_trigger(struct snd_soc_component *component,
struct snd_compr_stream *stream, int cmd)
{ {
struct wm_adsp_compr *compr = stream->runtime->private_data; struct wm_adsp_compr *compr = stream->runtime->private_data;
struct wm_adsp *dsp = compr->dsp; struct wm_adsp *dsp = compr->dsp;
...@@ -4139,7 +4143,8 @@ static int wm_adsp_buffer_reenable_irq(struct wm_adsp_compr_buf *buf) ...@@ -4139,7 +4143,8 @@ static int wm_adsp_buffer_reenable_irq(struct wm_adsp_compr_buf *buf)
buf->irq_count); buf->irq_count);
} }
int wm_adsp_compr_pointer(struct snd_compr_stream *stream, int wm_adsp_compr_pointer(struct snd_soc_component *component,
struct snd_compr_stream *stream,
struct snd_compr_tstamp *tstamp) struct snd_compr_tstamp *tstamp)
{ {
struct wm_adsp_compr *compr = stream->runtime->private_data; struct wm_adsp_compr *compr = stream->runtime->private_data;
...@@ -4297,7 +4302,8 @@ static int wm_adsp_compr_read(struct wm_adsp_compr *compr, ...@@ -4297,7 +4302,8 @@ static int wm_adsp_compr_read(struct wm_adsp_compr *compr,
return ntotal; return ntotal;
} }
int wm_adsp_compr_copy(struct snd_compr_stream *stream, char __user *buf, int wm_adsp_compr_copy(struct snd_soc_component *component,
struct snd_compr_stream *stream, char __user *buf,
size_t count) size_t count)
{ {
struct wm_adsp_compr *compr = stream->runtime->private_data; struct wm_adsp_compr *compr = stream->runtime->private_data;
......
...@@ -190,16 +190,22 @@ int wm_adsp_fw_put(struct snd_kcontrol *kcontrol, ...@@ -190,16 +190,22 @@ int wm_adsp_fw_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol); struct snd_ctl_elem_value *ucontrol);
int wm_adsp_compr_open(struct wm_adsp *dsp, struct snd_compr_stream *stream); int wm_adsp_compr_open(struct wm_adsp *dsp, struct snd_compr_stream *stream);
int wm_adsp_compr_free(struct snd_compr_stream *stream); int wm_adsp_compr_free(struct snd_soc_component *component,
int wm_adsp_compr_set_params(struct snd_compr_stream *stream, struct snd_compr_stream *stream);
int wm_adsp_compr_set_params(struct snd_soc_component *component,
struct snd_compr_stream *stream,
struct snd_compr_params *params); struct snd_compr_params *params);
int wm_adsp_compr_get_caps(struct snd_compr_stream *stream, int wm_adsp_compr_get_caps(struct snd_soc_component *component,
struct snd_compr_stream *stream,
struct snd_compr_caps *caps); struct snd_compr_caps *caps);
int wm_adsp_compr_trigger(struct snd_compr_stream *stream, int cmd); int wm_adsp_compr_trigger(struct snd_soc_component *component,
struct snd_compr_stream *stream, int cmd);
int wm_adsp_compr_handle_irq(struct wm_adsp *dsp); int wm_adsp_compr_handle_irq(struct wm_adsp *dsp);
int wm_adsp_compr_pointer(struct snd_compr_stream *stream, int wm_adsp_compr_pointer(struct snd_soc_component *component,
struct snd_compr_stream *stream,
struct snd_compr_tstamp *tstamp); struct snd_compr_tstamp *tstamp);
int wm_adsp_compr_copy(struct snd_compr_stream *stream, int wm_adsp_compr_copy(struct snd_soc_component *component,
struct snd_compr_stream *stream,
char __user *buf, size_t count); char __user *buf, size_t count);
int wm_adsp_write_ctl(struct wm_adsp *dsp, const char *name, int type, int wm_adsp_write_ctl(struct wm_adsp *dsp, const char *name, int type,
unsigned int alg, void *buf, size_t len); unsigned int alg, void *buf, size_t len);
......
...@@ -39,7 +39,8 @@ static void sst_drain_notify(void *arg) ...@@ -39,7 +39,8 @@ static void sst_drain_notify(void *arg)
snd_compr_drain_notify(cstream); snd_compr_drain_notify(cstream);
} }
static int sst_platform_compr_open(struct snd_compr_stream *cstream) static int sst_platform_compr_open(struct snd_soc_component *component,
struct snd_compr_stream *cstream)
{ {
int ret_val = 0; int ret_val = 0;
...@@ -72,7 +73,8 @@ static int sst_platform_compr_open(struct snd_compr_stream *cstream) ...@@ -72,7 +73,8 @@ static int sst_platform_compr_open(struct snd_compr_stream *cstream)
return ret_val; return ret_val;
} }
static int sst_platform_compr_free(struct snd_compr_stream *cstream) static int sst_platform_compr_free(struct snd_soc_component *component,
struct snd_compr_stream *cstream)
{ {
struct sst_runtime_stream *stream; struct sst_runtime_stream *stream;
int ret_val = 0, str_id; int ret_val = 0, str_id;
...@@ -91,15 +93,14 @@ static int sst_platform_compr_free(struct snd_compr_stream *cstream) ...@@ -91,15 +93,14 @@ static int sst_platform_compr_free(struct snd_compr_stream *cstream)
return 0; return 0;
} }
static int sst_platform_compr_set_params(struct snd_compr_stream *cstream, static int sst_platform_compr_set_params(struct snd_soc_component *component,
struct snd_compr_stream *cstream,
struct snd_compr_params *params) struct snd_compr_params *params)
{ {
struct sst_runtime_stream *stream; struct sst_runtime_stream *stream;
int retval; int retval;
struct snd_sst_params str_params; struct snd_sst_params str_params;
struct sst_compress_cb cb; struct sst_compress_cb cb;
struct snd_soc_pcm_runtime *rtd = cstream->private_data;
struct snd_soc_component *component = snd_soc_rtdcom_lookup(rtd, DRV_NAME);
struct sst_data *ctx = snd_soc_component_get_drvdata(component); struct sst_data *ctx = snd_soc_component_get_drvdata(component);
stream = cstream->runtime->private_data; stream = cstream->runtime->private_data;
...@@ -166,7 +167,8 @@ static int sst_platform_compr_set_params(struct snd_compr_stream *cstream, ...@@ -166,7 +167,8 @@ static int sst_platform_compr_set_params(struct snd_compr_stream *cstream,
return 0; return 0;
} }
static int sst_platform_compr_trigger(struct snd_compr_stream *cstream, int cmd) static int sst_platform_compr_trigger(struct snd_soc_component *component,
struct snd_compr_stream *cstream, int cmd)
{ {
struct sst_runtime_stream *stream = cstream->runtime->private_data; struct sst_runtime_stream *stream = cstream->runtime->private_data;
...@@ -199,7 +201,8 @@ static int sst_platform_compr_trigger(struct snd_compr_stream *cstream, int cmd) ...@@ -199,7 +201,8 @@ static int sst_platform_compr_trigger(struct snd_compr_stream *cstream, int cmd)
return -EINVAL; return -EINVAL;
} }
static int sst_platform_compr_pointer(struct snd_compr_stream *cstream, static int sst_platform_compr_pointer(struct snd_soc_component *component,
struct snd_compr_stream *cstream,
struct snd_compr_tstamp *tstamp) struct snd_compr_tstamp *tstamp)
{ {
struct sst_runtime_stream *stream; struct sst_runtime_stream *stream;
...@@ -212,7 +215,8 @@ static int sst_platform_compr_pointer(struct snd_compr_stream *cstream, ...@@ -212,7 +215,8 @@ static int sst_platform_compr_pointer(struct snd_compr_stream *cstream,
return 0; return 0;
} }
static int sst_platform_compr_ack(struct snd_compr_stream *cstream, static int sst_platform_compr_ack(struct snd_soc_component *component,
struct snd_compr_stream *cstream,
size_t bytes) size_t bytes)
{ {
struct sst_runtime_stream *stream; struct sst_runtime_stream *stream;
...@@ -224,7 +228,8 @@ static int sst_platform_compr_ack(struct snd_compr_stream *cstream, ...@@ -224,7 +228,8 @@ static int sst_platform_compr_ack(struct snd_compr_stream *cstream,
return 0; return 0;
} }
static int sst_platform_compr_get_caps(struct snd_compr_stream *cstream, static int sst_platform_compr_get_caps(struct snd_soc_component *component,
struct snd_compr_stream *cstream,
struct snd_compr_caps *caps) struct snd_compr_caps *caps)
{ {
struct sst_runtime_stream *stream = struct sst_runtime_stream *stream =
...@@ -233,7 +238,8 @@ static int sst_platform_compr_get_caps(struct snd_compr_stream *cstream, ...@@ -233,7 +238,8 @@ static int sst_platform_compr_get_caps(struct snd_compr_stream *cstream,
return stream->compr_ops->get_caps(caps); return stream->compr_ops->get_caps(caps);
} }
static int sst_platform_compr_get_codec_caps(struct snd_compr_stream *cstream, static int sst_platform_compr_get_codec_caps(struct snd_soc_component *component,
struct snd_compr_stream *cstream,
struct snd_compr_codec_caps *codec) struct snd_compr_codec_caps *codec)
{ {
struct sst_runtime_stream *stream = struct sst_runtime_stream *stream =
...@@ -242,7 +248,8 @@ static int sst_platform_compr_get_codec_caps(struct snd_compr_stream *cstream, ...@@ -242,7 +248,8 @@ static int sst_platform_compr_get_codec_caps(struct snd_compr_stream *cstream,
return stream->compr_ops->get_codec_caps(codec); return stream->compr_ops->get_codec_caps(codec);
} }
static int sst_platform_compr_set_metadata(struct snd_compr_stream *cstream, static int sst_platform_compr_set_metadata(struct snd_soc_component *component,
struct snd_compr_stream *cstream,
struct snd_compr_metadata *metadata) struct snd_compr_metadata *metadata)
{ {
struct sst_runtime_stream *stream = struct sst_runtime_stream *stream =
...@@ -251,7 +258,7 @@ static int sst_platform_compr_set_metadata(struct snd_compr_stream *cstream, ...@@ -251,7 +258,7 @@ static int sst_platform_compr_set_metadata(struct snd_compr_stream *cstream,
return stream->compr_ops->set_metadata(sst->dev, stream->id, metadata); return stream->compr_ops->set_metadata(sst->dev, stream->id, metadata);
} }
const struct snd_compr_ops sst_platform_compr_ops = { const struct snd_compress_ops sst_platform_compress_ops = {
.open = sst_platform_compr_open, .open = sst_platform_compr_open,
.free = sst_platform_compr_free, .free = sst_platform_compr_free,
......
...@@ -684,7 +684,7 @@ static const struct snd_soc_component_driver sst_soc_platform_drv = { ...@@ -684,7 +684,7 @@ static const struct snd_soc_component_driver sst_soc_platform_drv = {
.open = sst_soc_open, .open = sst_soc_open,
.trigger = sst_soc_trigger, .trigger = sst_soc_trigger,
.pointer = sst_soc_pointer, .pointer = sst_soc_pointer,
.compr_ops = &sst_platform_compr_ops, .compress_ops = &sst_platform_compress_ops,
.pcm_construct = sst_soc_pcm_new, .pcm_construct = sst_soc_pcm_new,
}; };
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#include "sst-atom-controls.h" #include "sst-atom-controls.h"
extern struct sst_device *sst; extern struct sst_device *sst;
extern const struct snd_compr_ops sst_platform_compr_ops; extern const struct snd_compress_ops sst_platform_compress_ops;
#define DRV_NAME "sst" #define DRV_NAME "sst"
......
...@@ -540,19 +540,19 @@ static void compress_event_handler(uint32_t opcode, uint32_t token, ...@@ -540,19 +540,19 @@ static void compress_event_handler(uint32_t opcode, uint32_t token,
} }
} }
static int q6asm_dai_compr_open(struct snd_compr_stream *stream) static int q6asm_dai_compr_open(struct snd_soc_component *component,
struct snd_compr_stream *stream)
{ {
struct snd_soc_pcm_runtime *rtd = stream->private_data; struct snd_soc_pcm_runtime *rtd = stream->private_data;
struct snd_soc_component *c = snd_soc_rtdcom_lookup(rtd, DRV_NAME);
struct snd_compr_runtime *runtime = stream->runtime; struct snd_compr_runtime *runtime = stream->runtime;
struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
struct q6asm_dai_data *pdata; struct q6asm_dai_data *pdata;
struct device *dev = c->dev; struct device *dev = component->dev;
struct q6asm_dai_rtd *prtd; struct q6asm_dai_rtd *prtd;
int stream_id, size, ret; int stream_id, size, ret;
stream_id = cpu_dai->driver->id; stream_id = cpu_dai->driver->id;
pdata = snd_soc_component_get_drvdata(c); pdata = snd_soc_component_get_drvdata(component);
if (!pdata) { if (!pdata) {
dev_err(dev, "Drv data not found ..\n"); dev_err(dev, "Drv data not found ..\n");
return -EINVAL; return -EINVAL;
...@@ -600,7 +600,8 @@ static int q6asm_dai_compr_open(struct snd_compr_stream *stream) ...@@ -600,7 +600,8 @@ static int q6asm_dai_compr_open(struct snd_compr_stream *stream)
return ret; return ret;
} }
static int q6asm_dai_compr_free(struct snd_compr_stream *stream) static int q6asm_dai_compr_free(struct snd_soc_component *component,
struct snd_compr_stream *stream)
{ {
struct snd_compr_runtime *runtime = stream->runtime; struct snd_compr_runtime *runtime = stream->runtime;
struct q6asm_dai_rtd *prtd = runtime->private_data; struct q6asm_dai_rtd *prtd = runtime->private_data;
...@@ -622,13 +623,13 @@ static int q6asm_dai_compr_free(struct snd_compr_stream *stream) ...@@ -622,13 +623,13 @@ static int q6asm_dai_compr_free(struct snd_compr_stream *stream)
return 0; return 0;
} }
static int q6asm_dai_compr_set_params(struct snd_compr_stream *stream, static int q6asm_dai_compr_set_params(struct snd_soc_component *component,
struct snd_compr_stream *stream,
struct snd_compr_params *params) struct snd_compr_params *params)
{ {
struct snd_compr_runtime *runtime = stream->runtime; struct snd_compr_runtime *runtime = stream->runtime;
struct q6asm_dai_rtd *prtd = runtime->private_data; struct q6asm_dai_rtd *prtd = runtime->private_data;
struct snd_soc_pcm_runtime *rtd = stream->private_data; struct snd_soc_pcm_runtime *rtd = stream->private_data;
struct snd_soc_component *c = snd_soc_rtdcom_lookup(rtd, DRV_NAME);
int dir = stream->direction; int dir = stream->direction;
struct q6asm_dai_data *pdata; struct q6asm_dai_data *pdata;
struct q6asm_flac_cfg flac_cfg; struct q6asm_flac_cfg flac_cfg;
...@@ -636,7 +637,7 @@ static int q6asm_dai_compr_set_params(struct snd_compr_stream *stream, ...@@ -636,7 +637,7 @@ static int q6asm_dai_compr_set_params(struct snd_compr_stream *stream,
struct q6asm_alac_cfg alac_cfg; struct q6asm_alac_cfg alac_cfg;
struct q6asm_ape_cfg ape_cfg; struct q6asm_ape_cfg ape_cfg;
unsigned int wma_v9 = 0; unsigned int wma_v9 = 0;
struct device *dev = c->dev; struct device *dev = component->dev;
int ret; int ret;
union snd_codec_options *codec_options; union snd_codec_options *codec_options;
struct snd_dec_flac *flac; struct snd_dec_flac *flac;
...@@ -649,7 +650,7 @@ static int q6asm_dai_compr_set_params(struct snd_compr_stream *stream, ...@@ -649,7 +650,7 @@ static int q6asm_dai_compr_set_params(struct snd_compr_stream *stream,
memcpy(&prtd->codec_param, params, sizeof(*params)); memcpy(&prtd->codec_param, params, sizeof(*params));
pdata = snd_soc_component_get_drvdata(c); pdata = snd_soc_component_get_drvdata(component);
if (!pdata) if (!pdata)
return -EINVAL; return -EINVAL;
...@@ -842,7 +843,8 @@ static int q6asm_dai_compr_set_params(struct snd_compr_stream *stream, ...@@ -842,7 +843,8 @@ static int q6asm_dai_compr_set_params(struct snd_compr_stream *stream,
return 0; return 0;
} }
static int q6asm_dai_compr_trigger(struct snd_compr_stream *stream, int cmd) static int q6asm_dai_compr_trigger(struct snd_soc_component *component,
struct snd_compr_stream *stream, int cmd)
{ {
struct snd_compr_runtime *runtime = stream->runtime; struct snd_compr_runtime *runtime = stream->runtime;
struct q6asm_dai_rtd *prtd = runtime->private_data; struct q6asm_dai_rtd *prtd = runtime->private_data;
...@@ -870,7 +872,8 @@ static int q6asm_dai_compr_trigger(struct snd_compr_stream *stream, int cmd) ...@@ -870,7 +872,8 @@ static int q6asm_dai_compr_trigger(struct snd_compr_stream *stream, int cmd)
return ret; return ret;
} }
static int q6asm_dai_compr_pointer(struct snd_compr_stream *stream, static int q6asm_dai_compr_pointer(struct snd_soc_component *component,
struct snd_compr_stream *stream,
struct snd_compr_tstamp *tstamp) struct snd_compr_tstamp *tstamp)
{ {
struct snd_compr_runtime *runtime = stream->runtime; struct snd_compr_runtime *runtime = stream->runtime;
...@@ -887,7 +890,8 @@ static int q6asm_dai_compr_pointer(struct snd_compr_stream *stream, ...@@ -887,7 +890,8 @@ static int q6asm_dai_compr_pointer(struct snd_compr_stream *stream,
return 0; return 0;
} }
static int q6asm_dai_compr_ack(struct snd_compr_stream *stream, static int q6asm_dai_compr_ack(struct snd_soc_component *component,
struct snd_compr_stream *stream,
size_t count) size_t count)
{ {
struct snd_compr_runtime *runtime = stream->runtime; struct snd_compr_runtime *runtime = stream->runtime;
...@@ -901,21 +905,21 @@ static int q6asm_dai_compr_ack(struct snd_compr_stream *stream, ...@@ -901,21 +905,21 @@ static int q6asm_dai_compr_ack(struct snd_compr_stream *stream,
return count; return count;
} }
static int q6asm_dai_compr_mmap(struct snd_compr_stream *stream, static int q6asm_dai_compr_mmap(struct snd_soc_component *component,
struct snd_compr_stream *stream,
struct vm_area_struct *vma) struct vm_area_struct *vma)
{ {
struct snd_compr_runtime *runtime = stream->runtime; struct snd_compr_runtime *runtime = stream->runtime;
struct q6asm_dai_rtd *prtd = runtime->private_data; struct q6asm_dai_rtd *prtd = runtime->private_data;
struct snd_soc_pcm_runtime *rtd = stream->private_data; struct device *dev = component->dev;
struct snd_soc_component *c = snd_soc_rtdcom_lookup(rtd, DRV_NAME);
struct device *dev = c->dev;
return dma_mmap_coherent(dev, vma, return dma_mmap_coherent(dev, vma,
prtd->dma_buffer.area, prtd->dma_buffer.addr, prtd->dma_buffer.area, prtd->dma_buffer.addr,
prtd->dma_buffer.bytes); prtd->dma_buffer.bytes);
} }
static int q6asm_dai_compr_get_caps(struct snd_compr_stream *stream, static int q6asm_dai_compr_get_caps(struct snd_soc_component *component,
struct snd_compr_stream *stream,
struct snd_compr_caps *caps) struct snd_compr_caps *caps)
{ {
caps->direction = SND_COMPRESS_PLAYBACK; caps->direction = SND_COMPRESS_PLAYBACK;
...@@ -933,7 +937,8 @@ static int q6asm_dai_compr_get_caps(struct snd_compr_stream *stream, ...@@ -933,7 +937,8 @@ static int q6asm_dai_compr_get_caps(struct snd_compr_stream *stream,
return 0; return 0;
} }
static int q6asm_dai_compr_get_codec_caps(struct snd_compr_stream *stream, static int q6asm_dai_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)
{ {
switch (codec->codec) { switch (codec->codec) {
...@@ -947,7 +952,7 @@ static int q6asm_dai_compr_get_codec_caps(struct snd_compr_stream *stream, ...@@ -947,7 +952,7 @@ static int q6asm_dai_compr_get_codec_caps(struct snd_compr_stream *stream,
return 0; return 0;
} }
static struct snd_compr_ops q6asm_dai_compr_ops = { static struct snd_compress_ops q6asm_dai_compress_ops = {
.open = q6asm_dai_compr_open, .open = q6asm_dai_compr_open,
.free = q6asm_dai_compr_free, .free = q6asm_dai_compr_free,
.set_params = q6asm_dai_compr_set_params, .set_params = q6asm_dai_compr_set_params,
...@@ -1021,7 +1026,7 @@ static const struct snd_soc_component_driver q6asm_fe_dai_component = { ...@@ -1021,7 +1026,7 @@ static const struct snd_soc_component_driver q6asm_fe_dai_component = {
.mmap = q6asm_dai_mmap, .mmap = q6asm_dai_mmap,
.pcm_construct = q6asm_dai_pcm_new, .pcm_construct = q6asm_dai_pcm_new,
.pcm_destruct = q6asm_dai_pcm_free, .pcm_destruct = q6asm_dai_pcm_free,
.compr_ops = &q6asm_dai_compr_ops, .compress_ops = &q6asm_dai_compress_ops,
}; };
static struct snd_soc_dai_driver q6asm_fe_dais_template[] = { static struct snd_soc_dai_driver q6asm_fe_dais_template[] = {
......
...@@ -29,11 +29,11 @@ static int soc_compr_components_open(struct snd_compr_stream *cstream, ...@@ -29,11 +29,11 @@ static int soc_compr_components_open(struct snd_compr_stream *cstream,
int i, ret; int i, ret;
for_each_rtd_components(rtd, i, component) { for_each_rtd_components(rtd, i, component) {
if (!component->driver->compr_ops || if (!component->driver->compress_ops ||
!component->driver->compr_ops->open) !component->driver->compress_ops->open)
continue; continue;
ret = component->driver->compr_ops->open(cstream); ret = component->driver->compress_ops->open(component, cstream);
if (ret < 0) { if (ret < 0) {
dev_err(component->dev, dev_err(component->dev,
"Compress ASoC: can't open platform %s: %d\n", "Compress ASoC: can't open platform %s: %d\n",
...@@ -59,11 +59,11 @@ static int soc_compr_components_free(struct snd_compr_stream *cstream, ...@@ -59,11 +59,11 @@ static int soc_compr_components_free(struct snd_compr_stream *cstream,
if (component == last) if (component == last)
break; break;
if (!component->driver->compr_ops || if (!component->driver->compress_ops ||
!component->driver->compr_ops->free) !component->driver->compress_ops->free)
continue; continue;
component->driver->compr_ops->free(cstream); component->driver->compress_ops->free(component, cstream);
} }
return 0; return 0;
...@@ -328,11 +328,12 @@ static int soc_compr_components_trigger(struct snd_compr_stream *cstream, ...@@ -328,11 +328,12 @@ static int soc_compr_components_trigger(struct snd_compr_stream *cstream,
int i, ret; int i, ret;
for_each_rtd_components(rtd, i, component) { for_each_rtd_components(rtd, i, component) {
if (!component->driver->compr_ops || if (!component->driver->compress_ops ||
!component->driver->compr_ops->trigger) !component->driver->compress_ops->trigger)
continue; continue;
ret = component->driver->compr_ops->trigger(cstream, cmd); ret = component->driver->compress_ops->trigger(
component, cstream, cmd);
if (ret < 0) if (ret < 0)
return ret; return ret;
} }
...@@ -430,11 +431,12 @@ static int soc_compr_components_set_params(struct snd_compr_stream *cstream, ...@@ -430,11 +431,12 @@ static int soc_compr_components_set_params(struct snd_compr_stream *cstream,
int i, ret; int i, ret;
for_each_rtd_components(rtd, i, component) { for_each_rtd_components(rtd, i, component) {
if (!component->driver->compr_ops || if (!component->driver->compress_ops ||
!component->driver->compr_ops->set_params) !component->driver->compress_ops->set_params)
continue; continue;
ret = component->driver->compr_ops->set_params(cstream, params); ret = component->driver->compress_ops->set_params(
component, cstream, params);
if (ret < 0) if (ret < 0)
return ret; return ret;
} }
...@@ -570,11 +572,12 @@ static int soc_compr_get_params(struct snd_compr_stream *cstream, ...@@ -570,11 +572,12 @@ static int soc_compr_get_params(struct snd_compr_stream *cstream,
} }
for_each_rtd_components(rtd, i, component) { for_each_rtd_components(rtd, i, component) {
if (!component->driver->compr_ops || if (!component->driver->compress_ops ||
!component->driver->compr_ops->get_params) !component->driver->compress_ops->get_params)
continue; continue;
ret = component->driver->compr_ops->get_params(cstream, params); ret = component->driver->compress_ops->get_params(
component, cstream, params);
break; break;
} }
...@@ -593,11 +596,12 @@ static int soc_compr_get_caps(struct snd_compr_stream *cstream, ...@@ -593,11 +596,12 @@ static int soc_compr_get_caps(struct snd_compr_stream *cstream,
mutex_lock_nested(&rtd->card->pcm_mutex, rtd->card->pcm_subclass); mutex_lock_nested(&rtd->card->pcm_mutex, rtd->card->pcm_subclass);
for_each_rtd_components(rtd, i, component) { for_each_rtd_components(rtd, i, component) {
if (!component->driver->compr_ops || if (!component->driver->compress_ops ||
!component->driver->compr_ops->get_caps) !component->driver->compress_ops->get_caps)
continue; continue;
ret = component->driver->compr_ops->get_caps(cstream, caps); ret = component->driver->compress_ops->get_caps(
component, cstream, caps);
break; break;
} }
...@@ -615,12 +619,12 @@ static int soc_compr_get_codec_caps(struct snd_compr_stream *cstream, ...@@ -615,12 +619,12 @@ static int soc_compr_get_codec_caps(struct snd_compr_stream *cstream,
mutex_lock_nested(&rtd->card->pcm_mutex, rtd->card->pcm_subclass); mutex_lock_nested(&rtd->card->pcm_mutex, rtd->card->pcm_subclass);
for_each_rtd_components(rtd, i, component) { for_each_rtd_components(rtd, i, component) {
if (!component->driver->compr_ops || if (!component->driver->compress_ops ||
!component->driver->compr_ops->get_codec_caps) !component->driver->compress_ops->get_codec_caps)
continue; continue;
ret = component->driver->compr_ops->get_codec_caps(cstream, ret = component->driver->compress_ops->get_codec_caps(
codec); component, cstream, codec);
break; break;
} }
...@@ -644,11 +648,12 @@ static int soc_compr_ack(struct snd_compr_stream *cstream, size_t bytes) ...@@ -644,11 +648,12 @@ static int soc_compr_ack(struct snd_compr_stream *cstream, size_t bytes)
} }
for_each_rtd_components(rtd, i, component) { for_each_rtd_components(rtd, i, component) {
if (!component->driver->compr_ops || if (!component->driver->compress_ops ||
!component->driver->compr_ops->ack) !component->driver->compress_ops->ack)
continue; continue;
ret = component->driver->compr_ops->ack(cstream, bytes); ret = component->driver->compress_ops->ack(
component, cstream, bytes);
if (ret < 0) if (ret < 0)
goto err; goto err;
} }
...@@ -672,11 +677,12 @@ static int soc_compr_pointer(struct snd_compr_stream *cstream, ...@@ -672,11 +677,12 @@ static int soc_compr_pointer(struct snd_compr_stream *cstream,
cpu_dai->driver->cops->pointer(cstream, tstamp, cpu_dai); cpu_dai->driver->cops->pointer(cstream, tstamp, cpu_dai);
for_each_rtd_components(rtd, i, component) { for_each_rtd_components(rtd, i, component) {
if (!component->driver->compr_ops || if (!component->driver->compress_ops ||
!component->driver->compr_ops->pointer) !component->driver->compress_ops->pointer)
continue; continue;
ret = component->driver->compr_ops->pointer(cstream, tstamp); ret = component->driver->compress_ops->pointer(
component, cstream, tstamp);
break; break;
} }
...@@ -694,11 +700,12 @@ static int soc_compr_copy(struct snd_compr_stream *cstream, ...@@ -694,11 +700,12 @@ static int soc_compr_copy(struct snd_compr_stream *cstream,
mutex_lock_nested(&rtd->card->pcm_mutex, rtd->card->pcm_subclass); mutex_lock_nested(&rtd->card->pcm_mutex, rtd->card->pcm_subclass);
for_each_rtd_components(rtd, i, component) { for_each_rtd_components(rtd, i, component) {
if (!component->driver->compr_ops || if (!component->driver->compress_ops ||
!component->driver->compr_ops->copy) !component->driver->compress_ops->copy)
continue; continue;
ret = component->driver->compr_ops->copy(cstream, buf, count); ret = component->driver->compress_ops->copy(
component, cstream, buf, count);
break; break;
} }
...@@ -721,12 +728,12 @@ static int soc_compr_set_metadata(struct snd_compr_stream *cstream, ...@@ -721,12 +728,12 @@ static int soc_compr_set_metadata(struct snd_compr_stream *cstream,
} }
for_each_rtd_components(rtd, i, component) { for_each_rtd_components(rtd, i, component) {
if (!component->driver->compr_ops || if (!component->driver->compress_ops ||
!component->driver->compr_ops->set_metadata) !component->driver->compress_ops->set_metadata)
continue; continue;
ret = component->driver->compr_ops->set_metadata(cstream, ret = component->driver->compress_ops->set_metadata(
metadata); component, cstream, metadata);
if (ret < 0) if (ret < 0)
return ret; return ret;
} }
...@@ -749,12 +756,12 @@ static int soc_compr_get_metadata(struct snd_compr_stream *cstream, ...@@ -749,12 +756,12 @@ static int soc_compr_get_metadata(struct snd_compr_stream *cstream,
} }
for_each_rtd_components(rtd, i, component) { for_each_rtd_components(rtd, i, component) {
if (!component->driver->compr_ops || if (!component->driver->compress_ops ||
!component->driver->compr_ops->get_metadata) !component->driver->compress_ops->get_metadata)
continue; continue;
return component->driver->compr_ops->get_metadata(cstream, return component->driver->compress_ops->get_metadata(
metadata); component, cstream, metadata);
} }
return 0; return 0;
...@@ -879,8 +886,8 @@ int snd_soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num) ...@@ -879,8 +886,8 @@ int snd_soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num)
} }
for_each_rtd_components(rtd, i, component) { for_each_rtd_components(rtd, i, component) {
if (!component->driver->compr_ops || if (!component->driver->compress_ops ||
!component->driver->compr_ops->copy) !component->driver->compress_ops->copy)
continue; continue;
compr->ops->copy = soc_compr_copy; compr->ops->copy = soc_compr_copy;
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include "ops.h" #include "ops.h"
#include "probe.h" #include "probe.h"
struct snd_compr_ops sof_probe_compressed_ops = { struct snd_compress_ops sof_probe_compressed_ops = {
.copy = sof_probe_compr_copy, .copy = sof_probe_compr_copy,
}; };
EXPORT_SYMBOL(sof_probe_compressed_ops); EXPORT_SYMBOL(sof_probe_compressed_ops);
...@@ -117,7 +117,8 @@ int sof_probe_compr_pointer(struct snd_compr_stream *cstream, ...@@ -117,7 +117,8 @@ int sof_probe_compr_pointer(struct snd_compr_stream *cstream,
} }
EXPORT_SYMBOL(sof_probe_compr_pointer); EXPORT_SYMBOL(sof_probe_compr_pointer);
int sof_probe_compr_copy(struct snd_compr_stream *cstream, int sof_probe_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_compr_runtime *rtd = cstream->runtime; struct snd_compr_runtime *rtd = cstream->runtime;
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include <sound/compress_driver.h> #include <sound/compress_driver.h>
extern struct snd_compr_ops sof_probe_compressed_ops; extern struct snd_compress_ops sof_probe_compressed_ops;
int sof_probe_compr_open(struct snd_compr_stream *cstream, int sof_probe_compr_open(struct snd_compr_stream *cstream,
struct snd_soc_dai *dai); struct snd_soc_dai *dai);
...@@ -25,7 +25,8 @@ int sof_probe_compr_trigger(struct snd_compr_stream *cstream, int cmd, ...@@ -25,7 +25,8 @@ int sof_probe_compr_trigger(struct snd_compr_stream *cstream, int cmd,
struct snd_soc_dai *dai); struct snd_soc_dai *dai);
int sof_probe_compr_pointer(struct snd_compr_stream *cstream, int sof_probe_compr_pointer(struct snd_compr_stream *cstream,
struct snd_compr_tstamp *tstamp, struct snd_soc_dai *dai); struct snd_compr_tstamp *tstamp, struct snd_soc_dai *dai);
int sof_probe_compr_copy(struct snd_compr_stream *cstream, int sof_probe_compr_copy(struct snd_soc_component *component,
struct snd_compr_stream *cstream,
char __user *buf, size_t count); char __user *buf, size_t count);
#endif #endif
...@@ -785,11 +785,11 @@ void snd_sof_new_platform_drv(struct snd_sof_dev *sdev) ...@@ -785,11 +785,11 @@ void snd_sof_new_platform_drv(struct snd_sof_dev *sdev)
pd->pointer = sof_pcm_pointer; pd->pointer = sof_pcm_pointer;
#if IS_ENABLED(CONFIG_SND_SOC_SOF_COMPRESS) #if IS_ENABLED(CONFIG_SND_SOC_SOF_COMPRESS)
pd->compr_ops = &sof_compressed_ops; pd->compress_ops = &sof_compressed_ops;
#endif #endif
#if IS_ENABLED(CONFIG_SND_SOC_SOF_DEBUG_PROBES) #if IS_ENABLED(CONFIG_SND_SOC_SOF_DEBUG_PROBES)
/* override cops when probe support is enabled */ /* override cops when probe support is enabled */
pd->compr_ops = &sof_probe_compressed_ops; pd->compress_ops = &sof_probe_compressed_ops;
#endif #endif
pd->pcm_construct = sof_pcm_new; pd->pcm_construct = sof_pcm_new;
pd->ignore_machine = drv_name; pd->ignore_machine = drv_name;
......
...@@ -522,7 +522,7 @@ void snd_sof_handle_fw_exception(struct snd_sof_dev *sdev); ...@@ -522,7 +522,7 @@ void snd_sof_handle_fw_exception(struct snd_sof_dev *sdev);
/* /*
* Platform specific ops. * Platform specific ops.
*/ */
extern struct snd_compr_ops sof_compressed_ops; extern struct snd_compress_ops sof_compressed_ops;
/* /*
* DSP Architectures. * DSP Architectures.
......
...@@ -96,7 +96,8 @@ struct sprd_compr_stream { ...@@ -96,7 +96,8 @@ struct sprd_compr_stream {
int stage1_pointer; int stage1_pointer;
}; };
static int sprd_platform_compr_trigger(struct snd_compr_stream *cstream, static int sprd_platform_compr_trigger(struct snd_soc_component *component,
struct snd_compr_stream *cstream,
int cmd); int cmd);
static void sprd_platform_compr_drain_notify(void *arg) static void sprd_platform_compr_drain_notify(void *arg)
...@@ -125,15 +126,14 @@ static void sprd_platform_compr_dma_complete(void *data) ...@@ -125,15 +126,14 @@ static void sprd_platform_compr_dma_complete(void *data)
snd_compr_fragment_elapsed(cstream); snd_compr_fragment_elapsed(cstream);
} }
static int sprd_platform_compr_dma_config(struct snd_compr_stream *cstream, static int sprd_platform_compr_dma_config(struct snd_soc_component *component,
struct snd_compr_stream *cstream,
struct snd_compr_params *params, struct snd_compr_params *params,
int channel) int channel)
{ {
struct snd_compr_runtime *runtime = cstream->runtime; struct snd_compr_runtime *runtime = cstream->runtime;
struct sprd_compr_stream *stream = runtime->private_data; struct sprd_compr_stream *stream = runtime->private_data;
struct snd_soc_pcm_runtime *rtd = cstream->private_data; struct snd_soc_pcm_runtime *rtd = cstream->private_data;
struct snd_soc_component *component =
snd_soc_rtdcom_lookup(rtd, DRV_NAME);
struct device *dev = component->dev; struct device *dev = component->dev;
struct sprd_compr_data *data = snd_soc_dai_get_drvdata(asoc_rtd_to_cpu(rtd, 0)); struct sprd_compr_data *data = snd_soc_dai_get_drvdata(asoc_rtd_to_cpu(rtd, 0));
struct sprd_pcm_dma_params *dma_params = data->dma_params; struct sprd_pcm_dma_params *dma_params = data->dma_params;
...@@ -261,14 +261,12 @@ static int sprd_platform_compr_dma_config(struct snd_compr_stream *cstream, ...@@ -261,14 +261,12 @@ static int sprd_platform_compr_dma_config(struct snd_compr_stream *cstream,
return ret; return ret;
} }
static int sprd_platform_compr_set_params(struct snd_compr_stream *cstream, static int sprd_platform_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_compr_runtime *runtime = cstream->runtime; struct snd_compr_runtime *runtime = cstream->runtime;
struct sprd_compr_stream *stream = runtime->private_data; struct sprd_compr_stream *stream = runtime->private_data;
struct snd_soc_pcm_runtime *rtd = cstream->private_data;
struct snd_soc_component *component =
snd_soc_rtdcom_lookup(rtd, DRV_NAME);
struct device *dev = component->dev; struct device *dev = component->dev;
struct sprd_compr_params compr_params = { }; struct sprd_compr_params compr_params = { };
int ret; int ret;
...@@ -279,13 +277,13 @@ static int sprd_platform_compr_set_params(struct snd_compr_stream *cstream, ...@@ -279,13 +277,13 @@ static int sprd_platform_compr_set_params(struct snd_compr_stream *cstream,
* means once the source channel's transaction is done, it will trigger * means once the source channel's transaction is done, it will trigger
* the destination channel's transaction automatically. * the destination channel's transaction automatically.
*/ */
ret = sprd_platform_compr_dma_config(cstream, params, 1); ret = sprd_platform_compr_dma_config(component, cstream, params, 1);
if (ret) { if (ret) {
dev_err(dev, "failed to config stage 1 DMA: %d\n", ret); dev_err(dev, "failed to config stage 1 DMA: %d\n", ret);
return ret; return ret;
} }
ret = sprd_platform_compr_dma_config(cstream, params, 0); ret = sprd_platform_compr_dma_config(component, cstream, params, 0);
if (ret) { if (ret) {
dev_err(dev, "failed to config stage 0 DMA: %d\n", ret); dev_err(dev, "failed to config stage 0 DMA: %d\n", ret);
goto config_err; goto config_err;
...@@ -314,12 +312,11 @@ static int sprd_platform_compr_set_params(struct snd_compr_stream *cstream, ...@@ -314,12 +312,11 @@ static int sprd_platform_compr_set_params(struct snd_compr_stream *cstream,
return ret; return ret;
} }
static int sprd_platform_compr_open(struct snd_compr_stream *cstream) static int sprd_platform_compr_open(struct snd_soc_component *component,
struct snd_compr_stream *cstream)
{ {
struct snd_compr_runtime *runtime = cstream->runtime; struct snd_compr_runtime *runtime = cstream->runtime;
struct snd_soc_pcm_runtime *rtd = cstream->private_data; struct snd_soc_pcm_runtime *rtd = cstream->private_data;
struct snd_soc_component *component =
snd_soc_rtdcom_lookup(rtd, DRV_NAME);
struct device *dev = component->dev; struct device *dev = component->dev;
struct sprd_compr_data *data = snd_soc_dai_get_drvdata(asoc_rtd_to_cpu(rtd, 0)); struct sprd_compr_data *data = snd_soc_dai_get_drvdata(asoc_rtd_to_cpu(rtd, 0));
struct sprd_compr_stream *stream; struct sprd_compr_stream *stream;
...@@ -392,13 +389,11 @@ static int sprd_platform_compr_open(struct snd_compr_stream *cstream) ...@@ -392,13 +389,11 @@ static int sprd_platform_compr_open(struct snd_compr_stream *cstream)
return ret; return ret;
} }
static int sprd_platform_compr_free(struct snd_compr_stream *cstream) static int sprd_platform_compr_free(struct snd_soc_component *component,
struct snd_compr_stream *cstream)
{ {
struct snd_compr_runtime *runtime = cstream->runtime; struct snd_compr_runtime *runtime = cstream->runtime;
struct sprd_compr_stream *stream = runtime->private_data; struct sprd_compr_stream *stream = runtime->private_data;
struct snd_soc_pcm_runtime *rtd = cstream->private_data;
struct snd_soc_component *component =
snd_soc_rtdcom_lookup(rtd, DRV_NAME);
struct device *dev = component->dev; struct device *dev = component->dev;
int stream_id = cstream->direction, i; int stream_id = cstream->direction, i;
...@@ -420,14 +415,12 @@ static int sprd_platform_compr_free(struct snd_compr_stream *cstream) ...@@ -420,14 +415,12 @@ static int sprd_platform_compr_free(struct snd_compr_stream *cstream)
return 0; return 0;
} }
static int sprd_platform_compr_trigger(struct snd_compr_stream *cstream, static int sprd_platform_compr_trigger(struct snd_soc_component *component,
struct snd_compr_stream *cstream,
int cmd) int cmd)
{ {
struct snd_compr_runtime *runtime = cstream->runtime; struct snd_compr_runtime *runtime = cstream->runtime;
struct sprd_compr_stream *stream = runtime->private_data; struct sprd_compr_stream *stream = runtime->private_data;
struct snd_soc_pcm_runtime *rtd = cstream->private_data;
struct snd_soc_component *component =
snd_soc_rtdcom_lookup(rtd, DRV_NAME);
struct device *dev = component->dev; struct device *dev = component->dev;
int channels = stream->num_channels, ret = 0, i; int channels = stream->num_channels, ret = 0, i;
int stream_id = cstream->direction; int stream_id = cstream->direction;
...@@ -518,7 +511,8 @@ static int sprd_platform_compr_trigger(struct snd_compr_stream *cstream, ...@@ -518,7 +511,8 @@ static int sprd_platform_compr_trigger(struct snd_compr_stream *cstream,
return ret; return ret;
} }
static int sprd_platform_compr_pointer(struct snd_compr_stream *cstream, static int sprd_platform_compr_pointer(struct snd_soc_component *component,
struct snd_compr_stream *cstream,
struct snd_compr_tstamp *tstamp) struct snd_compr_tstamp *tstamp)
{ {
struct snd_compr_runtime *runtime = cstream->runtime; struct snd_compr_runtime *runtime = cstream->runtime;
...@@ -532,7 +526,8 @@ static int sprd_platform_compr_pointer(struct snd_compr_stream *cstream, ...@@ -532,7 +526,8 @@ static int sprd_platform_compr_pointer(struct snd_compr_stream *cstream,
return 0; return 0;
} }
static int sprd_platform_compr_copy(struct snd_compr_stream *cstream, static int sprd_platform_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_compr_runtime *runtime = cstream->runtime; struct snd_compr_runtime *runtime = cstream->runtime;
...@@ -609,7 +604,8 @@ static int sprd_platform_compr_copy(struct snd_compr_stream *cstream, ...@@ -609,7 +604,8 @@ static int sprd_platform_compr_copy(struct snd_compr_stream *cstream,
return count; return count;
} }
static int sprd_platform_compr_get_caps(struct snd_compr_stream *cstream, static int sprd_platform_compr_get_caps(struct snd_soc_component *component,
struct snd_compr_stream *cstream,
struct snd_compr_caps *caps) struct snd_compr_caps *caps)
{ {
caps->direction = cstream->direction; caps->direction = cstream->direction;
...@@ -625,7 +621,8 @@ static int sprd_platform_compr_get_caps(struct snd_compr_stream *cstream, ...@@ -625,7 +621,8 @@ static int sprd_platform_compr_get_caps(struct snd_compr_stream *cstream,
} }
static int static int
sprd_platform_compr_get_codec_caps(struct snd_compr_stream *cstream, sprd_platform_compr_get_codec_caps(struct snd_soc_component *component,
struct snd_compr_stream *cstream,
struct snd_compr_codec_caps *codec) struct snd_compr_codec_caps *codec)
{ {
switch (codec->codec) { switch (codec->codec) {
...@@ -658,7 +655,7 @@ sprd_platform_compr_get_codec_caps(struct snd_compr_stream *cstream, ...@@ -658,7 +655,7 @@ sprd_platform_compr_get_codec_caps(struct snd_compr_stream *cstream,
return 0; return 0;
} }
const struct snd_compr_ops sprd_platform_compr_ops = { const struct snd_compress_ops sprd_platform_compress_ops = {
.open = sprd_platform_compr_open, .open = sprd_platform_compr_open,
.free = sprd_platform_compr_free, .free = sprd_platform_compr_free,
.set_params = sprd_platform_compr_set_params, .set_params = sprd_platform_compr_set_params,
......
...@@ -515,7 +515,7 @@ static const struct snd_soc_component_driver sprd_soc_component = { ...@@ -515,7 +515,7 @@ static const struct snd_soc_component_driver sprd_soc_component = {
.mmap = sprd_pcm_mmap, .mmap = sprd_pcm_mmap,
.pcm_construct = sprd_pcm_new, .pcm_construct = sprd_pcm_new,
.pcm_destruct = sprd_pcm_free, .pcm_destruct = sprd_pcm_free,
.compr_ops = &sprd_platform_compr_ops, .compress_ops = &sprd_platform_compress_ops,
}; };
static int sprd_soc_platform_probe(struct platform_device *pdev) static int sprd_soc_platform_probe(struct platform_device *pdev)
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#define DRV_NAME "sprd_pcm_dma" #define DRV_NAME "sprd_pcm_dma"
#define SPRD_PCM_CHANNEL_MAX 2 #define SPRD_PCM_CHANNEL_MAX 2
extern const struct snd_compr_ops sprd_platform_compr_ops; extern const struct snd_compress_ops sprd_platform_compress_ops;
struct sprd_pcm_dma_params { struct sprd_pcm_dma_params {
dma_addr_t dev_phys[SPRD_PCM_CHANNEL_MAX]; dma_addr_t dev_phys[SPRD_PCM_CHANNEL_MAX];
......
...@@ -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