All of lore.kernel.org
 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@baylibre.com>,
	Stephen Boyd <sboyd@codeaurora.org>,
	"Heiko Stubner" <heiko@sntech.de>,
	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 v4 6/7] clk: mediatek: Add USB clock support in MT8173 APMIXEDSYS
Date: Tue, 28 Jul 2015 12:05:55 +0800	[thread overview]
Message-ID: <1438056355.17770.9.camel@mtksdaap41> (raw)
In-Reply-To: <CAGS+omA0PPThRKEV=Xy3VkS+ifg55oy+gi_d5Sr+TQJorh8a0g@mail.gmail.com>

Hi Daniel,

On Fri, 2015-07-24 at 19:28 +0800, Daniel Kurtz wrote:
> On Fri, Jul 24, 2015 at 11:02 AM, James Liao <jamesjj.liao@mediatek.com> wrote:
> > +struct clk *mtk_clk_register_ref2usb_tx(const char *name,
> > +                       const char *parent_name, void __iomem *reg)
> 
> struct clk * __init mtk_clk_register_ref2usb_tx(

It will be added in next patch.

> >
> >  #include <linux/of.h>
> >  #include <linux/of_address.h>
> > -#include <linux/slab.h>
> > -#include <linux/mfd/syscon.h>
> 
> nit: this looks like an unrelated change that can be in its own patch.

It will be in a separated patch.

> >
> > +typedef struct clk *(*mtk_clk_register_ex)(const char *, const char *,
> > +                                       void __iomem *);
> > +
> > +struct mtk_clk_ex {
> > +       int id;
> > +       const char *name;
> > +       const char *parent;
> > +       u32 reg_ofs;
> > +       mtk_clk_register_ex reg_clk_ex;
> 
> 
> This "mtk_clk_ex" abstraction seems unnecessarily complicated for a
> one-off USB clock.
> Just call mtk_clk_register_ref2usb_tx() directly from mtk_apmixedsys_init().

Use a table to associate related constants and names is more readable,
such as:

  APMIXED_EX(CLK_APMIXED_REF2USB_TX, "ref2usb_tx", ... 

If we call mtk_clk_register_ref2usb_tx() directly, it will be:

  clk = mtk_clk_register_ref2usb_tx("ref2usb_tx", ...);
  clk_data-clks[CLK_APMIXED_REF2USB_TX] = clk;

Do you prefer the last one?


Best regards,

James


WARNING: multiple messages have this Message-ID (diff)
From: James Liao <jamesjj.liao@mediatek.com>
To: Daniel Kurtz <djkurtz@chromium.org>
Cc: Matthias Brugger <matthias.bgg@gmail.com>,
	Mike Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@codeaurora.org>,
	Heiko Stubner <heiko@sntech.de>,
	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 v4 6/7] clk: mediatek: Add USB clock support in MT8173 APMIXEDSYS
Date: Tue, 28 Jul 2015 12:05:55 +0800	[thread overview]
Message-ID: <1438056355.17770.9.camel@mtksdaap41> (raw)
In-Reply-To: <CAGS+omA0PPThRKEV=Xy3VkS+ifg55oy+gi_d5Sr+TQJorh8a0g@mail.gmail.com>

Hi Daniel,

On Fri, 2015-07-24 at 19:28 +0800, Daniel Kurtz wrote:
> On Fri, Jul 24, 2015 at 11:02 AM, James Liao <jamesjj.liao@mediatek.com> wrote:
> > +struct clk *mtk_clk_register_ref2usb_tx(const char *name,
> > +                       const char *parent_name, void __iomem *reg)
> 
> struct clk * __init mtk_clk_register_ref2usb_tx(

It will be added in next patch.

> >
> >  #include <linux/of.h>
> >  #include <linux/of_address.h>
> > -#include <linux/slab.h>
> > -#include <linux/mfd/syscon.h>
> 
> nit: this looks like an unrelated change that can be in its own patch.

It will be in a separated patch.

> >
> > +typedef struct clk *(*mtk_clk_register_ex)(const char *, const char *,
> > +                                       void __iomem *);
> > +
> > +struct mtk_clk_ex {
> > +       int id;
> > +       const char *name;
> > +       const char *parent;
> > +       u32 reg_ofs;
> > +       mtk_clk_register_ex reg_clk_ex;
> 
> 
> This "mtk_clk_ex" abstraction seems unnecessarily complicated for a
> one-off USB clock.
> Just call mtk_clk_register_ref2usb_tx() directly from mtk_apmixedsys_init().

Use a table to associate related constants and names is more readable,
such as:

  APMIXED_EX(CLK_APMIXED_REF2USB_TX, "ref2usb_tx", ... 

If we call mtk_clk_register_ref2usb_tx() directly, it will be:

  clk = mtk_clk_register_ref2usb_tx("ref2usb_tx", ...);
  clk_data-clks[CLK_APMIXED_REF2USB_TX] = clk;

Do you prefer the last one?


Best regards,

James

WARNING: multiple messages have this Message-ID (diff)
From: jamesjj.liao@mediatek.com (James Liao)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 6/7] clk: mediatek: Add USB clock support in MT8173 APMIXEDSYS
Date: Tue, 28 Jul 2015 12:05:55 +0800	[thread overview]
Message-ID: <1438056355.17770.9.camel@mtksdaap41> (raw)
In-Reply-To: <CAGS+omA0PPThRKEV=Xy3VkS+ifg55oy+gi_d5Sr+TQJorh8a0g@mail.gmail.com>

Hi Daniel,

On Fri, 2015-07-24 at 19:28 +0800, Daniel Kurtz wrote:
> On Fri, Jul 24, 2015 at 11:02 AM, James Liao <jamesjj.liao@mediatek.com> wrote:
> > +struct clk *mtk_clk_register_ref2usb_tx(const char *name,
> > +                       const char *parent_name, void __iomem *reg)
> 
> struct clk * __init mtk_clk_register_ref2usb_tx(

It will be added in next patch.

> >
> >  #include <linux/of.h>
> >  #include <linux/of_address.h>
> > -#include <linux/slab.h>
> > -#include <linux/mfd/syscon.h>
> 
> nit: this looks like an unrelated change that can be in its own patch.

It will be in a separated patch.

> >
> > +typedef struct clk *(*mtk_clk_register_ex)(const char *, const char *,
> > +                                       void __iomem *);
> > +
> > +struct mtk_clk_ex {
> > +       int id;
> > +       const char *name;
> > +       const char *parent;
> > +       u32 reg_ofs;
> > +       mtk_clk_register_ex reg_clk_ex;
> 
> 
> This "mtk_clk_ex" abstraction seems unnecessarily complicated for a
> one-off USB clock.
> Just call mtk_clk_register_ref2usb_tx() directly from mtk_apmixedsys_init().

Use a table to associate related constants and names is more readable,
such as:

  APMIXED_EX(CLK_APMIXED_REF2USB_TX, "ref2usb_tx", ... 

If we call mtk_clk_register_ref2usb_tx() directly, it will be:

  clk = mtk_clk_register_ref2usb_tx("ref2usb_tx", ...);
  clk_data-clks[CLK_APMIXED_REF2USB_TX] = clk;

Do you prefer the last one?


Best regards,

James

  reply	other threads:[~2015-07-28  4:06 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-24  3:01 [PATCH v4 0/7] Add Mediatek MT8173 subsystem clocks support James Liao
2015-07-24  3:01 ` James Liao
2015-07-24  3:01 ` James Liao
2015-07-24  3:01 ` [PATCH v4 1/7] clk: mediatek: Add fixed clocks support for Mediatek SoC James Liao
2015-07-24  3:01   ` James Liao
2015-07-24  3:01   ` James Liao
2015-07-24 11:33   ` Daniel Kurtz
2015-07-24 11:33     ` Daniel Kurtz
2015-07-24 11:33     ` Daniel Kurtz
2015-07-28  5:10     ` James Liao
2015-07-28  5:10       ` James Liao
2015-07-28  5:10       ` James Liao
2015-07-24  3:02 ` [PATCH v4 2/7] clk: mediatek: Fix rate and dependency of MT8173 clocks James Liao
2015-07-24  3:02   ` James Liao
2015-07-24  3:02   ` James Liao
2015-07-24 11:10   ` Daniel Kurtz
2015-07-24 11:10     ` Daniel Kurtz
2015-07-24 11:10     ` Daniel Kurtz
2015-07-27  5:52     ` Sascha Hauer
2015-07-27  5:52       ` Sascha Hauer
2015-07-27  5:52       ` Sascha Hauer
2015-07-27  6:19       ` Daniel Kurtz
2015-07-27  7:52         ` Heiko Stübner
2015-07-27  7:52           ` Heiko Stübner
2015-07-27  7:52           ` Heiko Stübner
2015-07-28  5:19           ` James Liao
2015-07-28  5:19             ` James Liao
2015-07-28  5:19             ` James Liao
2015-07-24  3:02 ` [PATCH v4 3/7] clk: mediatek: mt8173: Fix enabling of critical clocks James Liao
2015-07-24  3:02   ` James Liao
2015-07-24  3:02   ` James Liao
2015-07-24  3:02 ` [PATCH v4 4/7] dt-bindings: ARM: Mediatek: Document devicetree bindings for clock controllers James Liao
2015-07-24  3:02   ` James Liao
2015-07-24  3:02   ` James Liao
2015-07-24  3:02 ` [PATCH v4 5/7] clk: mediatek: Add subsystem clocks of MT8173 James Liao
2015-07-24  3:02   ` James Liao
2015-07-24  3:02   ` James Liao
2015-07-24 11:18   ` Daniel Kurtz
2015-07-24 11:18     ` Daniel Kurtz
2015-07-24 11:18     ` Daniel Kurtz
2015-07-28  2:14     ` James Liao
2015-07-28  2:14       ` James Liao
2015-07-28  2:14       ` James Liao
2015-07-24  3:02 ` [PATCH v4 6/7] clk: mediatek: Add USB clock support in MT8173 APMIXEDSYS James Liao
2015-07-24  3:02   ` James Liao
2015-07-24  3:02   ` James Liao
2015-07-24 11:28   ` Daniel Kurtz
2015-07-24 11:28     ` Daniel Kurtz
2015-07-24 11:28     ` Daniel Kurtz
2015-07-28  4:05     ` James Liao [this message]
2015-07-28  4:05       ` James Liao
2015-07-28  4:05       ` James Liao
2015-07-24  3:02 ` [PATCH v4 7/7] arm64: dts: mt8173: Add subsystem clock controller device nodes James Liao
2015-07-24  3:02   ` James Liao
2015-07-24  3:02   ` James Liao
2015-07-24 11:32   ` Daniel Kurtz
2015-07-24 11:32     ` Daniel Kurtz
2015-07-24 11:32     ` Daniel Kurtz
2015-07-27  2:56     ` James Liao
2015-07-27  2:56       ` James Liao
2015-07-27  2:56       ` James Liao
2015-07-27  5:34       ` Daniel Kurtz
2015-07-27 10:21       ` Matthias Brugger
2015-07-27 10:21         ` Matthias Brugger
2015-07-27 10:21         ` Matthias Brugger
2015-07-28  5:29         ` James Liao
2015-07-28  5:29           ` James Liao
2015-07-28  5:29           ` James Liao

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=1438056355.17770.9.camel@mtksdaap41 \
    --to=jamesjj.liao@mediatek.com \
    --cc=devicetree@vger.kernel.org \
    --cc=djkurtz@chromium.org \
    --cc=heiko@sntech.de \
    --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@baylibre.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.