[alsa-devel] [PATCH 1/4] ASoC: wm8960: Let wm8960 codec driver manage its own MCLK

Mark Brown broonie at kernel.org
Tue Jan 6 18:37:11 CET 2015


On Wed, Dec 31, 2014 at 11:39:11AM +0800, Zidan Wang wrote:

> +		if (!IS_ERR(wm8960->mclk)) {
> +			if (codec->dapm.bias_level == SND_SOC_BIAS_ON)
> +				clk_disable_unprepare(wm8960->mclk);
> +			else {

Both sides of the if statement should have braces if one does, though in
this case nesting a second switch statement would probably be clearer.

> @@ -661,6 +678,7 @@ static int wm8960_set_bias_level_out3(struct snd_soc_codec *codec,
>  
>  		/* Disable VMID and VREF, let them discharge */
>  		snd_soc_write(codec, WM8960_POWER1, 0);
> +
>  		msleep(600);
>  		break;
>  	}

Random while space change here and in a couple of other places.

> +	wm8960->mclk = devm_clk_get(&i2c->dev, "codec_mclk");
> +	if (IS_ERR(wm8960->mclk)) {
> +		if (PTR_ERR(wm8960->mclk) == -EPROBE_DEFER)
> +			return -EPROBE_DEFER;
> +	}
> +

Why name this "codec_mclk" - the device calls it just MCLK?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20150106/5338f4d7/attachment.sig>


More information about the Alsa-devel mailing list