From: Nicolin Chen <Guangyu.Chen@freescale.com>
To: Mark Brown <broonie@kernel.org>, Fabio Estevam <festevam@gmail.com>
Cc: Nicolin Chen <nicoleotsuka@gmail.com>,
"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
<patches@opensource.wolfsonmicro.com>, <b02247@freescale.com>,
linux-kernel <linux-kernel@vger.kernel.org>,
"Nicolin Chen" <b42378@freescale.com>
Subject: Re: [alsa-devel] [PATCH v2] ASoC: wm8962: Let CODEC driver enable and disable its own MCLK
Date: Tue, 29 Jul 2014 10:55:19 +0800 [thread overview]
Message-ID: <20140729025518.GB3350@MrMyself> (raw)
In-Reply-To: <CAOMZO5DgE9RjC9MG7FbGPKwsgxunntw70W6Sj8WQKFYG+j8BsA@mail.gmail.com>
On Mon, Jul 28, 2014 at 03:19:43PM -0300, Fabio Estevam wrote:
> Hi Nicolin,
>
> On Mon, Jul 28, 2014 at 9:22 AM, Mark Brown <broonie@kernel.org> wrote:
> > On Mon, Jul 28, 2014 at 07:41:58PM +0800, Nicolin Chen wrote:
> >
> >> + pdata->mclk = devm_clk_get(&i2c->dev, NULL);
> >> +
> >
> > This is broken for deferred probe.
Hi Mark,
Sorry. I don't get why deferred probe would be broken by this.
And I just took a test by adding this:
[...]
@@ -3545,10 +3545,11 @@ static int wm8962_set_pdata_from_of(struct i2c_client *i2c,
}
+bool letstry = true;
static int wm8962_i2c_probe(struct i2c_client *i2c,
const struct i2c_device_id *id)
@@ -3573,10 +3574,15 @@ static int wm8962_i2c_probe(struct i2c_client *i2c,
ret = wm8962_set_pdata_from_of(i2c, &wm8962->pdata);
if (ret != 0)
return ret;
}
+ if (letstry) {
+ letstry = false;
+ return -EPROBE_DEFER;
+ }
/* Mark the mclk pointer to NULL if no mclk assigned */
if (IS_ERR(wm8962->pdata.mclk))
wm8962->pdata.mclk = NULL;
[...]
And it still works for me with a deferred probe:
[] i2c 0-001a: Driver wm8962 requests probe deferral
[]...
[]wm8962 0-001a: customer id 0 revision D
[]input: WM8962 Beep Generator as /devices/soc0/soc/2100000......
[]fsl-asoc-card sound: wm8962 <-> 202c000.ssi mapping ok
>
> You can take a look at sgtl5000 to see how we handle deferred probe in
> devm_clk_get().
Hi Fabio,
Thank you for the hint.
But actually, unlike sgtl5000, this patch doesn't error out for
IS_ERR(mclk) case.
There might be a machine driver that has already got and enabled
the clock while getting the clock from other way or other DT node
rather than WM8962's.
Thank you.
Nicolin
next prev parent reply other threads:[~2014-07-29 3:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-28 11:41 Nicolin Chen
2014-07-28 12:22 ` Mark Brown
2014-07-28 18:19 ` [alsa-devel] " Fabio Estevam
2014-07-29 2:55 ` Nicolin Chen [this message]
2014-07-29 9:52 ` Mark Brown
2014-07-29 10:19 ` Nicolin Chen
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=20140729025518.GB3350@MrMyself \
--to=guangyu.chen@freescale.com \
--cc=alsa-devel@alsa-project.org \
--cc=b02247@freescale.com \
--cc=b42378@freescale.com \
--cc=broonie@kernel.org \
--cc=festevam@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nicoleotsuka@gmail.com \
--cc=patches@opensource.wolfsonmicro.com \
/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
Powered by JetHome