alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Mateusz Gorski <mateusz.gorski@linux.intel.com>,
	alsa-devel@alsa-project.org
Cc: cezary.rojewski@intel.com, broonie@kernel.org, tiwai@suse.com,
	Pavan K <pavan.k.s@intel.com>
Subject: Re: [PATCH v3 2/3] ASoC: Intel: Multiple I/O PCM format support for pipe
Date: Thu, 23 Apr 2020 10:49:54 -0500	[thread overview]
Message-ID: <e13f51b7-da52-ad7a-d000-1c0099cbf21d@linux.intel.com> (raw)
In-Reply-To: <20200423111148.6977-3-mateusz.gorski@linux.intel.com>



> +static int skl_tplg_multi_config_get(struct snd_kcontrol *kcontrol,
> +			struct snd_ctl_elem_value *ucontrol)
> +{
> +	struct snd_soc_component *component =
> +		snd_soc_kcontrol_component(kcontrol);
> +	struct hdac_bus *bus = snd_soc_component_get_drvdata(component);
> +	struct skl_dev *skl = bus_to_skl(bus);
> +	struct skl_pipeline *ppl;
> +	struct skl_pipe *pipe = NULL;
> +	u32 *pipe_id;
> +	struct soc_enum *ec = (struct soc_enum *)kcontrol->private_value;
> +
> +	if (!ec)
> +		return -EINVAL;
> +
> +	pipe_id = ec->dobj.private;
> +
> +	list_for_each_entry(ppl, &skl->ppl_list, node) {
> +		if (ppl->pipe->ppl_id == *pipe_id) {
> +			pipe = ppl->pipe;
> +			break;
> +		}
> +	}
> +	if (!pipe)
> +		return -EIO;
> +
> +	ucontrol->value.enumerated.item[0]  =  pipe->pipe_config_idx;

maybe one nit-pick is that there is a one-line difference between the 
_set and _get functions, and it might be simpler to use a common helper 
with a boolean flag used at the end to do this:

 > +	ucontrol->value.enumerated.item[0]  =  pipe->pipe_config_idx;

or that:

 > +	pipe->pipe_config_idx = ucontrol->value.enumerated.item[0];

  reply	other threads:[~2020-04-23 16:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-23 11:11 [PATCH v3 0/3] Add support for different DMIC configurations Mateusz Gorski
2020-04-23 11:11 ` [PATCH v3 1/3] ASoC: Intel: Skylake: Add alternative topology binary name Mateusz Gorski
2020-04-23 11:11 ` [PATCH v3 2/3] ASoC: Intel: Multiple I/O PCM format support for pipe Mateusz Gorski
2020-04-23 15:49   ` Pierre-Louis Bossart [this message]
2020-04-24 13:23     ` Gorski, Mateusz
2020-04-23 11:11 ` [PATCH v3 3/3] ASoC: Intel: Skylake: Automatic DMIC format configuration according to information from NHLT Mateusz Gorski
2020-04-23 15:53   ` Pierre-Louis Bossart
2020-04-23 15:56 ` [PATCH v3 0/3] Add support for different DMIC configurations Pierre-Louis Bossart

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=e13f51b7-da52-ad7a-d000-1c0099cbf21d@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=cezary.rojewski@intel.com \
    --cc=mateusz.gorski@linux.intel.com \
    --cc=pavan.k.s@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;
as well as URLs for NNTP newsgroup(s).