16.03.2016 18:23, Peter Ujfalusi пишет:
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.
I have no idea how these lines should looks, so it's very hard for me to see what's wrong. Could you point me how it looks in original?
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.ht.... 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
Ok, now it's much more clear for me. Another question is register behaviour during soft reset. There is "aic3x_set_power" handle. In this handle kernel makes SOFT_RESET, markes cache as dirty, then power down the codec for handle power down request. But as I could see main volumes like "HP DAC" and "PCM" stores values between close and open in mixer and I could not see any code to handle it. On the other hand my controls do not save states, as you mentioned because of SOFT_RESET, could you explain such different behaviour?
Cheers, Tim