aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2015-10-18 15:39:16 +0200
committerTakashi Iwai <tiwai@suse.de>2015-10-21 14:24:14 +0200
commitbc1043cdcd84cb441d80cfd79ae4325218f6f9ba (patch)
tree3f7415ac850fc01cbf07fd0c3ad53860201306d7 /sound/pci
parentLinux 4.3-rc6 (diff)
downloadlinux-dev-bc1043cdcd84cb441d80cfd79ae4325218f6f9ba.tar.xz
linux-dev-bc1043cdcd84cb441d80cfd79ae4325218f6f9ba.zip
ALSA: Add helper function to add single value constraint
The recommended and most efficient way to constraint a configuration parameter to a single value is to set the minimum and maximum allowed values to the same value, i.e. calling snd_pcm_hw_constraint_minmax() with the same value for min and max. It is not necessarily obvious though that this is the approach that should be taken and some drivers have come up with other ways of solving this problem, e.g. installing a list constraint with a single item. List constraints are dynamic constraints though and hence less efficient than the static min-max constraint. This patch introduces a new helper function called snd_pcm_hw_constraint_single() which only takes a single value has the same effect as calling snd_pcm_hw_constraint_minmax() with the same values for min and max. But it is hopefully semantically more expressive, making it clear that this is the preferred way of setting a single value constraint. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Mark Brown <broonie@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
0 files changed, 0 insertions, 0 deletions