All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Linux-ALSA <alsa-devel@alsa-project.org>,
	Simon <horms@verge.net.au>, Liam Girdwood <lrg@ti.com>,
	Kuninori Morimoto <kuninori.morimoto.gx@gmail.com>
Subject: Re: [PATCH 2/2] ASoC: fsi: add master clock control functions
Date: Mon, 5 Nov 2012 09:03:37 +0100	[thread overview]
Message-ID: <20121105080336.GA28886@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <874nl4271g.wl%kuninori.morimoto.gx@renesas.com>


[-- Attachment #1.1: Type: text/plain, Size: 1068 bytes --]

On Sun, Nov 04, 2012 at 05:05:34PM -0800, Kuninori Morimoto wrote:

> > > +	own = clk_get(dev, NULL);
> > > +	if (IS_ERR(own))
> > > +		return -EINVAL;

> > Any reason not to use devm_clk_get()?
> 
> Ahh yes, Sorry.
> BTW, currect code calls this function many times now,
> (this clk is local variable now)
> then should I use...

>  1) use devm_clk_get() / devm_clk_put() pair
>  2) use clk_get() / clk_put() pair
>  3) keep these clocks under private date (struct fsi_prive)
>     and use devm_clk_get() only _probe timing.

Option 3 is the normal approach here.

> > > +	if (enable) {
> > > +		clk_disable(ick);

> > Are we sure that calls to this function are always balanced so that
> > calls to clk_enable() and clk_disable() are balanced?

> I balanced it by local technic.
> But I can say it is un-understandable.
> Can I use counter ?

Well, the whole thing is that the clk_enable() will count too so if you
don't make sure the calls are balanced you'll run into issues.  I'd add
some comments which explain why this is safe.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



  reply	other threads:[~2012-11-05  8:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-31  2:58 [PATCH 0/2] ASoC: fsi: add audio clock calculation Kuninori Morimoto
2012-10-31  2:59 ` [PATCH 1/2] ASoC: fsi: care fsi_hw_start/stop() return value Kuninori Morimoto
2012-11-01 14:48   ` Mark Brown
2012-10-31  2:59 ` [PATCH 2/2] ASoC: fsi: add master clock control functions Kuninori Morimoto
2012-11-01 14:47   ` Mark Brown
2012-11-05  1:05     ` Kuninori Morimoto
2012-11-05  8:03       ` Mark Brown [this message]
2012-11-06  2:30         ` [PATCH 2/2 v2] " Kuninori Morimoto
2012-11-06  8:56           ` Mark Brown

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=20121105080336.GA28886@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=horms@verge.net.au \
    --cc=kuninori.morimoto.gx@gmail.com \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=lrg@ti.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.