OSDN Git Service

ASoC: dapm: Add demux support
authorLars-Peter Clausen <lars@metafoo.de>
Fri, 1 May 2015 16:02:43 +0000 (18:02 +0200)
committerMark Brown <broonie@kernel.org>
Wed, 6 May 2015 16:31:02 +0000 (17:31 +0100)
commitd714f97c5b8c4c5da56b89a7289acb3f12ef7abb
tree814ea8f11899bff80e966bb64dfc394742d61de1
parent92fa12426741d52b39ec92ad77c9843d3fc2b3d6
ASoC: dapm: Add demux support

A demux is conceptually similar to a mux. Where a mux has multiple input
and one output and selects one of the inputs to be connected to the output,
the demux has one input and multiple outputs and selects one of the outputs
to which the input gets connected.

This similarity makes it straight forward to support them in DAPM using the
existing mux support, we only need to swap sinks and sources when initially
setting up the paths.

The only slightly tricky part is that there can only be one control per
path. Since mixers/muxes are at the sink of a path and a demux is at the
source and both types want a control it is not possible to directly connect
a demux output to a mixer/mux input. The patch adds some sanity checks to
make sure that this does not happen.

Drivers who want to model hardware which directly connects a demux output
to a mixer/mux input can do this by inserting a dummy widget between the
two. E.g.:

{ "Dummy", "Demux Control", "Demux" },
{ "Mixer", "Mixer Control", "Dummy" },

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