All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: "Subhransu S. Prusty" <subhransu.s.prusty@intel.com>
Cc: vinod.koul@intel.com, alsa-devel@alsa-project.org,
	Lars-Peter Clausen <lars@metafoo.de>,
	lgirdwood@gmail.com
Subject: Re: [PATCH v6 05/10] ASoC: Intel: mrfld: add DSP core controls
Date: Tue, 16 Sep 2014 12:30:53 -0700	[thread overview]
Message-ID: <20140916193053.GD7960@sirena.org.uk> (raw)
In-Reply-To: <1410255693-6958-6-git-send-email-subhransu.s.prusty@intel.com>


[-- Attachment #1.1: Type: text/plain, Size: 2624 bytes --]

On Tue, Sep 09, 2014 at 03:11:28PM +0530, Subhransu S. Prusty wrote:

> +	mutex_lock(&drv->lock);
> +	map = is_tx ? sst_ssp_channel_map : sst_ssp_slot_map;
> +
> +	val = 1 << ctl_no;
> +	mux = ucontrol->value.enumerated.item[0];
> +	if (mux > e->max - 1) {
> +		mutex_unlock(&drv->lock);
> +		return -EINVAL;
> +	}

This is still in parameter validation so we don't need to have the lock
yet at all.

> +	/*first clear all registers of this bit*/
> +	for (i = 0; i < e->max; i++)
> +		map[i] &= ~val;
> +
> +	if (mux == 0) /*kctl set to 'none'*/
> +		return 0;

This is returning with the lock still held AFAICT.  I'm a bit surprised
that we don't need to interact with the hardware if we've disabled
everything, shouldn't this have some effect on the hardware?

Also the coding style thing with the comments again.

> +static void sst_find_and_send_pipe_algo(struct sst_data *drv,
> +					const char *pipe, struct sst_ids *ids)
> +{
> +	struct sst_algo_control *bc;
> +	struct sst_module *algo = NULL;
> +
> +	dev_dbg(&drv->pdev->dev, "Enter: widget=%s\n", pipe);
> +
> +	list_for_each_entry(algo, &ids->algo_list, node) {
> +		bc = (void *)algo->kctl->private_value;
> +
> +		dev_dbg(&drv->pdev->dev, "Found algo control name=%s pipe=%s\n",
> +				algo->kctl->id.name, pipe);
> +		sst_send_algo_cmd(drv, bc);
> +	}
> +}

I'm not seeing any handling if we failed to find anything here.

> +	[SST_IP_MEDIA2]		= SST_SWM_IN_MEDIA2,
> +	[SST_IP_MEDIA3]		= SST_SWM_IN_MEDIA3,
> +};
> +static void sst_set_pipe_gain(struct sst_ids *ids,

Coding style - no blank line.  This is quite common in this patch and
something that's been an issue in previous versions of this series too.

> +	if (enable)
> +		sst->ops->power(sst->dev, true);
> +
> +	mutex_lock(&drv->lock);
> +	if (enable)
> +		timer_usage++;
> +	else
> +		timer_usage--;

This seems a bit strange.  We're doing the enable outside the lock, then
taking the lock, then doing some refcounting outside the lock.

> +	mutex_unlock(&drv->lock);
> +
> +	if (!enable)
> +		sst->ops->power(sst->dev, false);

Same thing here.  How does the power management work here, it doesn't
seem joined up?  I'd really like to see some comments explaining what's
going on with this stuff.

> +static bool is_sst_dapm_widget(struct snd_soc_dapm_widget *w)
> +{
> +	if ((w->id == snd_soc_dapm_pga) ||
> +	    (w->id == snd_soc_dapm_aif_in) ||
> +	    (w->id == snd_soc_dapm_aif_out) ||
> +	    (w->id == snd_soc_dapm_input) ||
> +	    (w->id == snd_soc_dapm_output) ||
> +	    (w->id == snd_soc_dapm_mixer))
> +		return true;
> +	else
> +		return false;
> +}

Use a switch statement please.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



  reply	other threads:[~2014-09-16 19:31 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-09  9:41 [PATCH v6 00/10] Add mrfld DSP topology and widgets Subhransu S. Prusty
2014-09-09  9:41 ` [PATCH v6 01/10] ASoC: Intel: mfld-pcm: don't call trigger ops to DSP for internal streams Subhransu S. Prusty
2014-09-16 18:54   ` Mark Brown
2014-09-09  9:41 ` [PATCH v6 02/10] ASoC: Intel: mrfld: add bytes control for modules Subhransu S. Prusty
2014-09-16 18:50   ` Mark Brown
2014-09-16 18:55   ` Mark Brown
2014-09-09  9:41 ` [PATCH v6 03/10] ASoC: Intel: mrfld: add the gain controls Subhransu S. Prusty
2014-09-16 19:00   ` Mark Brown
2014-09-09  9:41 ` [PATCH v6 04/10] ASoC: Intel: mfld-pcm: add control for powering up/down dsp Subhransu S. Prusty
2014-09-16 19:03   ` Mark Brown
2014-09-17 10:56     ` Subhransu S. Prusty
2014-09-17 10:56     ` [alsa-devel] " Subhransu S. Prusty
2014-09-09  9:41 ` [PATCH v6 05/10] ASoC: Intel: mrfld: add DSP core controls Subhransu S. Prusty
2014-09-16 19:30   ` Mark Brown [this message]
2014-09-17 10:55     ` [alsa-devel] " Subhransu S. Prusty
2014-09-17 19:37       ` Mark Brown
2014-09-18  6:12         ` Vinod Koul
2014-09-18 17:28           ` Mark Brown
2014-09-19  8:10             ` Vinod Koul
2014-09-19  8:21               ` Vinod Koul
2014-09-23  1:57                 ` Mark Brown
2014-09-23  3:52                   ` Vinod Koul
2014-09-17 10:55     ` Subhransu S. Prusty
2014-09-09  9:41 ` [PATCH v6 06/10] ASoC: Export dapm_kcontrol_get_value Subhransu S. Prusty
2014-09-09  9:41 ` [PATCH v6 07/10] ASoC: Intel: mrfld: add the DSP DAPM widgets Subhransu S. Prusty
2014-09-09  9:41 ` [PATCH v6 08/10] ASoC: Intel: mfld-pcm: add FE and BE ops Subhransu S. Prusty
2014-09-09  9:41 ` [PATCH v6 09/10] ASoC: Intel: mrfld: Use snd_soc_dai_get_drvdata to derive drv data Subhransu S. Prusty
2014-09-16 23:40   ` Mark Brown
2014-09-09  9:41 ` [PATCH v6 10/10] ASoC: Intel: mrfld: add the DSP mixers Subhransu S. Prusty

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=20140916193053.GD7960@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=lars@metafoo.de \
    --cc=lgirdwood@gmail.com \
    --cc=subhransu.s.prusty@intel.com \
    --cc=vinod.koul@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.