29 Apr
2019
29 Apr
'19
12:16 p.m.
On 27 April 2019 18:20, Mark Brown wrote:
On Fri, Apr 26, 2019 at 01:59:24PM +0100, Adam Thomson wrote:
/*
* Rounding the rate here avoids failure trying to set a new
* rate on an already enabled wclk. In that instance this will
* just set the same rate as is currently in use, and so should
* continue without problem.
*/
ret = clk_set_rate(wclk, sr); if (ret) { dev_err(component->dev,sr = clk_round_rate(wclk, sr);
Don't we need to validate that the rounded rate is actually viable for the parameters we're trying to set here? If there's missing constraints causing something to try to do something unsupportable then we should return an error rather than silently accept.
Thanks for directing my gaze to this again. Actually I don't think the SR should be rounded at all. If it doesn't match exactly it should fail so I'll remove the rounding here. Not sure what my brain was doing there.
For the BCLK rate, I'll see what checking can be added there to make sure the word length is compatible with the 'rounded' BCLK rate.