devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: James Liao <jamesjj.liao@mediatek.com>
To: Daniel Kurtz <djkurtz@chromium.org>
Cc: Matthias Brugger <matthias.bgg@gmail.com>,
	Mike Turquette <mturquette@linaro.org>,
	Stephen Boyd <sboyd@codeaurora.org>,
	srv_heupstream <srv_heupstream@mediatek.com>,
	Ricky Liang <jcliang@chromium.org>,
	Rob Herring <robh+dt@kernel.org>,
	Sascha Hauer <kernel@pengutronix.de>,
	"open list:OPEN FIRMWARE AND..." <devicetree@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	linux-mediatek@lists.infradead.org
Subject: Re: [PATCH v2 3/4] clk: mediatek: Add subsystem clocks of MT8173
Date: Fri, 3 Jul 2015 13:15:31 +0800	[thread overview]
Message-ID: <1435900531.3526.41.camel@mtksdaap41> (raw)
In-Reply-To: <CAGS+omDJtTcVvcL925LFxUSeunWONp188OOP-H42uQ=6BaY9FQ@mail.gmail.com>

On Wed, 2015-07-01 at 22:54 +0800, Daniel Kurtz wrote:
> On Tue, Jun 30, 2015 at 10:58 AM, James Liao <jamesjj.liao@mediatek.com> wrote:
> >
> > +static struct mtk_gate_regs cg_regs_4_8_0 = {
> 
> These should all be:
> 
> static const struct mtk_gate_regs ...

OK, I'll fix it.

> > +       .set_ofs = 0x0004,
> > +       .clr_ofs = 0x0008,
> > +       .sta_ofs = 0x0000,
> > +};
> > +
> > +#define GATE_IMG(_id, _name, _parent, _shift) {                        \
> > +               .id = _id,                                      \
> > +               .name = _name,                                  \
> > +               .parent_name = _parent,                         \
> > +               .regs = &cg_regs_4_8_0,                         \
> > +               .shift = _shift,                                \
> > +               .ops = &mtk_clk_gate_ops_setclr,                \
> > +       }
> > +
> > +static struct mtk_gate img_clks[] __initdata = {
> 
> These should all be:
> 
> static const ... __initconst = {

OK, I'll fix it.

> > +
> > +static void __init mtk_imgsys_init(struct device_node *node)
> > +{
> > +       struct clk_onecell_data *clk_data;
> > +       void __iomem *base;
> 
> I don't think you need base for any of these.
> mtk_clk_register_gates() will use syscon_node_to_regmap() to lookup
> the regmap by itself.

OK, I'll remove it.

> > +       int r;
> > +
> > +       base = of_iomap(node, 0);
> > +       if (!base) {
> > +               pr_err("%s(): ioremap failed\n", __func__);
> > +               return;
> > +       }
> > +
> > +       clk_data = mtk_alloc_clk_data(CLK_IMG_NR_CLK);
> 
> Unrelated to this patch, but:
> I think each clock node should statically declare its
> clk_onecell_data, and pass it to mtk_alloc_clk_data().
> mtk_alloc_clk_data() should then just allocate and initialize the clks array.

Is there any different from allocating clk_onecell_data and clks arary
dynamically?


> >  /* APMIXED_SYS */
> >
> > -#define CLK_APMIXED_ARMCA15PLL 1
> > -#define CLK_APMIXED_ARMCA7PLL  2
> > +#define CLK_APMIXED_ARMCA15PLL         1
> > +#define CLK_APMIXED_ARMCA7PLL          2
> >  #define CLK_APMIXED_MAINPLL            3
> >  #define CLK_APMIXED_UNIVPLL            4
> >  #define CLK_APMIXED_MMPLL              5
> > @@ -232,4 +232,91 @@
> >  #define CLK_PERI_UART3_SEL             39
> >  #define CLK_PERI_NR_CLK                        40
> 
> Why do we count up from 1 instead of 0?
> This means that for each clock-controller:
>   clk_onecell_data->clk[0] == ERR_PTR(-ENOENT)

It's a legacy implementation. I think it doesn't matter for function or
size in this implementation. We may change clock index to start from 0
in next SoC clock implementation.


Best regards,

James

  reply	other threads:[~2015-07-03  5:15 UTC|newest]

Thread overview: 25+ 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
     [not found] ` <1435633127-31952-1-git-send-email-jamesjj.liao-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2015-06-30  2:58   ` [PATCH v2 1/4] clk: mediatek: mt8173: Fix enabling of critical clocks James Liao
     [not found]     ` <1435633127-31952-2-git-send-email-jamesjj.liao-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2015-07-01 14:21       ` Daniel Kurtz
     [not found]         ` <CAGS+omDqSEn_WnUYz0XmeRpejhthb0J_qa4H9VEfihtA0Axorg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-07-02  2:07           ` Daniel Kurtz
2015-07-02  2:18           ` James Liao
2015-07-02 23:03       ` Stephen Boyd
     [not found]         ` <20150702230300.GO4301-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2015-07-03  6:29           ` Daniel Kurtz
     [not found]             ` <CAGS+omCwxLNha7EJ2nZ1++E-D5G1d-oRmh1C=m3OQWtbX0SH4w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-07-06 22:52               ` Stephen Boyd
2015-06-30  2:58   ` [PATCH v2 3/4] clk: mediatek: Add subsystem clocks of MT8173 James Liao
     [not found]     ` <1435633127-31952-4-git-send-email-jamesjj.liao-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2015-07-01 14:54       ` Daniel Kurtz
2015-07-03  5:15         ` James Liao [this message]
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
2015-07-01 15:22     ` Daniel Kurtz
2015-07-01 15:22       ` Daniel Kurtz
     [not found]         ` <CAGS+omBsu3zkBf0C_QECBP7NShFhkMih36z1vynvVQ5wCLfZ8w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-07-03  5:38           ` James Liao
2015-07-03  6:28             ` Daniel Kurtz
2015-06-30  2:58 ` [PATCH v2 2/4] dt-bindings: ARM: Mediatek: Document devicetree bindings for clock controllers James Liao
     [not found]   ` <1435633127-31952-3-git-send-email-jamesjj.liao-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2015-07-01 13:47     ` Daniel Kurtz
     [not found]       ` <CAGS+omD9Mvz0-RQMc5TsWCPct80S5fyqMn3+-zR7HB9yb7KoDQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-07-02  2:52         ` James Liao
2015-07-02  4:26           ` Daniel Kurtz
     [not found]             ` <CAGS+omCgNstb+NPmRdbngnLm754hDPLO28KRc4RanCD2Myv7dQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-07-02 23:40               ` Stephen Boyd
     [not found]                 ` <5595CBDC.7090101-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2015-07-03 10:46                   ` Daniel Kurtz
2015-07-07  6:56                     ` James Liao
2015-07-01 16:03   ` Rob Herring

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=1435900531.3526.41.camel@mtksdaap41 \
    --to=jamesjj.liao@mediatek.com \
    --cc=devicetree@vger.kernel.org \
    --cc=djkurtz@chromium.org \
    --cc=jcliang@chromium.org \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=mturquette@linaro.org \
    --cc=robh+dt@kernel.org \
    --cc=sboyd@codeaurora.org \
    --cc=srv_heupstream@mediatek.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 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).