lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191108160704.GA10439@ediswmail.ad.cirrus.com>
Date:   Fri, 8 Nov 2019 16:07:04 +0000
From:   Charles Keepax <ckeepax@...nsource.cirrus.com>
To:     Michael Walle <michael@...le.cc>
CC:     <alsa-devel@...a-project.org>, <linux-kernel@...r.kernel.org>,
        Liam Girdwood <lgirdwood@...il.com>,
        Mark Brown <broonie@...nel.org>,
        Jaroslav Kysela <perex@...ex.cz>,
        Takashi Iwai <tiwai@...e.com>, <patches@...nsource.cirrus.com>
Subject: Re: [PATCH] ASoC: wm8904: configure sysclk/FLL automatically

On Fri, Nov 08, 2019 at 12:15:48AM +0100, Michael Walle wrote:
> This adds a new mode WM8904_CLK_AUTO which automatically enables the FLL
> if a frequency different than the MCLK is set.
> 
> These additions make the codec work with the simple-card driver in
> general and especially in systems where the MCLK doesn't match the
> requested clock.
> 
> Signed-off-by: Michael Walle <michael@...le.cc>
> ---
> +static int wm8904_set_sysclk(struct snd_soc_dai *dai, int clk_id,
> +			     unsigned int freq, int dir)
> +{
> +	struct snd_soc_component *component = dai->component;
> +	struct wm8904_priv *priv = snd_soc_component_get_drvdata(component);
> +	unsigned long mclk_freq;
> +	int ret;
> +
> +	switch (clk_id) {
> +	case WM8904_CLK_AUTO:
> +		mclk_freq = clk_get_rate(priv->mclk);
> +		/* enable FLL if a different sysclk is desired */
> +		if (mclk_freq != freq) {
> +			priv->sysclk_src = WM8904_CLK_FLL;
> +			ret = wm8904_set_fll(dai, WM8904_FLL_MCLK,
> +					     WM8904_FLL_MCLK,
> +					     clk_get_rate(priv->mclk), freq);

minor nit, might as well use mclk_freq rather than calling
clk_get_rate again, other than that though I think this looks
good.

Thanks,
Charles

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ