From: 이경택 Date: Tue, 31 Mar 2020 07:55:16 +0000 (+0900) Subject: ASoC: dapm: connect virtual mux with default value X-Git-Tag: baikal/aarch64/sdk6.1~9567^2^2~11 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=55a8b38b0b7d1d06410b759c97f99ceaaa08a6f3;p=kernel.git ASoC: dapm: connect virtual mux with default value Since a virtual mixer has no backing registers to decide which path to connect, it will try to match with initial state. This is to ensure that the default mixer choice will be correctly powered up during initialization. Invert flag is used to select initial state of the virtual switch. Since actual hardware can't be disconnected by virtual switch, connected is better choice as initial state in many cases. Signed-off-by: Gyeongtaek Lee Link: https://lore.kernel.org/r/01a301d60731$b724ea10$256ebe30$@samsung.com Signed-off-by: Mark Brown --- diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 04da7928c873d..679ed60d850ec 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -802,7 +802,13 @@ static void dapm_set_mixer_path_status(struct snd_soc_dapm_path *p, int i, val = max - val; p->connect = !!val; } else { - p->connect = 0; + /* since a virtual mixer has no backing registers to + * decide which path to connect, it will try to match + * with initial state. This is to ensure + * that the default mixer choice will be + * correctly powered up during initialization. + */ + p->connect = invert; } }