Re: [PATCH] ASoC - Add support for upto 16 channels on OMAP MCBSP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Nov 04, 2009 at 05:53:55PM +0000, Liam Girdwood wrote:
> From: Graeme Gregory <gg@xxxxxxxxxxxxxxx>
> 
> 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@xxxxxxxxxxxxxxx>
> Signed-off-by: Liam Girdwood <lrg@xxxxxxxxxxxxxxx>
> +	/* 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.

Graeme

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

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux