lkml.org 
[lkml]   [2014]   [Dec]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [alsa-devel][PATCH v4] ASoC: wm8960: Let wm8960 codec driver manage its own MCLK
On Tue, Dec 09, 2014 at 01:45:16PM +0800, Zidan Wang wrote:

> @@ -1002,6 +1005,13 @@ static int wm8960_i2c_probe(struct i2c_client *i2c,
> if (wm8960 == NULL)
> return -ENOMEM;
>
> + wm8960->mclk = devm_clk_get(&i2c->dev, "codec_mclk");
> +
> + if (IS_ERR(wm8960->mclk)) {
> + if (PTR_ERR(wm8960->mclk) == -EPROBE_DEFER)
> + return -EPROBE_DEFER;
> + }
> +
> wm8960->regmap = devm_regmap_init_i2c(i2c, &wm8960_regmap);
> if (IS_ERR(wm8960->regmap))
> return PTR_ERR(wm8960->regmap);
> @@ -1041,6 +1051,9 @@ static int wm8960_i2c_probe(struct i2c_client *i2c,
>
> i2c_set_clientdata(i2c, wm8960);
>
> + pm_runtime_enable(&i2c->dev);
> + pm_request_idle(&i2c->dev);
> +
> ret = snd_soc_register_codec(&i2c->dev,
> &soc_codec_dev_wm8960, &wm8960_dai, 1);
>

This isn't going to work if PM is disabled (which is still a valid
configuration). The general idiom for this is that the driver should
start up with everything powered up then let runtime idle turn things
off if they're not required. That way if runtime PM is disabled then
the system will still work as everything will just stay powered on all
the time.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2014-12-22 19:41    [W:0.072 / U:0.504 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site