On Thu, Oct 2, 2014 at 2:58 PM, Mark Brown broonie@kernel.org wrote:
The comment says "if mclk not satisfy the divider, use pll" and then does in fact skip configuring the PLL (or at least a register change which looks like it does that). Looking at the code it seems like there's a requirement for MCLK to be one of the standard multiples of the sample rate.
Ok, got it now.
For sgtl5000 to operate in slave mode it can only work in "Synchronous SYS_MCLK input" mode.
In this mode only the following rates can be supported: 256*Fs, 384*Fs, 512*Fs.
On the board I was testing this I was getting a ratio of 233, so the original code returned -EINVAL.
So the current behaviour looks correct.
We could improve the 'PLL not supported in slave mode' error message though putting the actual ratio we got.
Will send a patch for this shortly.