[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20141203124124.GW7712@sirena.org.uk>
Date:	Wed, 3 Dec 2014 12:41:24 +0000
From:	Mark Brown <broonie@...nel.org>
To:	Zidan Wang <b50113@...escale.com>
Cc:	lgirdwood@...il.com, perex@...ex.cz, tiwai@...e.de,
	lars@...afoo.de, ckeepax@...nsource.wolfsonmicro.com,
	Li.Xiubo@...escale.com, patches@...nsource.wolfsonmicro.com,
	alsa-devel@...a-project.org, linux-kernel@...r.kernel.org
Subject: Re: [alsa-devel][PATCH] ASoC: wm8960: Let wm8960 codec driver manage
 its own MCLK
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.
Download attachment "signature.asc" of type "application/pgp-signature" (474 bytes)
Powered by blists - more mailing lists
 
