mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Zidan Wang <b50113@freescale.com>
Cc: lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.de,
	lars@metafoo.de, ckeepax@opensource.wolfsonmicro.com,
	Li.Xiubo@freescale.com, patches@opensource.wolfsonmicro.com,
	alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Subject: Re: [alsa-devel][PATCH] ASoC: wm8960: Let wm8960 codec driver manage its own MCLK
Date: Wed, 3 Dec 2014 12:41:24 +0000	[thread overview]
Message-ID: <20141203124124.GW7712@sirena.org.uk> (raw)
In-Reply-To: <1417604438-28362-1-git-send-email-b50113@freescale.com>

[-- Attachment #1: Type: text/plain, Size: 1283 bytes --]

On Wed, Dec 03, 2014 at 07:00:38PM +0800, Zidan Wang wrote:

>  #include <sound/core.h>
> @@ -988,6 +990,8 @@ static void wm8960_set_pdata_from_of(struct i2c_client *i2c,
>  
>  	if (of_property_read_bool(np, "wlf,shared-lrclk"))
>  		pdata->shared_lrclk = true;
> +
> +	pdata->mclk = devm_clk_get(&i2c->dev, NULL);

This isn't platform data then...  we also need to check the return code
here and handle at least probe deferral.

> +    /* Mark the mclk pointer to NULL if no mclk assigned */
> +	if (IS_ERR(wm8960->pdata.mclk)) {

Indentation is wrong for the comment here.

> +		/* But do not ignore the request for probe defer */
> +		if (PTR_ERR(wm8960->pdata.mclk) == -EPROBE_DEFER)
> +			return -EPROBE_DEFER;
> +		wm8960->pdata.mclk = NULL;
> +	}

OK, so we are trying to handle probe deferral - but this should be next
to the clk_get().

> +	if (wm8960->pdata.mclk) {
> +		ret = clk_prepare_enable(wm8960->pdata.mclk);

Just continue to use !IS_ERR() - NULL is a valid clock.

> +static int wm8960_runtime_suspend(struct device *dev)
> +{
> +	struct wm8960_priv *wm8960 = dev_get_drvdata(dev);
> +
> +	/* Power down PLL to save power */
> +	regmap_update_bits(wm8960->regmap, WM8960_POWER2, 0x1, 0);

This isn't undone by the resume.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

      reply	other threads:[~2014-12-03 12:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-03 11:00 Zidan Wang
2014-12-03 12:41 ` Mark Brown [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141203124124.GW7712@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=Li.Xiubo@freescale.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=b50113@freescale.com \
    --cc=ckeepax@opensource.wolfsonmicro.com \
    --cc=lars@metafoo.de \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches@opensource.wolfsonmicro.com \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®