Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
To: Lars-Peter Clausen <lars@metafoo.de>
Cc: alsa-devel@alsa-project.org, broonie@kernel.org,
	lgirdwood@gmail.com, patches@opensource.wolfsonmicro.com
Subject: Re: [PATCH v2 4/5] ASoC: dapm: Add support for autodisable mux	controls
Date: Fri, 1 May 2015 11:24:51 +0100	[thread overview]
Message-ID: <20150501102451.GS3480@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <55426AD9.7080302@metafoo.de>

On Thu, Apr 30, 2015 at 07:48:09PM +0200, Lars-Peter Clausen wrote:
> On 04/30/2015 06:38 PM, Charles Keepax wrote:
> [...]
>> @@ -354,6 +355,34 @@ static int dapm_kcontrol_data_alloc(struct snd_soc_dapm_widget *widget,
>>   			}
>>   		}
>>   		break;
>> +	case snd_soc_dapm_mux:
>> +		e = (struct soc_enum *)kcontrol->private_value;
>> +
>> +		if (e->autodisable) {
>> +			struct snd_soc_dapm_widget template;
>> +
>> +			memset(&template, 0, sizeof(template));
>> +			template.reg = e->reg;
>> +			template.mask = e->mask << e->shift_l;
>> +			template.shift = e->shift_l;
>> +			template.off_val = e->values[0];
>
> I think we should handle the case where e->values is NULL. In which case  
> off_val should just be 0.

Ooops yeah sorry got a bit over keen there.

>
>> +			template.on_val = template.off_val;
>> +			template.id = snd_soc_dapm_kcontrol;
>> +			template.name = name;
>> +
> [...]
>
>> @@ -3002,10 +3034,10 @@ int snd_soc_dapm_put_enum_double(struct snd_kcontrol *kcontrol,
>>
>>   	mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
>>
>> +	change = dapm_kcontrol_set_value(kcontrol, val);
>> +
>>   	if (e->reg != SND_SOC_NOPM)
>>   		change = soc_dapm_test_bits(dapm, e->reg, mask, val);
>> -	else
>> -		change = dapm_kcontrol_set_value(kcontrol, val);
>>
>
> This probably needs the same logic as in snd_soc_dapm_put_volsw() to  
> correctly handle the case where the hardware state and the software state 
> might be out of sync.

Yeah makes sense.

>
>>   	if (change) {
>>   		if (e->reg != SND_SOC_NOPM) {
>>
> /

I will send out a new spin shortly.

Thanks,
Charles

  reply	other threads:[~2015-05-01 10:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-30 16:38 [PATCH v2 1/5] ASoC: Correct typo in SOC_VALUE_ENUM_SINGLE macro Charles Keepax
2015-04-30 16:38 ` [PATCH v2 2/5] ASoC: dapm: Remove local OOM error message Charles Keepax
2015-04-30 16:38 ` [PATCH v2 3/5] ASoC: dapm: Append "Autodisable" to autodisable widget names Charles Keepax
2015-04-30 17:40   ` Lars-Peter Clausen
2015-04-30 16:38 ` [PATCH v2 4/5] ASoC: dapm: Add support for autodisable mux controls Charles Keepax
2015-04-30 17:48   ` Lars-Peter Clausen
2015-05-01 10:24     ` Charles Keepax [this message]
2015-04-30 16:38 ` [PATCH v2 5/5] ASoC: arizona: Use auto disable muxes for routing Charles Keepax

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=20150501102451.GS3480@opensource.wolfsonmicro.com \
    --to=ckeepax@opensource.wolfsonmicro.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lars@metafoo.de \
    --cc=lgirdwood@gmail.com \
    --cc=patches@opensource.wolfsonmicro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox