]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
ASoC: dapm: Keep a list of paths per kcontrol
authorLars-Peter Clausen <lars@metafoo.de>
Mon, 29 Jul 2013 15:14:00 +0000 (17:14 +0200)
committerMark Brown <broonie@linaro.org>
Mon, 29 Jul 2013 17:41:00 +0000 (18:41 +0100)
commit5106b92f80a2cd37c52cffed80b4f5acfb77ccfd
tree609669cf0003ada313400b64be82feaa37b317ec
parentcf7c1de20c576477d42deae255cbc6e439bb5dc0
ASoC: dapm: Keep a list of paths per kcontrol

Currently we store for each path which control (if any at all) is associated
with that control. But we are only ever interested in the reverse relationship,
i.e. we want to know all the paths a certain control is associated with. This is
currently implemented by always iterating over all paths. This patch updates the
code to keep a list for each control which contains all the paths that are
associated with that control. This improves the run time of e.g.
soc_dapm_mixer_update_power() and soc_dapm_mux_update_power() from O(n) (with n
being the number of paths for the card) to O(1).

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