All of lore.kernel.org
 help / color / mirror / Atom feed
From: 이경택 <gt82.lee@samsung.com>
To: "'Lars-Peter Clausen'" <lars@metafoo.de>, <broonie@kernel.org>
Cc: alsa-devel@alsa-project.org, lgirdwood@gmail.com, tiwai@suse.com,
	hmseo@samsung.com, tkjung@samsung.com, pilsun.jang@samsung.com
Subject: [PATCH v2 1/3] ASoC: dapm: connect virtual mux with default value
Date: Tue, 31 Mar 2020 16:55:16 +0900	[thread overview]
Message-ID: <01a301d60731$b724ea10$256ebe30$@samsung.com> (raw)
In-Reply-To: CGME20200331075516epcas2p354433b07d679bb24f86b67369ea77259@epcas2p3.samsung.com

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 <gt82.lee@samsung.com>
---
 sound/soc/soc-dapm.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 9fb54e6fe254..17962564866d 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;
 	}
 }
 
-- 
2.21.0



       reply	other threads:[~2020-03-31  7:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20200331075516epcas2p354433b07d679bb24f86b67369ea77259@epcas2p3.samsung.com>
2020-03-31  7:55 ` 이경택 [this message]
2020-03-31 18:24   ` Applied "ASoC: dapm: connect virtual mux with default value" to the asoc tree Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='01a301d60731$b724ea10$256ebe30$@samsung.com' \
    --to=gt82.lee@samsung.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=hmseo@samsung.com \
    --cc=lars@metafoo.de \
    --cc=lgirdwood@gmail.com \
    --cc=pilsun.jang@samsung.com \
    --cc=tiwai@suse.com \
    --cc=tkjung@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.