ASoC: dapm: Consolidate MUXs and value MUXs
authorLars-Peter Clausen <lars@metafoo.de>
Fri, 28 Feb 2014 07:31:04 +0000 (08:31 +0100)
committerMark Brown <broonie@linaro.org>
Sat, 1 Mar 2014 03:03:34 +0000 (12:03 +0900)
commit3727b4968453dbab8fe18f979d67285eb6b66801
tree65ea329261a29bd380b29fd24167a80375779a05
parent29ae2fa5533e607a7d97b7564dc015252f1e73f4
ASoC: dapm: Consolidate MUXs and value MUXs

MUXs and value MUXs are almost identical, the only difference is that a value
MUX uses a look-up table to map from the selected control item to a register
value, while MUXs use a direct mapping. This patch uses
snd_soc_enum_item_to_val() and snd_soc_enum_val_to_item(), which where earlier
introduced during the consolidation of enum and value enum controls, to hide
this difference. This allows us to use the same code path for both MUXs and
value MUXs and a lot of nearly duplicated code can be removed.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
include/sound/soc-dapm.h
sound/soc/soc-dapm.c