All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Brandt <Chris.Brandt@renesas.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>,
	Simon Horman <horms+renesas@verge.net.au>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@codeaurora.org>,
	linux-clk <linux-clk@vger.kernel.org>,
	Linux-Renesas <linux-renesas-soc@vger.kernel.org>
Subject: RE: [PATCH v3] clk: renesas: rz: Select EXTAL vs USB clock
Date: Thu, 1 Sep 2016 19:41:22 +0000	[thread overview]
Message-ID: <SG2PR06MB1165E96781DE628E27DCF7AE8AE20@SG2PR06MB1165.apcprd06.prod.outlook.com> (raw)
In-Reply-To: <CAMuHMdXd8WxTtpiQ5rujKKVP04oEriF62K9d3iTh1zVakVtTog@mail.gmail.com>

Hi Geert,

On 9/1/2016, Geert Uytterhoeven wrote:
> > +#define MD_BOOT0(x) ((x >> 0) & 1)     /* P0_0 */
> > +#define MD_BOOT1(x) ((x >> 1) & 1)     /* P0_1 */
> > +#define MD_CLK(x)   ((x >> 2) & 1)     /* P0_2 */
>
> Good idea to use a macro for that!
> However, adding more (unused) macros may trigger more questions
> from reviewers, cfr. below ;-)

OK, I can pull the other ones out. I'm OK with that.


> > +#define MD_CLKS(x)  ((x >> 3) & 1)     /* P0_3 */
> > +
> >  /* -----------------------------------------------------------------------------
> >   * Initialization
> >   */
> >
> > +u16 rz_cpg_read_mode_pins(void)
>
> static u16 __init rz_cpg_read_mode_pins(void)
>
> Or do you intend to make this a global function?

Ooops. I'll make it static.



> There's also MD_BOOT2 at P7_0. To read that, you have to map and read
> a different set of registers, though...

Good point. So...going back to your first comment, there is no reason for making macros or discussing mode pins that you have no plan on dealing with.


> >         if (strcmp(name, "pll") == 0) {
> > -               /* FIXME: cpg_mode should be read from GPIO. But no GPIO support yet */
> > -               unsigned cpg_mode = 0; /* hardcoded to EXTAL for now */
>
> I'd just assign "MD_CLK(rz_cpg_read_mode_pins())" to cpg_mode here...
>
> > -               const char *parent_name = of_clk_get_parent_name(np, cpg_mode);
> > +               unsigned int cpg_mode;
> > +               const char *parent_name;
> >
> > +               cpg_mode = MD_CLK(rz_cpg_read_mode_pins());
> > +               parent_name = of_clk_get_parent_name(np, cpg_mode);
>
>... and not bother splitting the lines, as they don't break the 80-chars-per-line limit.

But I get paid per line of code!!!   (just kidding)
I'll make the changes and resend.


Thanks for your review!


Chris

WARNING: multiple messages have this Message-ID (diff)
From: Chris Brandt <Chris.Brandt@renesas.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>,
	Simon Horman <horms+renesas@verge.net.au>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@codeaurora.org>,
	linux-clk <linux-clk@vger.kernel.org>,
	Linux-Renesas <linux-renesas-soc@vger.kernel.org>
Subject: RE: [PATCH v3] clk: renesas: rz: Select EXTAL vs USB clock
Date: Thu, 1 Sep 2016 19:41:22 +0000	[thread overview]
Message-ID: <SG2PR06MB1165E96781DE628E27DCF7AE8AE20@SG2PR06MB1165.apcprd06.prod.outlook.com> (raw)
In-Reply-To: <CAMuHMdXd8WxTtpiQ5rujKKVP04oEriF62K9d3iTh1zVakVtTog@mail.gmail.com>

SGkgR2VlcnQsDQoNCk9uIDkvMS8yMDE2LCBHZWVydCBVeXR0ZXJob2V2ZW4gd3JvdGU6DQo+ID4g
KyNkZWZpbmUgTURfQk9PVDAoeCkgKCh4ID4+IDApICYgMSkgICAgIC8qIFAwXzAgKi8NCj4gPiAr
I2RlZmluZSBNRF9CT09UMSh4KSAoKHggPj4gMSkgJiAxKSAgICAgLyogUDBfMSAqLw0KPiA+ICsj
ZGVmaW5lIE1EX0NMSyh4KSAgICgoeCA+PiAyKSAmIDEpICAgICAvKiBQMF8yICovDQo+DQo+IEdv
b2QgaWRlYSB0byB1c2UgYSBtYWNybyBmb3IgdGhhdCENCj4gSG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lc2VuZC4NCg0KDQpUaGFua3MgZm9yIHlv
dXIgcmV2aWV3IQ0KDQoNCkNocmlzDQo=

  reply	other threads:[~2016-09-01 21:28 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-25 19:05 [PATCH] clk: renesas: rz: Select EXTAL vs USB clock Chris Brandt
2016-08-29 13:18 ` Geert Uytterhoeven
2016-08-29 14:53   ` Chris Brandt
2016-08-29 14:53     ` Chris Brandt
2016-08-29 15:13     ` Geert Uytterhoeven
2016-08-29 15:32       ` Chris Brandt
2016-08-29 15:32         ` Chris Brandt
2016-08-29 15:41         ` Geert Uytterhoeven
2016-08-29 16:04           ` Chris Brandt
2016-08-29 16:04             ` Chris Brandt
2016-08-29 18:39 ` Sergei Shtylyov
2016-08-29 18:41   ` Geert Uytterhoeven
2016-08-30  3:13 ` [PATCH v2] " Chris Brandt
2016-08-30  7:04   ` Simon Horman
2016-08-30  7:06     ` Simon Horman
2016-08-30  7:23   ` Geert Uytterhoeven
2016-08-30 13:31     ` Chris Brandt
2016-08-30 13:31       ` Chris Brandt
2016-09-01 13:10   ` [PATCH v3] " Chris Brandt
2016-09-01 19:21     ` Geert Uytterhoeven
2016-09-01 19:41       ` Chris Brandt [this message]
2016-09-01 19:41         ` Chris Brandt
2016-09-02  2:32     ` [PATCH v4] " Chris Brandt
2016-09-02  8:19       ` Geert Uytterhoeven

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=SG2PR06MB1165E96781DE628E27DCF7AE8AE20@SG2PR06MB1165.apcprd06.prod.outlook.com \
    --to=chris.brandt@renesas.com \
    --cc=geert@linux-m68k.org \
    --cc=horms+renesas@verge.net.au \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=sboyd@codeaurora.org \
    --cc=sergei.shtylyov@cogentembedded.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.