All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Subhransu S. Prusty" <subhransu.s.prusty@intel.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: vinod.koul@intel.com, alsa-devel@alsa-project.org,
	broonie@kernel.org, lgirdwood@gmail.com,
	Lars-Peter Clausen <lars@metafoo.de>
Subject: Re: [alsa-devel] [v3 06/13] ASoC: Intel: mrfld: add bytes control for	modules
Date: Thu, 31 Jul 2014 15:24:42 +0530	[thread overview]
Message-ID: <20140731095435.GA32213@vinod.koul@linux.intel.com> (raw)
In-Reply-To: <s5hfvhjrm5n.wl%tiwai@suse.de>

On Wed, Jul 30, 2014 at 03:50:12PM +0200, Takashi Iwai wrote:
> At Wed, 30 Jul 2014 18:32:23 +0530,
> Subhransu S. Prusty wrote:
> > 
> > From: Vinod Koul <vinod.koul@intel.com>
> > 
> > This patch add support for various modules like eq etc for mrfld DSP. All these
> > modules will be exposed to usermode as bytes controls.
> > 
> > Signed-off-by: Vinod Koul <vinod.koul@intel.com>
> > Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
> > ---
> >  sound/soc/intel/sst-atom-controls.c | 176 ++++++++++++++++++++++++++++++++++++
> >  sound/soc/intel/sst-atom-controls.h | 130 ++++++++++++++++++++++++++
> >  2 files changed, 306 insertions(+)
> > 
> > diff --git a/sound/soc/intel/sst-atom-controls.c b/sound/soc/intel/sst-atom-controls.c
> > index 38731e3e5e95..9b878c17d10a 100644
> > --- a/sound/soc/intel/sst-atom-controls.c
> > +++ b/sound/soc/intel/sst-atom-controls.c
> > @@ -25,6 +25,180 @@
> >  #include "sst-mfld-platform.h"
> >  #include "sst-atom-controls.h"
> >  
> > +static inline void sst_fill_byte_control(char *param,
> > +					 u8 ipc_msg, u8 block,
> > +					 u8 task_id, u8 pipe_id,
> > +					 u16 len, void *cmd_data)
> > +{
> > +
> > +	struct snd_sst_bytes_v2 *byte_data = (struct snd_sst_bytes_v2 *)param;
> > +
> > +	byte_data->type = SST_CMD_BYTES_SET;
> > +	byte_data->ipc_msg = ipc_msg;
> > +	byte_data->block = block;
> > +	byte_data->task_id = task_id;
> > +	byte_data->pipe_id = pipe_id;
> > +
> > +	if (len > SST_MAX_BIN_BYTES - sizeof(*byte_data)) {
> > +		pr_err("%s: command length too big (%u)", __func__, len);
> > +		len = SST_MAX_BIN_BYTES - sizeof(*byte_data);
> > +		WARN_ON(1); /* this happens only if code is wrong */
> > +	}
> 
> Better to use simply WARN() for the condition and the message.
Ok

> 
> 
> > +static void sst_send_algo_cmd(struct sst_data *drv,
> > +			      struct sst_algo_control *bc)
> > +{
> > +	int len;
> > +	struct sst_cmd_set_params *cmd;
> > +
> > +	if (bc->params == NULL)
> > +		return;
> > +
> > +	/* bc->max includes sizeof algos + length field */
> > +	len = sizeof(cmd->dst) + sizeof(cmd->command_id) + bc->max;
> > +
> > +	cmd = kzalloc(len, GFP_KERNEL);
> > +	if (cmd == NULL) {
> > +		pr_err("Failed to send cmd, kzalloc failed\n");
> 
> Superfluous error message (in other places, too).
Sure will remove these.
> 
> > +static int sst_algo_control_set(struct snd_kcontrol *kcontrol,
> > +				struct snd_ctl_elem_value *ucontrol)
> > +{
> > +	struct snd_soc_platform *platform =  snd_soc_kcontrol_platform(kcontrol);
> > +	struct sst_data *drv = snd_soc_platform_get_drvdata(platform);
> > +	struct sst_algo_control *bc = (void *)kcontrol->private_value;
> > +
> > +	pr_debug("in %s control_name=%s\n", __func__, kcontrol->id.name);
> > +	mutex_lock(&drv->lock);
> > +	switch (bc->type) {
> > +	case SST_ALGO_PARAMS:
> > +		if (bc->params)
> > +			memcpy(bc->params, ucontrol->value.bytes.data, bc->max);
> > +		break;
> > +	case SST_ALGO_BYPASS:
> > +		bc->bypass = !!ucontrol->value.integer.value[0];
> > +		break;
> > +	default:
> > +		mutex_unlock(&drv->lock);
> > +		pr_err("Invalid Input- algo type:%ld\n", ucontrol->value.integer.value[0]);
> 
> Shouldn't this be bc->type?
Yes
> 
> 
> Takashi

-- 
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  reply	other threads:[~2014-07-31 10:15 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-30 13:02 [v3 00/13] Add mrfld DSP topology and widgets Subhransu S. Prusty
2014-07-30 13:02 ` [v3 01/13] ASoC: Intel: mfld-pcm: add FE and BE ops Subhransu S. Prusty
2014-07-30 13:02 ` [v3 02/13] ASoC: Intel: mrfld: set private data for cpu-dai Subhransu S. Prusty
2014-07-30 13:02 ` [v3 03/13] ASoC: intel: mfld-pcm: don't call trigger ops to DSP for internal streams Subhransu S. Prusty
2014-07-30 13:02 ` [v3 04/13] ASoC: Intel: Fix to use byte control interface Subhransu S. Prusty
2014-07-30 13:02 ` [v3 05/13] ASoC: Intel: add mrfld DSP defines Subhransu S. Prusty
2014-07-30 13:39   ` Takashi Iwai
2014-07-30 13:02 ` [v3 06/13] ASoC: Intel: mrfld: add bytes control for modules Subhransu S. Prusty
2014-07-30 13:50   ` Takashi Iwai
2014-07-31  9:54     ` Subhransu S. Prusty [this message]
2014-07-31  9:54     ` Subhransu S. Prusty
2014-07-30 13:02 ` [v3 07/13] ASoC: Intel: mrfld: add the gain controls Subhransu S. Prusty
2014-07-30 13:02 ` [v3 08/13] ASoC: Intel: mfld-pcm: add control for powering up/down dsp Subhransu S. Prusty
2014-07-30 13:02 ` [v3 09/13] ASoC: Intel: mrfld: add DSP core controls Subhransu S. Prusty
2014-07-30 13:02 ` [v3 10/13] ASoC: Export dapm_kcontrol_get_value Subhransu S. Prusty
2014-07-30 13:02 ` [v3 11/13] ASoC: Intel: mrfld: add the DSP DAPM widgets Subhransu S. Prusty
2014-07-30 13:02 ` [v3 12/13] ASoC: Intel: mfld-pcm: add the fe & be dai ops Subhransu S. Prusty
2014-07-30 13:02 ` [v3 13/13] 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=20140731095435.GA32213@vinod.koul@linux.intel.com \
    --to=subhransu.s.prusty@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lars@metafoo.de \
    --cc=lgirdwood@gmail.com \
    --cc=tiwai@suse.de \
    --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.