Skip to contentSkip to conversation

ASoC: dapm: don't skip evaluate the power of widget with force set

PATCH In review Xiang Xiao 2 participants 2 messages Apr 13, 2014 – Apr 14, 2014

Subsystems (2)
lore
Share & tools
lore

Xiang Xiao

author
#0 lore raw

PATCH 1/1 ASoC: dapm: don't skip evaluate the power of widget with force set

---
 sound/soc/soc-dapm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/soc-dapm.c +2 -2
index c8a780d..14af77e 100644
@@ -1673,7 +1673,7 @@ static void dapm_widget_set_peer_power(struct snd_soc_dapm_widget *peer,
 
 	/* If the peer is already in the state we're moving to then we
 	 * won't have an impact on it. */
-	if (power != peer->power)
+	if (peer->force || power != peer->power)
 		dapm_mark_dirty(peer, "peer state change");
 }
 
@@ -1683,7 +1683,7 @@ static void dapm_widget_set_power(struct snd_soc_dapm_widget *w, bool power,
 {
 	struct snd_soc_dapm_path *path;
 
-	if (w->power == power)
+	if (!w->force && w->power == power)
 		return;
 
 	trace_snd_soc_dapm_widget_power(w, power);
Signature · 1 line
1.8.1.2
maintainer
#1 lore raw
Quoted 1 line · Xiang Xiao

You should explain why you want to do this in the changelog - what's the problem that's being fixed or benefit?

sound/soc/soc-dapm.c static void dapm_widget_set_peer_power(struct snd_soc_dapm_widget *peer, · line 1677

Quoted 3 lines
sound/soc/soc-dapm.c +1 -1
-	if (power != peer->power)
+	if (peer->force || power != peer->power)
 		dapm_mark_dirty(peer, "peer state change");

This doesn't correspond to your changelog - it *will* skip evaluating the widget power if the widget is forced. It's not clear why this would be a benefit.

sound/soc/soc-dapm.c static void dapm_widget_set_power(struct snd_soc_dapm_widget *w, bool power, · line 1687

Quoted 3 lines
sound/soc/soc-dapm.c +1 -1
-	if (w->power == power)
+	if (!w->force && w->power == power)
 		return;

Similarly here.