<br><br><div class="gmail_quote">2010/6/28 Troy Kisky <span dir="ltr"><<a href="mailto:troy.kisky@boundarydevices.com">troy.kisky@boundarydevices.com</a>></span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">Raffaele Recalcati wrote:<br>
> + if (dev->i2s_fast_clock) {<br>
> + clk_div = 256;<br>
</div>can you have<br>
f = (freq / params->rate_num) * params->rate_den;<br>
<div class="im">> + do {<br>
> + framesize = (freq / (--clk_div)) /<br>
> + params->rate_num *<br>
> + params->rate_den;<br>
</div>and<br>
framesize = f / (--clk_div);<br>
<div class="im">> + } while (((framesize < 33) || (framesize > 4095)) &&<br>
> + (clk_div));<br>
> + clk_div--;<br>
</div>looks like clk_div can go negative here, should the above while say (clk_div > 1)<br></blockquote><div><br>> + } while (((framesize < 33) || (framesize
> 4095)) &&<br>
> + (clk_div));<br><br>only if clk_div not null stay inside the while.<br><br>
> + clk_div--;<br><br>and here can at minumum be 0, not negative.<br><br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div></div><div class="h5">> + srgr |= DAVINCI_MCBSP_SRGR_FPER(framesize - 1);<br>
> + } else {<br>
> + /* symmetric waveforms */<br>
> + clk_div = freq / (mcbsp_word_length * 16) /<br>
> + params->rate_num * params->rate_den;<br>
> + srgr |= DAVINCI_MCBSP_SRGR_FPER(mcbsp_word_length *<br>
> + 16 - 1);<br>
> + }<br>
> + clk_div &= 0xFF;<br>
> + srgr |= clk_div;<br>
</div></div></blockquote></div><br><br clear="all">so, dividing for (CLKGDV + 1) it is ok.<br>
<br>Raffaele<br><br>