alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Liam Girdwood <lrg@slimlogic.co.uk>
To: "Candelaria Villareal, Jorge" <jorge.candelaria@ti.com>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	"broonie@opensource.wolfsonmicro.com"
	<broonie@opensource.wolfsonmicro.com>
Subject: RE: [alsa-devel] [PATCHv2 6/6] ASoC: OMAP4: Add McPDM platform driver
Date: Tue, 26 Jan 2010 10:33:53 +0000	[thread overview]
Message-ID: <1264502033.3067.52.camel@odin> (raw)
In-Reply-To: <2256F256009DAA4CBE661E9F41EAC84B8C4CEF36@dlee01.ent.ti.com>

On Mon, 2010-01-25 at 15:06 -0600, Candelaria Villareal, Jorge wrote:
> From: Liam Girdwood wrote:
> > On Fri, 2010-01-22 at 17:15 -0600, Candelaria Villareal, Jorge wrote:

snip

> > > +static int omap_mcpdm_dai_hw_params(struct 
> > snd_pcm_substream *substream,
> > > +				    struct snd_pcm_hw_params *params,
> > > +				    struct snd_soc_dai *dai)
> > > +{
> > > +	struct snd_soc_pcm_runtime *rtd = substream->private_data;
> > > +	struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
> > > +	struct omap_mcpdm_data *mcpdm_priv = cpu_dai->private_data;
> > > +	struct omap_mcpdm_link *mcpdm_links = mcpdm_priv->links;
> > > +	int stream = substream->stream;
> > > +	int channels, err, link_mask = 0;
> > > +
> > > +	cpu_dai->dma_data = &omap_mcpdm_dai_dma_params[stream];
> > > +
> > > +	channels = params_channels(params);
> > > +	switch (channels) {
> > > +	case 4:
> > > +		if (stream)
> > 
> > stream is either PLAYBACK or CAPTURE here.
> 
> Downlink and uplink were chosen instead to avoid confusion
> because that is how it is referred in McPDM technical
> documentation. But I do understand that we are talking
> about ALSA stream, not McPDM...
> 
> > 
> > > +			/* up to 2 channels for uplink */
> 
> So I should refer to CAPTURE instead of UPLINK in here.

I think it's best to use both CAPTURE and UPLINK in the comments.

> 
> > > +			return -EINVAL;
> > > +		link_mask |= 1 << 3;
> > > +	case 3:
> > > +		if (stream)
> > > +			/* up to 2 channels for uplink */
> > > +			return -EINVAL;
> > > +		link_mask |= 1 << 2;
> > > +	case 2:
> > > +		link_mask |= 1 << 1;
> > > +	case 1:
> > > +		link_mask |= 1 << 0;
> > > +		break;
> > > +	default:
> > > +		/* unsupported number of channels */
> > > +		return -EINVAL;
> > > +	}
> > > +
> > > +	if (stream) {
> > 
> > ditto
> 
> Here, however, the methods set_uplink & set_downlink are
> Named after McPDM data paths. In this case is it preferred
> to name everything using ALSA convention? Or would it be ok
> to use downlink/uplink on certain cases?

I would name after ALSA but also have comments to state mcpdm link.

Thanks

Liam


      parent reply	other threads:[~2010-01-26 10:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-22 23:15 [PATCHv2 6/6] ASoC: OMAP4: Add McPDM platform driver Candelaria Villareal, Jorge
2010-01-23  1:37 ` Liam Girdwood
2010-01-25 21:06   ` [alsa-devel] " Candelaria Villareal, Jorge
2010-01-26  8:27     ` Jarkko Nikula
2010-01-26 10:30       ` [alsa-devel] " Liam Girdwood
2010-01-26 17:55       ` Candelaria Villareal, Jorge
2010-01-26 10:33     ` Liam Girdwood [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=1264502033.3067.52.camel@odin \
    --to=lrg@slimlogic.co.uk \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=jorge.candelaria@ti.com \
    --cc=linux-omap@vger.kernel.org \
    /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).