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: RE: [PATCH 1/3] ASoC: dapm: connect virtual mux with default value
Date: Tue, 31 Mar 2020 16:31:47 +0900 [thread overview]
Message-ID: <019a01d6072e$6f88ba90$4e9a2fb0$@samsung.com> (raw)
In-Reply-To: <4e119221-9350-aa43-8f7e-9af664383003@metafoo.de>
On 3/31/20 9:10 AM, Lars-Peter Clausen wrote:
>On 3/31/20 8:35 AM, 이경택 wrote:
>> On 3/31/20 7:55 AM, Lars-Peter Clausen wrote:
>>> On 3/31/20 7:42 AM, 이경택 wrote:
>>>> Since a virtual mixer has no backing registers to decide which path to
>>>> connect, it will try to match with initial value 0.
>>>> This is to ensure that the default mixer choice will be correctly
>>>> powered up during initialization.
>>>>
>>>> Signed-off-by: Gyeongtaek Lee <gt82.lee@samsung.com>
>>>> ---
>>>> sound/soc/soc-dapm.c | 11 ++++++++++-
>>>> 1 file changed, 10 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index
>>>> 9fb54e6fe254..fc55a0534252 100644
>>>> --- a/sound/soc/soc-dapm.c
>>>> +++ b/sound/soc/soc-dapm.c
>>>> @@ -802,7 +802,16 @@ 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 value 0. This is to ensure
>>>> + * that the default mixer choice will be
>>>> + * correctly powered up during initialization.
>>>> + */
>>>> + val = 0;
>>>> + if (invert)
>>>> + val = max - val;
>>>> + p->connect = !!val;
>>> Do you have virtual mixers that have the inverted flag set and if yes why? Cause otherwise this is exactly the same as before.
>> Yes, I have virtual mixers with inverted flag.
>> It is used to create a switch which is connected by default and can be disconnected when user application needs it.
>> Actually hardware can't be disconnected by virtual switch.
>> So, connected was better for default value for virtual mixers in my experience.
>
>It would be good to mention this in the commit message, that the purpose
>of the patch is to allow virtual mixers with a default state of on.
>
>I think you can also simplify the expression to just `p->connect = invert;`
>
Ok. I'll resend this patch with the purpose in commit message, and simplified code.
Thank you for your quick response!
next prev parent reply other threads:[~2020-03-31 7:33 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20200330073548epcas2p3045be9d3c8b76115c76ce27679840b6f@epcas2p3.samsung.com>
2020-03-30 7:35 ` [PATCH 1/3] ASoC: dapm: connect virtual mux with default value 이경택
2020-03-30 17:05 ` Mark Brown
2020-03-31 5:42 ` 이경택
2020-03-31 5:55 ` Lars-Peter Clausen
2020-03-31 6:35 ` 이경택
2020-03-31 7:10 ` Lars-Peter Clausen
2020-03-31 7:31 ` 이경택 [this message]
2020-03-31 6:50 ` 이경택
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='019a01d6072e$6f88ba90$4e9a2fb0$@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.