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

From: Mark Brown
Date: Tue Jan 06 2015 - 12:37:38 EST


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?

Attachment: signature.asc
Description: Digital signature