Commit c3456a4b authored by Jerome Brunet's avatar Jerome Brunet Committed by Mark Brown

ASoC: dapm: allow muxes to force a disconnect

Let soc_dapm_mux_update_power() accept NULL as 'e' enum.

It makes the code a bit more robust and, more importantly, let the calling
mux force a disconnect of the output path if necessary.

This is useful if the dapm elements following the mux must be off
while updating the mux, to avoid glitches or force a (re)configuration.
Signed-off-by: default avatarJerome Brunet <jbrunet@baylibre.com>
Tested-by: default avatarNeil Armstrong <narmstrong@baylibre.com>
Tested-by: default avatarKevin Hilman <khilman@baylibre.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 1b742110
...@@ -2245,7 +2245,7 @@ static int soc_dapm_mux_update_power(struct snd_soc_card *card, ...@@ -2245,7 +2245,7 @@ static int soc_dapm_mux_update_power(struct snd_soc_card *card,
dapm_kcontrol_for_each_path(path, kcontrol) { dapm_kcontrol_for_each_path(path, kcontrol) {
found = 1; found = 1;
/* we now need to match the string in the enum to the path */ /* we now need to match the string in the enum to the path */
if (!(strcmp(path->name, e->texts[mux]))) if (e && !(strcmp(path->name, e->texts[mux])))
connect = true; connect = true;
else else
connect = false; connect = false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment