Skip to contentSkip to conversation

ASoC: dapm: connect virtual mux with default value

PATCH In review Gyeongtaek Lee 1 participant 1 message Apr 14, 2020 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): CGME20200414015005epcas2p36cd86ae99991dae7022ebd6c052c9786@epcas2p3.samsung.com

#1 lore raw

PATCH 2/4 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.

---
 sound/soc/soc-dapm.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
sound/soc/soc-dapm.c +7 -1
index ebd785f9aa46..e0ff40b10d85 100644
@@ -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;
 	}
 }
 
Signature · 1 line
2.21.0