From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Timur Karaldin <karaldin@mcsplus.ru>, alsa-devel@alsa-project.org
Subject: Re: ASoC: TLV320AIC3x: Adding additional functionality for 3106 with [Patch] for discuss
Date: Wed, 16 Mar 2016 10:57:18 +0200 [thread overview]
Message-ID: <56E91FEE.4070604@ti.com> (raw)
In-Reply-To: <56E834B0.5010808@mcsplus.ru>
Hi Timur,
please avoid top posting.
On 03/15/16 18:13, Timur Karaldin wrote:
> Ok, I choose the way #1 without changing kcontrol names.
> Another thing I don't understand is the way for caching gain volume if I have
> switches muted. Is there any proper way for storing cached values between gain
> and switch handlers includes soft reset or I need manually check kcontrol name
> in handler and cache values in extended private structure? The same question
> for switch handler, because I need to share cached values between these handlers.
Since the problematic registers are: 17, 18, .. 24. I would have an array
inside struct aic3x_priv to store the configured gain. You could store the
mute as well, but since regmap is caching the content I would simply read back
the gain value and if it is 0xf, it is muted, so update only the local shadow,
if it is not muted, write the gain.
In the mute/unmute controls I would then save the gain to shadow when muting
the path and write the cached gain to the register when unmuting it. You
should also return correct 0/1 for the unmute state and not the actual
register value.
>
> 15.03.2016 15:40, Peter Ujfalusi пишет:
>> On 03/15/16 14:12, Timur Karaldin wrote:
>>> Hi Peter!
>>>
>>> 14.03.2016 17:47, Peter Ujfalusi пишет:
>>>> So the issue is that we have the DAPM switches controlling exactly the same
>>>> registers. I believe if you would set the gain in a way that bit0 is 1, then
>>>> DAPM will think that the path is disconnected. Also if you would set the
>>>> gain and then mute and unmute the path you would have lost the gain you
>>>> wanted to have.. The only way I can think of implementing these mixers is to
>>>> have two sets of custom callbacks. one set is to set/get the gain and the
>>>> other is to set/get the mute/disconnect on these. When the path is
>>>> disconnected you should not write the gain change to the chip, but cache it
>>>> and if the path is unmuted, you write the cached gain. When you mute the
>>>> path you should take the set gain first, cache it, then disconnect the path.
>>>> For these gains you should have DECLARE_TLV_DB_SCALE() and use
>>>> SOC_SINGLE_TLV(). Make sure that the control name matches with the
>>>> corresponding DAPM widget's name so ALSA can match them correctly.
>>> That's not clear for me. As I understand, I need to create SOC_SINGLE_TLV()
>>> for each gain I would like to change, with the same name as
>>> SOC_DAPM_SINGLE_AIC3x (for example "Line1L Switch" for Line1) and make
>>> callbacks with cached gain values. Am I right?
>> Mostly yes, but you need to name the controls:
>> existing switch + new gain control
>> "Line1L Switch" + "Line1L Volume"
>> "Line1R Switch" + "Line1R Volume"
>>
>> In this way alsamixer can combine them.
>>
>>> May be the better sollution is to change SOC_DAPM_SINGLE_AIC3x on/off switch
>>> to other type with switch and gain control together? So it could have some
>>> connected states with different gains and disconnected state (Something like
>>> volume/mute control).
>> Something based on SOC_DAPM_SINGLE_TLV should work. But that means again
>> change in Kcontrol names.
>>
>
>
--
Péter
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
next prev parent reply other threads:[~2016-03-16 8:57 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-14 11:06 ASoC: TLV320AIC3x: Adding additional functionality for 3106 with [Patch] for discuss Timur Karaldin
2016-03-14 14:47 ` Peter Ujfalusi
[not found] ` <56E6D177.5050108@mcsplus.ru>
2016-03-14 16:38 ` Peter Ujfalusi
2016-03-15 10:17 ` Timur Karaldin
2016-03-15 11:47 ` Peter Ujfalusi
2016-03-15 12:12 ` Timur Karaldin
2016-03-15 12:40 ` Peter Ujfalusi
2016-03-15 16:13 ` Timur Karaldin
2016-03-16 8:57 ` Peter Ujfalusi [this message]
2016-03-16 10:26 ` Timur Karaldin
2016-03-16 15:23 ` Peter Ujfalusi
2016-03-16 16:53 ` Timur Karaldin
2016-03-17 9:26 ` Peter Ujfalusi
2016-03-18 15:45 ` Timur Karaldin
2016-03-23 15:21 ` Timur Karaldin
2016-03-31 12:58 ` Peter Ujfalusi
2016-04-18 16:28 ` [PATCH V2 1/2] ASoC: TLV320AIC3x: Adding additional functionality for 3106 Timur Karaldin
2016-04-18 16:28 ` [PATCH V2 2/2] " Timur Karaldin
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=56E91FEE.4070604@ti.com \
--to=peter.ujfalusi@ti.com \
--cc=alsa-devel@alsa-project.org \
--cc=karaldin@mcsplus.ru \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).