From: tomasz.figa@gmail.com (Tomasz Figa)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCHv2 4/5] clk: samsung: exynos5410: Add fixed rate clocks
Date: Thu, 31 Jul 2014 23:08:26 +0200 [thread overview]
Message-ID: <53DAB04A.90005@gmail.com> (raw)
In-Reply-To: <CAEe5pB8wzECi=4Eoa_xZYuw7NRPuRmizBNm5mXYMjYY_hWBy9Q@mail.gmail.com>
Humberto,
On 31.07.2014 23:01, Humberto Naves wrote:
> Hi,
>
> On Thu, Jul 31, 2014 at 1:45 PM, Sylwester Nawrocki
> <s.nawrocki@samsung.com> wrote:
>> Can you explain what is rationale behind this change ? Is it related to
>> suspend/resume ordering ?
>
> I had forgotten, but now remember the reason why I did this. If you
> see the current implementation of clk-exynos5410, you will notice it
> heavily depends on the clock "fin_pll". On the other hand, this clock
> exists because in the current dtb (exynos5410-smdk5410.dts), there is
> a node fin_pll such as
>
> fin_pll: xxti {
> compatible = "fixed-clock";
> clock-frequency = <24000000>;
> clock-output-names = "fin_pll";
> #clock-cells = <0>;
> };
>
> So far so good. But the real problem comes in when I check the rate of
> fin_pll to determine if I should install the rate table or not (and I
> really need this for my patch). More specifically
>
> if (_get_rate("fin_pll") == 24 * MHZ) {
> exynos5410_plls[apll].rate_table = apll_24mhz_tbl;
> exynos5410_plls[cpll].rate_table = cpll_24mhz_tbl;
> exynos5410_plls[kpll].rate_table = kpll_24mhz_tbl;
> exynos5410_plls[dpll].rate_table = dpll_24mhz_tbl;
> exynos5410_plls[epll].rate_table = epll_24mhz_tbl;
> exynos5410_plls[ipll].rate_table = ipll_24mhz_tbl;
> }
>
> I *have* to determine if the rate of fin_pll is 24MHz, and this is
> impossible to do if fin_pll is not available. Moreover, there is no
> way I can ensure that the fixed clock provider for fin_pll was
> initialized before mine, so there is chance that _get_rate won't work.
> The only way I fix that is to set the dependency explicitly in the
> dtb, by adding the fin_pll clock as required resource.
>
> clock: clock-controller at 10010000 {
> compatible = "samsung,exynos5410-clock";
> reg = <0x10010000 0x30000>;
> #clock-cells = <1>;
> /* Add the parent clock */
> clocks = <&fin_pll>;
> clock-names = "fin_pll";
> };
This is the correct solution to your problem. The clocks and clock-names
properties should have been there from the beginning but apparently this
has been missed in review. Also see below.
>
> But in any case, the bindings with the DTB must be changed one way or
> another, because I *really* need to use fin_pll on my driver
> registration.
This is a backwards compatible change. On DTBs without clocks and
clock-names properties the PLL tables simply won't be registered which
is exactly the same behavior we have now without any tables in the
driver at all.
> If you agree with this alternative solution I previously
> described, I can change that in the next version of the patch series.
Please update the dts instead, in the way you pointed above.
Best regards,
Tomasz
next prev parent reply other threads:[~2014-07-31 21:08 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-31 11:22 [PATCHv2 0/5] clk: samsung: exynos5410: Implementation of the PLL clocks Humberto Silva Naves
2014-07-31 11:22 ` [PATCHv2 1/5] clk: samsung: exynos5410: Add NULL pointer checks in clock init Humberto Silva Naves
2014-07-31 12:34 ` Tomasz Figa
2014-07-31 13:13 ` Humberto Naves
2014-07-31 13:20 ` Tomasz Figa
2014-07-31 11:22 ` [PATCHv2 2/5] clk: samsung: exynos5410: Organize register offset constants Humberto Silva Naves
2014-07-31 12:49 ` Tomasz Figa
2014-07-31 11:22 ` [PATCHv2 3/5] clk: samsung: exynos5410: Add suspend/resume handling Humberto Silva Naves
2014-07-31 13:09 ` Tomasz Figa
2014-07-31 11:22 ` [PATCHv2 4/5] clk: samsung: exynos5410: Add fixed rate clocks Humberto Silva Naves
2014-07-31 11:45 ` Sylwester Nawrocki
2014-07-31 21:01 ` Humberto Naves
2014-07-31 21:08 ` Tomasz Figa [this message]
2014-07-31 12:53 ` Tomasz Figa
2014-07-31 13:23 ` Humberto Naves
2014-07-31 13:37 ` Tomasz Figa
2014-07-31 11:22 ` [PATCHv2 5/5] clk: samsung: exynos5410: Added clocks DPLL, EPLL, IPLL, and VPLL Humberto Silva Naves
2014-07-31 13:07 ` Tomasz Figa
2014-07-31 13:37 ` Humberto Naves
2014-07-31 15:19 ` Tomasz Figa
2014-07-31 21:19 ` Humberto Naves
2014-07-31 22:17 ` Tomasz Figa
2014-07-31 22:51 ` Mike Turquette
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=53DAB04A.90005@gmail.com \
--to=tomasz.figa@gmail.com \
--cc=linux-arm-kernel@lists.infradead.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).