Skip to content

Commit a11ecf8

Browse files
ranj063ujfalusi
authored andcommitted
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: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
1 parent 52fa20a commit a11ecf8

3 files changed

Lines changed: 34 additions & 50 deletions

File tree

sound/soc/sof/compress.c

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,8 @@
1313
#include "ops.h"
1414
#include "probe.h"
1515

16-
const struct snd_compress_ops sof_probe_compressed_ops = {
17-
.copy = sof_probe_compr_copy,
18-
};
19-
EXPORT_SYMBOL(sof_probe_compressed_ops);
20-
21-
int sof_probe_compr_open(struct snd_compr_stream *cstream,
22-
struct snd_soc_dai *dai)
16+
static int sof_probe_compr_open(struct snd_compr_stream *cstream,
17+
struct snd_soc_dai *dai)
2318
{
2419
struct snd_sof_dev *sdev =
2520
snd_soc_component_get_drvdata(dai->component);
@@ -34,10 +29,9 @@ int sof_probe_compr_open(struct snd_compr_stream *cstream,
3429
sdev->extractor_stream_tag = ret;
3530
return 0;
3631
}
37-
EXPORT_SYMBOL(sof_probe_compr_open);
3832

39-
int sof_probe_compr_free(struct snd_compr_stream *cstream,
40-
struct snd_soc_dai *dai)
33+
static int sof_probe_compr_free(struct snd_compr_stream *cstream,
34+
struct snd_soc_dai *dai)
4135
{
4236
struct snd_sof_dev *sdev =
4337
snd_soc_component_get_drvdata(dai->component);
@@ -66,10 +60,10 @@ int sof_probe_compr_free(struct snd_compr_stream *cstream,
6660

6761
return snd_sof_probe_compr_free(sdev, cstream, dai);
6862
}
69-
EXPORT_SYMBOL(sof_probe_compr_free);
7063

71-
int sof_probe_compr_set_params(struct snd_compr_stream *cstream,
72-
struct snd_compr_params *params, struct snd_soc_dai *dai)
64+
static int sof_probe_compr_set_params(struct snd_compr_stream *cstream,
65+
struct snd_compr_params *params,
66+
struct snd_soc_dai *dai)
7367
{
7468
struct snd_compr_runtime *rtd = cstream->runtime;
7569
struct snd_sof_dev *sdev =
@@ -95,31 +89,38 @@ int sof_probe_compr_set_params(struct snd_compr_stream *cstream,
9589

9690
return 0;
9791
}
98-
EXPORT_SYMBOL(sof_probe_compr_set_params);
9992

100-
int sof_probe_compr_trigger(struct snd_compr_stream *cstream, int cmd,
101-
struct snd_soc_dai *dai)
93+
static int sof_probe_compr_trigger(struct snd_compr_stream *cstream, int cmd,
94+
struct snd_soc_dai *dai)
10295
{
10396
struct snd_sof_dev *sdev =
10497
snd_soc_component_get_drvdata(dai->component);
10598

10699
return snd_sof_probe_compr_trigger(sdev, cstream, cmd, dai);
107100
}
108-
EXPORT_SYMBOL(sof_probe_compr_trigger);
109101

110-
int sof_probe_compr_pointer(struct snd_compr_stream *cstream,
111-
struct snd_compr_tstamp *tstamp, struct snd_soc_dai *dai)
102+
static int sof_probe_compr_pointer(struct snd_compr_stream *cstream,
103+
struct snd_compr_tstamp *tstamp,
104+
struct snd_soc_dai *dai)
112105
{
113106
struct snd_sof_dev *sdev =
114107
snd_soc_component_get_drvdata(dai->component);
115108

116109
return snd_sof_probe_compr_pointer(sdev, cstream, tstamp, dai);
117110
}
118-
EXPORT_SYMBOL(sof_probe_compr_pointer);
119111

120-
int sof_probe_compr_copy(struct snd_soc_component *component,
121-
struct snd_compr_stream *cstream,
122-
char __user *buf, size_t count)
112+
struct snd_soc_cdai_ops sof_probe_compr_ops = {
113+
.startup = sof_probe_compr_open,
114+
.shutdown = sof_probe_compr_free,
115+
.set_params = sof_probe_compr_set_params,
116+
.trigger = sof_probe_compr_trigger,
117+
.pointer = sof_probe_compr_pointer,
118+
};
119+
EXPORT_SYMBOL(sof_probe_compr_ops);
120+
121+
static int sof_probe_compr_copy(struct snd_soc_component *component,
122+
struct snd_compr_stream *cstream,
123+
char __user *buf, size_t count)
123124
{
124125
struct snd_compr_runtime *rtd = cstream->runtime;
125126
unsigned int offset, n;
@@ -144,4 +145,8 @@ int sof_probe_compr_copy(struct snd_soc_component *component,
144145
return count - ret;
145146
return count;
146147
}
147-
EXPORT_SYMBOL(sof_probe_compr_copy);
148+
149+
const struct snd_compress_ops sof_probe_compressed_ops = {
150+
.copy = sof_probe_compr_copy,
151+
};
152+
EXPORT_SYMBOL(sof_probe_compressed_ops);

sound/soc/sof/compress.h

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,7 @@
1313

1414
#include <sound/compress_driver.h>
1515

16+
extern struct snd_soc_cdai_ops sof_probe_compr_ops;
1617
extern const struct snd_compress_ops sof_probe_compressed_ops;
1718

18-
int sof_probe_compr_open(struct snd_compr_stream *cstream,
19-
struct snd_soc_dai *dai);
20-
int sof_probe_compr_free(struct snd_compr_stream *cstream,
21-
struct snd_soc_dai *dai);
22-
int sof_probe_compr_set_params(struct snd_compr_stream *cstream,
23-
struct snd_compr_params *params, struct snd_soc_dai *dai);
24-
int sof_probe_compr_trigger(struct snd_compr_stream *cstream, int cmd,
25-
struct snd_soc_dai *dai);
26-
int sof_probe_compr_pointer(struct snd_compr_stream *cstream,
27-
struct snd_compr_tstamp *tstamp, struct snd_soc_dai *dai);
28-
int sof_probe_compr_copy(struct snd_soc_component *component,
29-
struct snd_compr_stream *cstream,
30-
char __user *buf, size_t count);
31-
3219
#endif

sound/soc/sof/intel/hda-dai.c

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616

1717
#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA)
1818

19+
#if IS_ENABLED(CONFIG_SND_SOC_SOF_DEBUG_PROBES)
20+
#include "../compress.h"
21+
#endif
22+
1923
struct hda_pipe_params {
2024
u8 host_dma_id;
2125
u8 link_dma_id;
@@ -436,18 +440,6 @@ static const struct snd_soc_dai_ops hda_link_dai_ops = {
436440
.prepare = hda_link_pcm_prepare,
437441
};
438442

439-
#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA_PROBES)
440-
#include "../compress.h"
441-
442-
static struct snd_soc_cdai_ops sof_probe_compr_ops = {
443-
.startup = sof_probe_compr_open,
444-
.shutdown = sof_probe_compr_free,
445-
.set_params = sof_probe_compr_set_params,
446-
.trigger = sof_probe_compr_trigger,
447-
.pointer = sof_probe_compr_pointer,
448-
};
449-
450-
#endif
451443
#endif
452444

453445
static int ssp_dai_setup_or_free(struct snd_pcm_substream *substream, struct snd_soc_dai *dai,

0 commit comments

Comments
 (0)