Skip to content

Commit

Permalink
ASoC: dapm: allow muxes to force a disconnect
Browse files Browse the repository at this point in the history
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: Jerome Brunet <jbrunet@baylibre.com>
Tested-by: Neil Armstrong <narmstrong@baylibre.com>
Tested-by: Kevin Hilman <khilman@baylibre.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Jerome Brunet authored and Mark Brown committed May 16, 2019
1 parent 1b74211 commit c3456a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/soc/soc-dapm.c
Original file line number Diff line number Diff line change
Expand Up @@ -2245,7 +2245,7 @@ static int soc_dapm_mux_update_power(struct snd_soc_card *card,
dapm_kcontrol_for_each_path(path, kcontrol) {
found = 1;
/* 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;
else
connect = false;
Expand Down

0 comments on commit c3456a4

Please sign in to comment.