On 03/16/2016 12:26 PM, Timur Karaldin wrote: > Hi Peter! > > 16.03.2016 11:57, Peter Ujfalusi пишет: >> 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. your mail client does not seem to wrap the lines correctly, can you check that. > Actually I try to avoid complex handler, with switch-case which depends on reg > number or kcontrol name inside of it. > I have found similar discussion with you about one year ago here > http://mailman.alsa-project.org/pipermail/alsa-devel/2015-February/087430.html. There > is a proposal to use TLV_DB_RANGE_HEAD() and TLV_DB_SCALE_ITEM() because of > invert with SOC_DAPM_SINGLE_TLV. As I recall there were some issues with that back then, but can not recall. At least I don't see followup patches regarding to that. > As I understand we could make tlv with using > 0 as mute, skip values 1-6, use values 7-15 (7 = -12dB and 15=0dB) then > declare SOC_DAPM_SINGLE_TLV as "Line1L Volume" for example. Is it still > actual? Worth a try ;) The naming needs to be different, take a look at twl4030 codec's twl4030_dapm_dbypass_tlv and how it is used. > Few things which I didn't understand: > - should I use "Line1L Switch" together with "Line1L Volume" in this case. I > think no, because DAPM_SINGLE_TLV should replace switch. Since we will have the gain and mute with volume control we will have only one control. > - i don't understand how declare tlv with skipping values 1-6 Yeah, I'm not sure how leaving 'hole' between the TLV_DB_SCALE_ITEMs will be handled if it works. > > Cheers, Tim -- Péter _______________________________________________ Alsa-devel mailing list Alsa-devel@xxxxxxxxxxxxxxxx http://mailman.alsa-project.org/mailman/listinfo/alsa-devel