All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Vinod Koul <vinod.koul@intel.com>
Cc: alsa-devel@alsa-project.org, Lars-Peter Clausen <lars@metafoo.de>,
	"Subhransu S. Prusty" <subhransu.s.prusty@intel.com>,
	lgirdwood@gmail.com
Subject: Re: [PATCH v7 3/7] ASoC: Intel: mrfld: add DSP core controls
Date: Sat, 27 Sep 2014 12:13:33 +0100	[thread overview]
Message-ID: <20140927111333.GH27755@sirena.org.uk> (raw)
In-Reply-To: <20140925160853.GB1638@intel.com>


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

On Thu, Sep 25, 2014 at 09:38:53PM +0530, Vinod Koul wrote:
> On Thu, Sep 25, 2014 at 04:08:13PM +0100, Mark Brown wrote:
> > On Fri, Sep 19, 2014 at 04:46:04PM +0530, Subhransu S. Prusty wrote:

> > > +       u8 *map = is_tx ? sst_ssp_channel_map : sst_ssp_slot_map;

> > So the "channel" map is for transmit and the "slot" map is for receive?
> > That naming doesn't seem at all obvious, I'd expect some confusion and
> > resulting bugs there.  

> yes as multiple channels get interleaved to slot while transmitting and on
> recive side various lots get de-interleaved to channels :)
> These controls allow you to route stuff.

I can tell what they're supposed to do given the above code, what I'm
saying is that when I see the above code I'm expecting to find bugs
elsewhere since it's not going to be clear if you see either variable in
isolation.  Better naming please, for example use the direction.

> The DSP has the bitmap for interlever as explained in sst_send_slot_map()

> /*
>  * channel map value is a bitfield where each bit represents a slot
>  *
>  *                        76543210      # 0 = slot 0, 1 = slot 1
>  *
>  * e.g. codec1_0 tx map = 00000101b -> data from codec_out1_0 goes into slot
>  * 0, 2
>  */

> so based on the channel selected here we will set the map and send to DSP.
> For none case we don't need to do anything. Yes this bit need this
> explanation so will add up

But why not - why is the effect of clearing all the bits to do nothing?

> > > +			 !strncmp(kctl->id.name, w->name, index)) {
> > > +			struct sst_enum *e = (void *)kctl->private_value;
> > > +
> > > +			e->w = w;
> > > +
> > > +		} else if (strstr(kctl->id.name, "deinterleaver") &&
> > > +			 !strncmp(kctl->id.name, w->name, index)) {
> > > +
> > > +			struct sst_enum *e = (void *)kctl->private_value;
> > > +
> > > +			e->w = w;
> > > +		}

> > Again no fallthrough case.

> would that be valid. We have only volume, params, mute, interlevaer and
> deinterleaver controls only :)
> Can add fall thru for therotical if you feel that is right thing to do.

Yes, it's better.  This is part of the whole thing about the code
setting off alarm bells - things look fragile and the missing error
checking does nothing to dispel that.

[-- 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-27 11:13 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-19 11:16 [PATCH v7 0/7] Add mrfld DSP topology and widgets Subhransu S. Prusty
2014-09-19 11:16 ` [PATCH v7 1/7] ASoC: Intel: mrfld: add the gain controls Subhransu S. Prusty
2014-09-25 14:20   ` Mark Brown
2014-09-25 14:06     ` Vinod Koul
2014-09-19 11:16 ` [PATCH v7 2/7] ASoC: Intel: mfld-pcm: add control for powering up/down dsp Subhransu S. Prusty
2014-09-25 14:22   ` Mark Brown
2014-09-19 11:16 ` [PATCH v7 3/7] ASoC: Intel: mrfld: add DSP core controls Subhransu S. Prusty
2014-09-25 15:08   ` Mark Brown
2014-09-25 16:08     ` Vinod Koul
2014-09-27 11:13       ` Mark Brown [this message]
2014-09-29  6:00         ` Vinod Koul
2014-09-19 11:16 ` [PATCH v7 4/7] ASoC: Export dapm_kcontrol_get_value Subhransu S. Prusty
2014-10-02 18:13   ` Mark Brown
2014-09-19 11:16 ` [PATCH v7 5/7] ASoC: Intel: mrfld: add the DSP DAPM widgets Subhransu S. Prusty
2014-10-02 18:12   ` Mark Brown
2014-10-06  2:40     ` Vinod Koul
2014-10-06  2:44       ` Vinod Koul
2014-10-06 10:50         ` Mark Brown
2014-09-19 11:16 ` [PATCH v7 6/7] ASoC: Intel: mfld-pcm: add FE and BE ops Subhransu S. Prusty
2014-09-19 11:16 ` [PATCH v7 7/7] 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=20140927111333.GH27755@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.