Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Gorski, Mateusz" <mateusz.gorski@linux.intel.com>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	alsa-devel@alsa-project.org
Cc: cezary.rojewski@intel.com, tiwai@suse.com
Subject: Re: [PATCH 4/4] ASoC: Intel: Skylake: Automatic DMIC format configuration according to information from NHLT
Date: Wed, 22 Apr 2020 14:04:00 +0200	[thread overview]
Message-ID: <6dcd229f-7477-01a5-9e73-8874a6234a5d@linux.intel.com> (raw)
In-Reply-To: <5530780f-9e86-1db3-b83b-9940560d27a2@linux.intel.com>


>> @@ -3123,12 +3141,15 @@ static int skl_tplg_control_load(struct 
>> snd_soc_component *cmpnt,
>>       case SND_SOC_TPLG_CTL_ENUM:
>>           tplg_ec = container_of(hdr,
>>                   struct snd_soc_tplg_enum_control, hdr);
>> -        if (kctl->access & SNDRV_CTL_ELEM_ACCESS_READWRITE) {
>> +        if (kctl->access & SNDRV_CTL_ELEM_ACCESS_READ) {
>>               se = (struct soc_enum *)kctl->private_value;
>>               if (tplg_ec->priv.size)
>> -                return skl_init_enum_data(bus->dev, se,
>> -                        tplg_ec);
>> +                skl_init_enum_data(bus->dev, se, tplg_ec);
>>           }
>> +
>> +        if (hdr->ops.get == SKL_CONTROL_TYPE_MULTI_IO_SELECT_DMIC)
>> +            kctl->access = SNDRV_CTL_ELEM_ACCESS_READ;
>> +
>
> Is it intentional that you first test the kctrl->access as READ only, 
> and then later set it to READ only for DMICs? The sequence looks 
> rather odd?


This basiccally checks if given control has READ access right, it will 
pass for both READ and READWRITE (since READWRITE = READ|WRITE).

And when the control has READWRITE access we change it to READ-only, to 
prevent interference from user.


      reply	other threads:[~2020-04-22 12:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-21 20:25 [PATCH 0/4] Add support for different DMIC configurations Mateusz Gorski
2020-04-21 20:25 ` [PATCH 1/4] ASoC: Intel: Skylake: Change the order of machine device and platform registration Mateusz Gorski
2020-04-21 20:49   ` Pierre-Louis Bossart
2020-04-22 12:03     ` Gorski, Mateusz
2020-04-21 20:25 ` [PATCH 2/4] ASoC: Intel: Skylake: Add alternative topology binary name Mateusz Gorski
2020-04-21 20:25 ` [PATCH 3/4] ASoC: Intel: Multiple I/O PCM format support for pipe Mateusz Gorski
2020-04-21 20:25 ` [PATCH 4/4] ASoC: Intel: Skylake: Automatic DMIC format configuration according to information from NHLT Mateusz Gorski
2020-04-21 20:55   ` Pierre-Louis Bossart
2020-04-22 12:04     ` Gorski, Mateusz [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=6dcd229f-7477-01a5-9e73-8874a6234a5d@linux.intel.com \
    --to=mateusz.gorski@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=cezary.rojewski@intel.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=tiwai@suse.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