]> rtime.felk.cvut.cz Git - lisovros/linux_canprio.git/commit
ASoC: omap-mcbsp: Place correct constraints for streams
authorPeter Ujfalusi <peter.ujfalusi@nokia.com>
Thu, 3 Jun 2010 04:39:36 +0000 (07:39 +0300)
committerLiam Girdwood <lrg@slimlogic.co.uk>
Thu, 3 Jun 2010 15:12:40 +0000 (16:12 +0100)
commitddc29b0104d69e3742e6a9f23184fb6184614403
tree653558a4d808b89f20fd0fcacc6c239603ef84ee
parent3f024039e08598521a2c4c3eaedf8de2119797f4
ASoC: omap-mcbsp: Place correct constraints for streams

OMAP McBSP FIFO is word structured:
McBSP2 has 1024 + 256 = 1280 word long buffer,
McBSP1,3,4,5 has 128 word long buffer

This means, that the size of the FIFO
depends on the McBSP word size configuration.
For example on McBSP3:
16bit samples: size is 128 * 2 = 256 bytes
32bit samples: size is 128 * 4 = 512 bytes
It is simpler to place constraint for buffer and period based on channels.
McBSP3 as example again (16 or 32 bit samples):
1 channel (mono): size is 128 frames (128 words)
2 channels (stereo): size is 128 / 2 = 64 frames (2 * 64 words)
4 channels: size is 128 / 4 = 32 frames (4 * 32 words)

Use the second method to place hw_rule on buffer size, and in threshold
mode to period size.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Jarkko Nikula <jhnikula@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolsfonmicro.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
sound/soc/omap/omap-mcbsp.c