Re: [PATCH] ASoC: da7219: Use clk_round_rate to handle enabled bclk/wclk case

From: Mark Brown
Date: Sat Apr 27 2019 - 13:20:18 EST


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.
> + */
> + sr = clk_round_rate(wclk, sr);
> ret = clk_set_rate(wclk, sr);
> if (ret) {
> dev_err(component->dev,

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.

Attachment: signature.asc
Description: PGP signature