aboutsummaryrefslogtreecommitdiff
path: root/include/sound
diff options
context:
space:
mode:
authorTakashi Iwai2015-10-23 06:57:50 +0200
committerTakashi Iwai2015-10-23 06:57:50 +0200
commit274035751e25ee15a064e43cde7b4e7a9b75d921 (patch)
treebf5f3f18f14855043324ef02a116532d866e3dac /include/sound
parent53e597b1d194910bef53ed0632da329fef497904 (diff)
parenta5be88f63eaff1c03774aecd7388015cb87f6b2c (diff)
Merge branch 'topic/hw-constraint-single' into for-next
Diffstat (limited to 'include/sound')
-rw-r--r--include/sound/pcm.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index 3e0ffd21901f..4e6ad74fd8a2 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -1024,6 +1024,22 @@ int snd_pcm_hw_rule_add(struct snd_pcm_runtime *runtime,
snd_pcm_hw_rule_func_t func, void *private,
int dep, ...);
+/**
+ * snd_pcm_hw_constraint_single() - Constrain parameter to a single value
+ * @runtime: PCM runtime instance
+ * @var: The hw_params variable to constrain
+ * @val: The value to constrain to
+ *
+ * Return: Positive if the value is changed, zero if it's not changed, or a
+ * negative error code.
+ */
+static inline int snd_pcm_hw_constraint_single(
+ struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var,
+ unsigned int val)
+{
+ return snd_pcm_hw_constraint_minmax(runtime, var, val, val);
+}
+
int snd_pcm_format_signed(snd_pcm_format_t format);
int snd_pcm_format_unsigned(snd_pcm_format_t format);
int snd_pcm_format_linear(snd_pcm_format_t format);