24 Apr
2015
24 Apr
'15
8:55 p.m.
On Sun, Apr 19, 2015 at 02:27:32AM +0530, Vinod Koul wrote:
- req_bclk = fs * slots * s_fmt;
We have a helper for this.
- dummy = 0;
- /* Find the lowest bit clock possible for particular configuration */
- do {
req_bclk = ((s_fmt * fs * slots) + (fs * dummy));
mod = HDA_SSP_MAX_FREQ_192 % req_bclk;
divisor = HDA_SSP_MAX_FREQ_192 / req_bclk;
if (!mod) {
found = 1;
break;
}
/* Dont add odd number of dummy bits, since I2S requires
* dummy bit after each slot/channel
*/
It does?
dummy += 2;
if (dummy > (HDA_SSPSP2_FEP_MASK >> HDA_SSPSP2_FEP_SHIFT)) {
dev_err(ctx->dev, "Dummy bit greater than what SSP can support\n");
return -EINVAL;
}
- } while (divisor > 0);
Aside from the limits this all looks like it could be generic?