[alsa-devel] [PATCH 08/14] ASoC: kirkwood: prefer external clock over internal clock

Jean-Francois Moine moinejf at free.fr
Sun Sep 1 18:41:53 CEST 2013


On Sat, 31 Aug 2013 13:42:36 +0100
Russell King <rmk+kernel at arm.linux.org.uk> wrote:

> Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
> ---
>  sound/soc/kirkwood/kirkwood-i2s.c |   16 ++++++++--------
>  1 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/sound/soc/kirkwood/kirkwood-i2s.c b/sound/soc/kirkwood/kirkwood-i2s.c
> index 84dd9b0..8e10369 100644
> --- a/sound/soc/kirkwood/kirkwood-i2s.c
> +++ b/sound/soc/kirkwood/kirkwood-i2s.c
> @@ -104,20 +104,20 @@ static void kirkwood_set_rate(struct snd_soc_dai *dai,
>  {
>  	uint32_t clks_ctrl;
>  
> -	if (rate == 44100 || rate == 48000 || rate == 96000) {
> -		/* use internal dco for supported rates */
> -		dev_dbg(dai->dev, "%s: dco set rate = %lu\n",
> -			__func__, rate);
> -		kirkwood_set_dco(priv->io, rate);
> -
> -		clks_ctrl = KIRKWOOD_MCLK_SOURCE_DCO;
> -	} else if (!IS_ERR(priv->extclk)) {
> +	if (!IS_ERR(priv->extclk)) {
>  		/* use optional external clk for other rates */
>  		dev_dbg(dai->dev, "%s: extclk set rate = %lu -> %lu\n",
>  			__func__, rate, 256 * rate);
>  		clk_set_rate(priv->extclk, 256 * rate);
>  
>  		clks_ctrl = KIRKWOOD_MCLK_SOURCE_EXTCLK;
> +	} else if (rate == 44100 || rate == 48000 || rate == 96000) {

The rate is always good, and having this test raises a compilation warning
(clks_ctrl may be not initialized).


> +		/* use internal dco for supported rates */
> +		dev_dbg(dai->dev, "%s: dco set rate = %lu\n",
> +			__func__, rate);
> +		kirkwood_set_dco(priv->io, rate);
> +
> +		clks_ctrl = KIRKWOOD_MCLK_SOURCE_DCO;
>  	}
>  	writel(clks_ctrl, priv->io + KIRKWOOD_CLOCKS_CTRL);
>  }



-- 
Ken ar c'hentañ	|	      ** Breizh ha Linux atav! **
Jef		|		http://moinejf.free.fr/


More information about the Alsa-devel mailing list