ASoC: dapm: Consolidate MUXs and virtual MUXs
authorLars-Peter Clausen <lars@metafoo.de>
Fri, 28 Feb 2014 07:31:11 +0000 (08:31 +0100)
committerMark Brown <broonie@linaro.org>
Sat, 1 Mar 2014 03:03:36 +0000 (12:03 +0900)
commit236aaa6863581634bd6d599ccf7f7b38deeafdc0
treefd65cfab7542f5b2462891d335a41caa6caa2d63
parentf6b45c28f451e8e415db49f693b2fec90c2cb557
ASoC: dapm: Consolidate MUXs and virtual MUXs

MUXs and virtual MUXs are almost identical, the only difference is that for
virtual MUX there is no hardware backing register in which setting is stored.
This patch adds code, which is similar to what we already do for DAPM mixer
controls to support virtual mixer controls, to DAPM enum controls. The new code
will check if the enum does a hardware backing register and skip over reading
and writing to the register if it has not.  This allows us to use the same code
path for both MUXs and virtual MUXs and a lot of nearly identical 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