From: Liam Girdwood <lrg@slimlogic.co.uk>
To: Graeme Gregory <gg@slimlogic.co.uk>
Cc: alsa-devel <alsa-devel@alsa-project.org>,
Mark Brown <broonie@opensource.wolfsonmicro.com>,
Peter Ujfalusi <peter.ujfalusi@nokia.com>
Subject: Re: [PATCH] ASoC - Add support for upto 16 channels on OMAP MCBSP
Date: Wed, 04 Nov 2009 19:46:49 +0000 [thread overview]
Message-ID: <1257364009.2887.665.camel@odin> (raw)
In-Reply-To: <20091104185534.GA22055@xora.vm.bytemark.co.uk>
On Wed, 2009-11-04 at 18:55 +0000, Graeme Gregory wrote:
> On Wed, Nov 04, 2009 at 05:53:55PM +0000, Liam Girdwood wrote:
> > From: Graeme Gregory <gg@slimlogic.co.uk>
> >
> > This patch increases the number of supported audio channels from 4
> > to 16 and was sponsored by Shotspotter inc.
> >
> > Signed-off-by: Graeme Gregory <gg@slimlogic.co.uk>
> > Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
> > + /* Default div to 1 if it wasn't set by machine driver, otherwise
> > + * use set div as the maximum clock value
> > + */
> > + div = mcbsp_data->clk_div ? mcbsp_data->clk_div : 1;
> > +
> > + /* calc best frame size for rate and clock divider */
> > + do {
> > + frame_size = (mcbsp_data->in_freq / div) / params_rate(params);
> > + pr_debug("freq %d, rate %d, frame size %d, div %d\n",
> > + mcbsp_data->in_freq, params_rate(params), frame_size, div);
> > +
> > + if (frame_size > 256)
> > + div++;
> > + } while (frame_size > 256);
> > +
> > + /* Check we can fit the requested number of channels into our
> > + * calculated frame size
> > + */
> > + if ((channels * wlen) > frame_size) {
> > + printk(KERN_ERR
> > + "OMAP-MCBSP: cannot fit channels in frame size\n");
> > + return -EINVAL;
> > + }
> > +
> > + /* Set the actual clkdiv to use for this samplerate */
> > + regs->srgr1 &= ~CLKGDV(0xFF);
> > + regs->srgr1 |= CLKGDV(div - 1);
> > +
>
> This chunk changes the semantics of other devices which I have never tested.
>
> I also dont know how much damage it does if it does to slave mode. In fact
> I think it might break it in cases which are actually allowable as it uses
> the omap as its clock constraint and not the clock source.
>
Btw, this has been reworked to avoid all I2S paths since you last worked
on it.
So it looks like we need a conditional around this block for when the
codec is mastering BCLK/FRM and MCBSP is slave (as you stated above).
This will then use the original SRGR2 values for SND_SOC_DAIFMT_DSP_A/B
in codec master mode.
V2 will follow.
Liam
next prev parent reply other threads:[~2009-11-04 19:46 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-04 17:53 [PATCH] ASoC - Add support for upto 16 channels on OMAP MCBSP Liam Girdwood
2009-11-04 18:28 ` Mark Brown
2009-11-04 18:55 ` Graeme Gregory
2009-11-04 19:46 ` Liam Girdwood [this message]
2009-11-05 7:51 ` Jarkko Nikula
2009-11-05 14:55 ` Liam Girdwood
2009-11-05 19:28 ` Jarkko Nikula
2009-11-05 20:08 ` Liam Girdwood
2009-11-06 13:20 ` Mark Brown
2009-11-06 14:25 ` Liam Girdwood
2009-11-06 15:00 ` Mark Brown
2009-11-05 8:14 ` Peter Ujfalusi
2009-11-05 8:26 ` Peter Ujfalusi
2009-11-05 10:05 ` Liam Girdwood
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=1257364009.2887.665.camel@odin \
--to=lrg@slimlogic.co.uk \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=gg@slimlogic.co.uk \
--cc=peter.ujfalusi@nokia.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.