[RFC PATCH 2/6] ALSA: pcm: Export constraints initialization functions

Codrin Ciubotariu
2021-05-19T10:49:50Z

Export the functions needed to initialize the constraints. These functions
will be used in soc-pcm to initialize the BE constraints.

Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
---
include/sound/pcm.h | 3 +++
sound/core/pcm_native.c | 6 ++++--
2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index 025b4d2ba0fe..2907ed2b937f 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -1021,6 +1021,9 @@ int snd_pcm_hw_rule_add(struct snd_pcm_runtime *runtime,
snd_pcm_hw_rule_func_t func, void *private,
int dep, ...);

+int snd_pcm_hw_constraints_init(struct snd_pcm_substream *substream);
+int snd_pcm_hw_constraints_complete(struct snd_pcm_substream *substream);
+
/**
* snd_pcm_hw_constraint_single() - Constrain parameter to a single value
* @runtime: PCM runtime instance
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index 8dbe86cf2e4f..54e0eab2a57e 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -2400,7 +2400,7 @@ static int snd_pcm_hw_rule_buffer_bytes_max(struct snd_pcm_hw_params *params,
return snd_interval_refine(hw_param_interval(params, rule->var), &t);
}

-static int snd_pcm_hw_constraints_init(struct snd_pcm_substream *substream)
+int snd_pcm_hw_constraints_init(struct snd_pcm_substream *substream)
{
struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_pcm_hw_constraints *constrs = &runtime->hw_constraints;
@@ -2523,8 +2523,9 @@ static int snd_pcm_hw_constraints_init(struct snd_pcm_substream *substream)
return err;
return 0;
}
+EXPORT_SYMBOL(snd_pcm_hw_constraints_init);

-static int snd_pcm_hw_constraints_complete(struct snd_pcm_substream *substream)
+int snd_pcm_hw_constraints_complete(struct snd_pcm_substream *substream)
{
struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_pcm_hardware *hw = &runtime->hw;
@@ -2607,6 +2608,7 @@ static int snd_pcm_hw_constraints_complete(struct snd_pcm_substream *substream)

return 0;
}
+EXPORT_SYMBOL(snd_pcm_hw_constraints_complete);

static void pcm_release_private(struct snd_pcm_substream *substream)
{
--
2.27.0