From: grant.likely@secretlab.ca (Grant Likely)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC 6/8] of: add clock providers
Date: Wed, 16 Nov 2011 12:06:56 -0700 [thread overview]
Message-ID: <CACxGe6tHF7K4y9FqUxYraK0pgRRtN671-pp3Z88SEj4nStQiCg@mail.gmail.com> (raw)
In-Reply-To: <20111114021359.GA25796@b20223-02.ap.freescale.net>
On Sun, Nov 13, 2011 at 7:14 PM, Richard Zhao <richard.zhao@linaro.org> wrote:
> On Tue, Nov 08, 2011 at 08:49:42PM -0600, Rob Herring wrote:
>> > +For example:
>> > +
>> > + ? ?oscillator {
>> > + ? ? ? ?#clock-cells = <1>;
>> > + ? ? ? ?clock-output-name = "ckil", "ckih";
>> > + ? ?};
>> > +
>> > +- this node defines a device with two clock outputs, the first named
>> > + ?"ckil" and the second named "ckih". ?Consumer nodes always reference
>> > + ?clocks by index. The names should reflect the clock output signal
>> > + ?names for the device.
>> > +
>> > +==Clock consumers==
>> > +
>> > +Required properties:
>> > +clock-input: ? ? ? List of phandle and clock specifier pairs, one pair
>> > + ? ? ? ? ? for each clock input to the device.
>> > +clock-input-name: List of clock input name strings sorted in the same
>> > + ? ? ? ? ? order as the clock-input property. ?Consumers drivers
>> > + ? ? ? ? ? will use clock-input-name to match clock input names
>> > + ? ? ? ? ? with clock-input specifiers.
>> > +
>> > +For example:
>> > +
>> > + ? ?uart {
>> > + ? ? ? ?clock-input = <&osc 1> <&ref 0>;
>> > + ? ? ? ?clock-input-name = "baud", "register";
>> > + ? ?};
>>
>> This is duplicated below.
I'm okay with that. It's not entirely the same, and I think having
several examples is helpful.
>> > + ? ?/* external oscillator */
>> > + ? ?osc: oscillator {
>> > + ? ? ? ?compatible = "fixed-clock";
>> > + ? ? ? ?#clock-cells = <1>;
>> > + ? ? ? ?frequency ?= <32678>;
>>
>> The code is using "clock-frequency" here.
Fixed
>>
>> > + ? ? ? ?clock-output-name = "osc";
>> > + ? ?};
>> > +
>> > + ? ?/* phase-locked-loop device, generates a higher frequency clock
>> > + ? ? * from the external oscillator reference */
>> > + ? ?pll: pll {
>> > + ? ? ? ?compatible = "some-pll-interface"
>> > + ? ? ? ?#clock-cells = <1>;
>> > + ? ? ? ?clock-input = <&osc 0>;
>>
>> There's a mismatch in #clock-cells size and this.
>
> osc #clock-cells is 1. "0" is one cell too. Nothing wrong. Correct my understanding?
Richard is correct. The #clock-cells value needs to be 1, which in
the clock binding means one cell for the phandle and one cell for the
attached arguments. Exactly the same as the gpio binding.
>> > +static struct clk *__of_clk_get_from_provider(struct of_phandle_args *clkspec)
>> > +{
>> > + ? struct of_clk_provider *provider;
>> > + ? struct clk *clk = NULL;
>> > +
>> > + ? /* Check if we have such a provider in our array */
>> > + ? mutex_lock(&of_clk_lock);
>> > + ? list_for_each_entry(provider, &of_clk_providers, link) {
>> > + ? ? ? ? ? if (provider->node == clkspec->np)
>> > + ? ? ? ? ? ? ? ? ? clk = provider->get(clkspec, provider->data);
>>
>> How about:
>>
>> if (provider->get)
>> ? ? ? clk = provider->get(clkspec, provider->data);
>> else
>> ? ? ? clk = provider->data;
I'd rather make it a requirement for every clock driver to provide the
get hook; even if it uses a stock version that simply returns ->data.
Thanks for the review.
g.
next prev parent reply other threads:[~2011-11-16 19:06 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-09 1:19 [RFC 0/8] Initial DT clock bindings Grant Likely
[not found] ` <1320801583-12774-8-git-send-email-grant.likely@secretlab.ca>
2011-11-09 2:36 ` [RFC 7/8] arm/clkdev: lookup clocks from OF clock providers Rob Herring
2011-11-16 18:54 ` Grant Likely
[not found] ` <1320801583-12774-7-git-send-email-grant.likely@secretlab.ca>
2011-11-09 2:49 ` [RFC 6/8] of: add " Rob Herring
2011-11-14 2:14 ` Richard Zhao
2011-11-16 19:06 ` Grant Likely [this message]
2011-11-09 9:13 ` Sascha Hauer
2011-11-09 11:23 ` Cousson, Benoit
2011-11-09 11:49 ` Sascha Hauer
2011-11-11 19:57 ` Cousson, Benoit
2011-11-16 22:12 ` Grant Likely
2011-11-18 7:48 ` Sascha Hauer
2011-11-09 13:59 ` Rob Herring
2011-11-11 19:50 ` Cousson, Benoit
2011-11-09 13:31 ` Rob Herring
2011-11-09 18:39 ` Tony Lindgren
2011-11-21 15:37 ` Shawn Guo
2011-11-30 19:38 ` Grant Likely
2011-12-01 6:34 ` Shawn Guo
[not found] ` <1320801583-12774-9-git-send-email-grant.likely@secretlab.ca>
2011-11-09 9:31 ` [RFC 8/8] dt/arm: versatile add clock parsing Sascha Hauer
[not found] ` <1320801583-12774-4-git-send-email-grant.likely@secretlab.ca>
2011-11-14 3:59 ` [RFC 3/8] of: create of_phandle_args to simplify return of phandle parsing data Shawn Guo
2011-11-16 18:47 ` Grant Likely
2011-11-21 15:50 ` Shawn Guo
[not found] ` <1320801583-12774-2-git-send-email-grant.likely@secretlab.ca>
2011-12-21 10:22 ` [RFC 1/8] gpio/microblaze: Eliminate duplication of of_get_named_gpio_flags() Michal Simek
2012-01-04 18:30 ` Grant Likely
2012-01-05 7:28 ` Michal Simek
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=CACxGe6tHF7K4y9FqUxYraK0pgRRtN671-pp3Z88SEj4nStQiCg@mail.gmail.com \
--to=grant.likely@secretlab.ca \
--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).