All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jaroslav Kysela <perex@perex.cz>
To: "Shuming [范書銘]" <shumingf@realtek.com>,
	"Yang, Libin" <libin.yang@intel.com>,
	"Pierre-Louis Bossart" <pierre-louis.bossart@linux.intel.com>,
	"broonie@kernel.org" <broonie@kernel.org>,
	"lgirdwood@gmail.com" <lgirdwood@gmail.com>
Cc: "Oder Chiou" <oder_chiou@realtek.com>,
	"Jack Yu" <jack.yu@realtek.com>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	"lars@metafoo.de" <lars@metafoo.de>,
	"Derek [方德義]" <derek.fang@realtek.com>,
	"Flove(HsinFu)" <flove@realtek.com>
Subject: Re: [PATCH] ASoC: rt711-sdca: remove capture switch controls
Date: Tue, 20 Apr 2021 08:20:47 +0200	[thread overview]
Message-ID: <a389066d-fe65-03ad-2ea8-1878e2e4badd@perex.cz> (raw)
In-Reply-To: <ba277a0457da4ab09f5120f30a9dc699@realtek.com>

Dne 20. 04. 21 v 3:10 Shuming [范書銘] napsal(a):
>>> I see. In this case, the auto-route settings should differ from the
>>> mixer settings. So the mute flag should be logical _OR_ from both DAPM
>>> and the mixer settings. And because the codec is able to do the hw
>>> mute, why to prevent the export of this feature?
>>>
>>> So I propose do do (pseudo code):
>>>
>>> struct rt711_sdca_priv {
>>> 	bool fu0f_dapm_mute;
>>> 	bool fu0f_mixer_mute;
>>> };
>>>
>>> /* called from both dapm event and kontrol put callback (on change) */
>>> /* the dapm event and put callback will modify only rt711_sdca_priv
>>> fields */ static void set_f0f_mute(rt711_priv) {
>>> 	int mute = rt711_priv->fu0f_dapm_mute || rt711_priv-
>>>> fu0f_mixer_mute;
>>> 	set_fu0f_mute_register(mute);
>>> }
>>>
>>> With this implementation, all is consistent to the user space.
>>
>> If so:
>> When capture, if user setting is mute, it will always mute and if user setting is
>> unmute, it will always unmute.
>>
>> When stop capture, it will always mute regardless the user setting.
>>
>> Shuming, what do you think?
> 
> I think the function could mute/unmute both. It could avoid that the setting always mutes if the user setting is unmute.
> e.g.
> static void set_fu0f_capture_ctl(rt711_priv) {
>     int mute = rt711_priv->fu0f_dapm_mute || rt711_priv->fu0f_mixer_mute;
>     if (mute)
>         set_fu0f_mute_register();
>     else
>         set_fu0f_unmute_register();
> }

Yes, I passed the mute value in the pseudo code to the
set_fu0f_mute_register() function as argument for the further evaluation, but
I meant exactly this.

					Thank you,
						Jaroslav

-- 
Jaroslav Kysela <perex@perex.cz>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.

      reply	other threads:[~2021-04-20  6:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-15  9:16 [PATCH] ASoC: rt711-sdca: remove capture switch controls shumingf
2021-04-15 11:25 ` Pierre-Louis Bossart
2021-04-19  5:14   ` Yang, Libin
2021-04-19  6:32     ` Jaroslav Kysela
2021-04-19  6:50       ` Yang, Libin
2021-04-19  6:56         ` Jaroslav Kysela
2021-04-19  7:17           ` Yang, Libin
2021-04-19  8:52             ` Jaroslav Kysela
2021-04-20  0:17               ` Yang, Libin
2021-04-20  1:10                 ` Shuming [范書銘]
2021-04-20  6:20                   ` Jaroslav Kysela [this message]

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=a389066d-fe65-03ad-2ea8-1878e2e4badd@perex.cz \
    --to=perex@perex.cz \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=derek.fang@realtek.com \
    --cc=flove@realtek.com \
    --cc=jack.yu@realtek.com \
    --cc=lars@metafoo.de \
    --cc=lgirdwood@gmail.com \
    --cc=libin.yang@intel.com \
    --cc=oder_chiou@realtek.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=shumingf@realtek.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.