devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nicolin Chen <Guangyu.Chen@freescale.com>
To: "Austin, Brian" <Brian.Austin@cirrus.com>
Cc: "mark.rutland@arm.com" <mark.rutland@arm.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	"pawel.moll@arm.com" <pawel.moll@arm.com>,
	"ijc+devicetree@hellion.org.uk" <ijc+devicetree@hellion.org.uk>,
	Mark Brown <broonie@kernel.org>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	"Handrigan, Paul" <Paul.Handrigan@cirrus.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	"rob@landley.net" <rob@landley.net>,
	"galak@codeaurora.org" <galak@codeaurora.org>,
	"grant.likely@linaro.org" <grant.likely@linaro.org>
Subject: Re: [PATCH] ASoC: cs42888: Add codec driver support
Date: Tue, 25 Feb 2014 10:32:21 +0800	[thread overview]
Message-ID: <20140225023219.GA7229@MrMyself> (raw)
In-Reply-To: <FF523989-CEF7-4A91-92A0-63D5FB90D897@cirrus.com>

On Mon, Feb 24, 2014 at 04:32:06PM +0000, Austin, Brian wrote:
> 
> On Feb 24, 2014, at 10:06 AM, Nicolin Chen <Guangyu.Chen@freescale.com> wrote:
> 
> > On Mon, Feb 24, 2014 at 03:52:24PM +0000, Austin, Brian wrote:
> >>>> +	if (!IS_ERR(cs42888->clk))
> >>>> +		clk_disable_unprepare(cs42888->clk);
> >>> 
> >>> Does the device work without MCLK?
> >> Yes, MCLK is required. If you can’t get the clock you should error out.
> > 
> > Wait...Regarding this clock part, I just forgot the reason I put the code:
> > 
> > 385         cs42888->clk = devm_clk_get(&i2c->dev, "mclk");
> > 386         if (IS_ERR(cs42888->clk))
> > 387                 dev_warn(&i2c->dev, "failed to get the clock: %ld\n",
> > 388                                 PTR_ERR(cs42888->clk));
> > 
> > was because the MCLK might be provided from SoC (DAI master) so it could
> > be totally controlled by CPU DAI driver, ESAI for example has its own
> > dividers to derive the HCKT clock (MCLK for Tx) from ahb clock in SoC
> > clock tree, in which case we might not easily pass a valid clock phandle
> > via DT. (RFC to this thought.)
> OK, It’s an external MCLK source, so why not just handle that in the machine driver? 
> Usually you would want the clock enabled/disabled in the machine driver so if you don’t get it, you can bail out there. 
> At least that is how I do our MCLK’s. Since you are only using the freq of the clock to derive modes, just put the clock initialization outside and just pass in the freq like you do in set_sysclk

Letting codec handle the clock here is trying to en/disable it only when using
it -- pm_runtime_resume/suspend() so that we can save power during idle states,
while putting it into machine driver, quite common in lots of machine drivers
though, would need us to enable it in the probe(), otherwise machine driver
can't finish the clock enabling before codec driver's pm_runtime_resume() as
pm_runtime_get_sync(codec_dai->dev) is almost the head of soc_pcm_open().

At first place, I did let this codec driver be totally exempt from this clock
handling. And it's quite fair and neat to do that in the machine driver till
this second thought came to me....

Thank you,
Nicolin Chen


_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  reply	other threads:[~2014-02-25  2:32 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-24  6:55 [PATCH] ASoC: cs42888: Add codec driver support Nicolin Chen
     [not found] ` <1393224929-7555-1-git-send-email-Guangyu.Chen-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2014-02-24 11:30   ` Mark Brown
2014-02-24 15:47     ` Nicolin Chen
2014-02-24 15:52     ` Austin, Brian
2014-02-24 15:47       ` Nicolin Chen
2014-02-24 16:06       ` Nicolin Chen
2014-02-24 16:32         ` Austin, Brian
2014-02-25  2:32           ` Nicolin Chen [this message]
2014-02-25  0:00         ` Mark Brown
2014-02-25  2:38           ` Nicolin Chen
2014-02-25  3:09             ` Mark Brown
2014-02-25  3:13               ` Nicolin Chen
2014-02-25  3:39                 ` Mark Brown
2014-02-25  3:46                   ` Nicolin Chen
2014-02-25  3:52                     ` Mark Brown
2014-02-25  3:54                       ` Nicolin Chen
2014-02-25  3:54                     ` [alsa-devel] " Fabio Estevam
2014-02-25  3:55                       ` Nicolin Chen
2014-02-24 17:54   ` Lars-Peter Clausen
2014-02-25  2:39     ` 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=20140225023219.GA7229@MrMyself \
    --to=guangyu.chen@freescale.com \
    --cc=Brian.Austin@cirrus.com \
    --cc=Paul.Handrigan@cirrus.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=grant.likely@linaro.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=lgirdwood@gmail.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=pawel.moll@arm.com \
    --cc=rob@landley.net \
    --cc=robh+dt@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).