Commit 2dc51106 authored by Ranjani Sridharan's avatar Ranjani Sridharan Committed by Mark Brown

ASoC: SOF: compress: move and export sof_probe_compr_ops

sof_probe_compr_ops are not platform-specific. So move
it to common compress code and export the symbol. The
compilation of the common compress code is already dependent
on the selection of CONFIG_SND_SOC_SOF_DEBUG_PROBES, so no
need to check the Kconfig section for defining sof_probe_compr_ops
again.
Signed-off-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: default avatarKai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20210916103211.1573-4-peter.ujfalusi@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 8a720724
...@@ -13,12 +13,7 @@ ...@@ -13,12 +13,7 @@
#include "ops.h" #include "ops.h"
#include "probe.h" #include "probe.h"
const struct snd_compress_ops sof_probe_compressed_ops = { static int sof_probe_compr_open(struct snd_compr_stream *cstream,
.copy = sof_probe_compr_copy,
};
EXPORT_SYMBOL(sof_probe_compressed_ops);
int sof_probe_compr_open(struct snd_compr_stream *cstream,
struct snd_soc_dai *dai) struct snd_soc_dai *dai)
{ {
struct snd_sof_dev *sdev = struct snd_sof_dev *sdev =
...@@ -34,9 +29,8 @@ int sof_probe_compr_open(struct snd_compr_stream *cstream, ...@@ -34,9 +29,8 @@ int sof_probe_compr_open(struct snd_compr_stream *cstream,
sdev->extractor_stream_tag = ret; sdev->extractor_stream_tag = ret;
return 0; return 0;
} }
EXPORT_SYMBOL(sof_probe_compr_open);
int sof_probe_compr_free(struct snd_compr_stream *cstream, static int sof_probe_compr_free(struct snd_compr_stream *cstream,
struct snd_soc_dai *dai) struct snd_soc_dai *dai)
{ {
struct snd_sof_dev *sdev = struct snd_sof_dev *sdev =
...@@ -66,10 +60,10 @@ int sof_probe_compr_free(struct snd_compr_stream *cstream, ...@@ -66,10 +60,10 @@ int sof_probe_compr_free(struct snd_compr_stream *cstream,
return snd_sof_probe_compr_free(sdev, cstream, dai); return snd_sof_probe_compr_free(sdev, cstream, dai);
} }
EXPORT_SYMBOL(sof_probe_compr_free);
int sof_probe_compr_set_params(struct snd_compr_stream *cstream, static int sof_probe_compr_set_params(struct snd_compr_stream *cstream,
struct snd_compr_params *params, struct snd_soc_dai *dai) struct snd_compr_params *params,
struct snd_soc_dai *dai)
{ {
struct snd_compr_runtime *rtd = cstream->runtime; struct snd_compr_runtime *rtd = cstream->runtime;
struct snd_sof_dev *sdev = struct snd_sof_dev *sdev =
...@@ -95,9 +89,8 @@ int sof_probe_compr_set_params(struct snd_compr_stream *cstream, ...@@ -95,9 +89,8 @@ int sof_probe_compr_set_params(struct snd_compr_stream *cstream,
return 0; return 0;
} }
EXPORT_SYMBOL(sof_probe_compr_set_params);
int sof_probe_compr_trigger(struct snd_compr_stream *cstream, int cmd, static int sof_probe_compr_trigger(struct snd_compr_stream *cstream, int cmd,
struct snd_soc_dai *dai) struct snd_soc_dai *dai)
{ {
struct snd_sof_dev *sdev = struct snd_sof_dev *sdev =
...@@ -105,19 +98,27 @@ int sof_probe_compr_trigger(struct snd_compr_stream *cstream, int cmd, ...@@ -105,19 +98,27 @@ int sof_probe_compr_trigger(struct snd_compr_stream *cstream, int cmd,
return snd_sof_probe_compr_trigger(sdev, cstream, cmd, dai); return snd_sof_probe_compr_trigger(sdev, cstream, cmd, dai);
} }
EXPORT_SYMBOL(sof_probe_compr_trigger);
int sof_probe_compr_pointer(struct snd_compr_stream *cstream, static 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)
{ {
struct snd_sof_dev *sdev = struct snd_sof_dev *sdev =
snd_soc_component_get_drvdata(dai->component); snd_soc_component_get_drvdata(dai->component);
return snd_sof_probe_compr_pointer(sdev, cstream, tstamp, dai); return snd_sof_probe_compr_pointer(sdev, cstream, tstamp, dai);
} }
EXPORT_SYMBOL(sof_probe_compr_pointer);
int sof_probe_compr_copy(struct snd_soc_component *component, struct snd_soc_cdai_ops sof_probe_compr_ops = {
.startup = sof_probe_compr_open,
.shutdown = sof_probe_compr_free,
.set_params = sof_probe_compr_set_params,
.trigger = sof_probe_compr_trigger,
.pointer = sof_probe_compr_pointer,
};
EXPORT_SYMBOL(sof_probe_compr_ops);
static int sof_probe_compr_copy(struct snd_soc_component *component,
struct snd_compr_stream *cstream, struct snd_compr_stream *cstream,
char __user *buf, size_t count) char __user *buf, size_t count)
{ {
...@@ -144,4 +145,8 @@ int sof_probe_compr_copy(struct snd_soc_component *component, ...@@ -144,4 +145,8 @@ int sof_probe_compr_copy(struct snd_soc_component *component,
return count - ret; return count - ret;
return count; return count;
} }
EXPORT_SYMBOL(sof_probe_compr_copy);
const struct snd_compress_ops sof_probe_compressed_ops = {
.copy = sof_probe_compr_copy,
};
EXPORT_SYMBOL(sof_probe_compressed_ops);
...@@ -13,20 +13,7 @@ ...@@ -13,20 +13,7 @@
#include <sound/compress_driver.h> #include <sound/compress_driver.h>
extern struct snd_soc_cdai_ops sof_probe_compr_ops;
extern const struct snd_compress_ops sof_probe_compressed_ops; extern const struct snd_compress_ops sof_probe_compressed_ops;
int sof_probe_compr_open(struct snd_compr_stream *cstream,
struct snd_soc_dai *dai);
int sof_probe_compr_free(struct snd_compr_stream *cstream,
struct snd_soc_dai *dai);
int sof_probe_compr_set_params(struct snd_compr_stream *cstream,
struct snd_compr_params *params, struct snd_soc_dai *dai);
int sof_probe_compr_trigger(struct snd_compr_stream *cstream, int cmd,
struct snd_soc_dai *dai);
int sof_probe_compr_pointer(struct snd_compr_stream *cstream,
struct snd_compr_tstamp *tstamp, struct snd_soc_dai *dai);
int sof_probe_compr_copy(struct snd_soc_component *component,
struct snd_compr_stream *cstream,
char __user *buf, size_t count);
#endif #endif
...@@ -16,6 +16,10 @@ ...@@ -16,6 +16,10 @@
#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA) #if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA)
#if IS_ENABLED(CONFIG_SND_SOC_SOF_DEBUG_PROBES)
#include "../compress.h"
#endif
struct hda_pipe_params { struct hda_pipe_params {
u8 host_dma_id; u8 host_dma_id;
u8 link_dma_id; u8 link_dma_id;
...@@ -400,18 +404,6 @@ static const struct snd_soc_dai_ops hda_link_dai_ops = { ...@@ -400,18 +404,6 @@ static const struct snd_soc_dai_ops hda_link_dai_ops = {
.prepare = hda_link_pcm_prepare, .prepare = hda_link_pcm_prepare,
}; };
#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA_PROBES)
#include "../compress.h"
static struct snd_soc_cdai_ops sof_probe_compr_ops = {
.startup = sof_probe_compr_open,
.shutdown = sof_probe_compr_free,
.set_params = sof_probe_compr_set_params,
.trigger = sof_probe_compr_trigger,
.pointer = sof_probe_compr_pointer,
};
#endif
#endif #endif
static int ssp_dai_hw_params(struct snd_pcm_substream *substream, static int ssp_dai_hw_params(struct snd_pcm_substream *substream,
......
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