[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AM5PR1001MB0994EA351AEF82224D9AA6BF80390@AM5PR1001MB0994.EURPRD10.PROD.OUTLOOK.COM>
Date: Mon, 29 Apr 2019 09:16:08 +0000
From: Adam Thomson <Adam.Thomson.Opensource@...semi.com>
To: Mark Brown <broonie@...nel.org>,
Adam Thomson <Adam.Thomson.Opensource@...semi.com>
CC: Liam Girdwood <lgirdwood@...il.com>, Takashi Iwai <tiwai@...e.com>,
Jaroslav Kysela <perex@...ex.cz>,
Akshu Agrawal <Akshu.Agrawal@....com>,
"alsa-devel@...a-project.org" <alsa-devel@...a-project.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Support Opensource <Support.Opensource@...semi.com>
Subject: RE: [PATCH] ASoC: da7219: Use clk_round_rate to handle enabled
bclk/wclk case
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.
> > + */
> > + 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.
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.
Powered by blists - more mailing lists