From: Andrew Lunn <andrew@lunn.ch>
To: "Turquette, Mike" <mturquette@ti.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, jeremy.kerr@canonical.com,
broonie@opensource.wolfsonmicro.com, tglx@linutronix.de,
linus.walleij@stericsson.com, amit.kucheria@linaro.org,
dsaxena@linaro.org, patches@linaro.org,
linaro-dev@lists.linaro.org, aul@pwsan.com,
grant.likely@secretlab.ca, sboyd@quicinc.com,
shawn.guo@freescale.com, skannan@quicinc.com,
magnus.damm@gmail.com, arnd.bergmann@linaro.org,
eric.miao@linaro.org, richard.zhao@linaro.org
Subject: Re: [PATCH v3 4/5] clk: basic gateable and fixed-rate clks
Date: Mon, 12 Dec 2011 22:38:26 +0100 [thread overview]
Message-ID: <20111212213826.GH13600@lunn.ch> (raw)
In-Reply-To: <CAJOA=zP1CAsCqJERvXC6tTh_gs_boGYnO3MUC5=Vgiiw=0Vs_w@mail.gmail.com>
> I don't like this approach. If the bool for a particular clk is
> statically defined then it could be wrong (bootloader/kernel
> mismatch).
>
> I've been thinking of adding a clk->ops->init callback in clk_init,
> which is defined for a platform to use however the author sees fit.
> There have been a few cases where it would be nice to "init" a clk
> only once, when it is registered. That code could also handle
> detecting if a clk is enabled or not.
>
> On the other hand we already have a .get_parent callback which is only
> good for figuring out which parent a mux clk is using... maybe a
> .is_enabled or .get_enabled would be a good idea which also served the
> purpose of dynamically determining whether a clk is disabled or
> running.
>
> In general though I think we should try to keep the solution in the
> core code, not by having platform code pass in a bool.
Hi Mike
How about simply reading the bit in the control register? You are
already doing a read/modify/write when enabling/disabling the clock,
so it seems reasonably safe to assume the read gives you the current
state. For those platforms which this does not work, you could add
another flag disabling this read to get the initial state.
Andrew
next prev parent reply other threads:[~2011-12-12 21:38 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-12 19:47 [PATCH v3 4/5] clk: basic gateable and fixed-rate clks Andrew Lunn
2011-12-12 21:06 ` Turquette, Mike
2011-12-12 21:38 ` Andrew Lunn [this message]
-- strict thread matches above, loose matches on Subject: below --
2011-11-22 1:40 [PATCH v3 0/5] common clk framework Mike Turquette
2011-11-22 1:40 ` [PATCH v3 4/5] clk: basic gateable and fixed-rate clks Mike Turquette
2011-11-22 13:11 ` Arnd Bergmann
2011-11-22 15:03 ` Mark Salter
2011-11-22 15:49 ` Arnd Bergmann
2011-11-26 13:48 ` Shawn Guo
2011-11-27 6:03 ` Turquette, Mike
2011-11-27 0:09 ` Shawn Guo
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=20111212213826.GH13600@lunn.ch \
--to=andrew@lunn.ch \
--cc=amit.kucheria@linaro.org \
--cc=arnd.bergmann@linaro.org \
--cc=aul@pwsan.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=dsaxena@linaro.org \
--cc=eric.miao@linaro.org \
--cc=grant.likely@secretlab.ca \
--cc=jeremy.kerr@canonical.com \
--cc=linaro-dev@lists.linaro.org \
--cc=linus.walleij@stericsson.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=mturquette@ti.com \
--cc=patches@linaro.org \
--cc=richard.zhao@linaro.org \
--cc=sboyd@quicinc.com \
--cc=shawn.guo@freescale.com \
--cc=skannan@quicinc.com \
--cc=tglx@linutronix.de \
/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