linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: djkurtz@chromium.org (Daniel Kurtz)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 2/4] dt-bindings: ARM: Mediatek: Document devicetree bindings for clock controllers
Date: Thu, 2 Jul 2015 12:26:45 +0800	[thread overview]
Message-ID: <CAGS+omCgNstb+NPmRdbngnLm754hDPLO28KRc4RanCD2Myv7dQ@mail.gmail.com> (raw)
In-Reply-To: <1435805534.3526.23.camel@mtksdaap41>

On Thu, Jul 2, 2015 at 10:52 AM, James Liao <jamesjj.liao@mediatek.com> wrote:
> Hi Daniel,
>
>> > +Required Properties:
>> > +
>> > +- compatible: Should be:
>> > +       - "mediatek,mt8173-imgsys", "syscon"
>> > +- #clock-cells: Must be 1
>> > +
>> > +The imgsys controller uses the common clk binding from
>> > +Documentation/devicetree/bindings/clock/clock-bindings.txt
>> > +The available clocks are defined in dt-bindings/clock/mt*-clk.h.
>> > +
>> > +Example:
>> > +
>> > +imgsys: imgsys at 15000000 {
>>
>> Since these nodes will be supplying clocks to the rest of the system,
>> I think the "name" part of each of these should all be
>> "clock-controller", like topckgen and apmixedsys:
>>
>>   imgsys: clock-controller at 15000000 {
>
> These subsystems (and topckgen also) also contains other functions such
> as reset controller, which may be implemented in clk/mediatek/ in the
> future. It is suitable to use "clock-controller" as their name?

Hmm,

I don't know the "right way" to do this either.
Pardon me if you've already had these discussions.
I only recently started looking at these clock nodes in detail :-).

I think what we really have in register space is a "syscon", as
described in [0]:
[0] Documentation/devicetree/bindings/mfd/syscon.txt

So, we can define this block of registers as a syscon:

mmsys_syscon: syscon at 14000000 {
       compatible = "mediatek,mt8173-mmsys", "syscon";
       reg = <0 0x14000000 0 0x1000>;
};


Then for the clock controller functionality, we create a node with a
"clock-controller" name and a "-clock" compatible, like this:

mmsys_clock: clock-controller {
       compatible = "mediatek,mt8173-mmsys-clock";
       #clock-cells = <1>;
       mediatek,syscon = <&mmsys_syscon>;
};

You could then do:
CLK_OF_DECLARE(mtk_mmsys, "mediatek,mt8173-mmsys-clock", mtk_mmsys_init);


If you want to reuse the same register range for some other
functionality, we could then use a different node, with a different
compatible:

mmsys: reset-controller {
       compatible = "mediatek,mt8173-mmsys-reset";
       mediatek,syscon = <&mmsys_syscon>;
};

What do you think of this approach?

Thanks!
-Dan

  reply	other threads:[~2015-07-02  4:26 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-30  2:58 [PATCH v2 0/4] Add Mediatek MT8173 subsystem clocks support James Liao
2015-06-30  2:58 ` [PATCH v2 1/4] clk: mediatek: mt8173: Fix enabling of critical clocks James Liao
2015-07-01 14:21   ` Daniel Kurtz
2015-07-02  2:07     ` Daniel Kurtz
2015-07-02  2:18     ` James Liao
2015-07-02 23:03   ` Stephen Boyd
2015-07-03  6:29     ` Daniel Kurtz
2015-07-06 22:52       ` Stephen Boyd
2015-06-30  2:58 ` [PATCH v2 2/4] dt-bindings: ARM: Mediatek: Document devicetree bindings for clock controllers James Liao
2015-07-01 13:47   ` Daniel Kurtz
2015-07-02  2:52     ` James Liao
2015-07-02  4:26       ` Daniel Kurtz [this message]
2015-07-02 23:40         ` Stephen Boyd
2015-07-03 10:46           ` Daniel Kurtz
2015-07-07  6:56             ` James Liao
2015-07-01 16:03   ` Rob Herring
2015-06-30  2:58 ` [PATCH v2 3/4] clk: mediatek: Add subsystem clocks of MT8173 James Liao
2015-07-01 14:54   ` Daniel Kurtz
2015-07-03  5:15     ` James Liao
2015-07-03  6:08       ` Daniel Kurtz
2015-06-30  2:58 ` [PATCH v2 4/4] clk: mediatek: Add USB clock support in MT8173 APMIXEDSYS James Liao
     [not found]   ` <CAGS+omBRAJVN3uPYn9YdKZ3VBj61c-rpY_cNgnK6x9U0uJBPYw@mail.gmail.com>
2015-07-01 15:22     ` Daniel Kurtz
2015-07-03  5:38       ` James Liao
2015-07-03  6:28         ` Daniel Kurtz

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=CAGS+omCgNstb+NPmRdbngnLm754hDPLO28KRc4RanCD2Myv7dQ@mail.gmail.com \
    --to=djkurtz@chromium.org \
    --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).