From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 3/3] clk: shmobile: Add R8A7790 clocks support
Date: Wed, 06 Nov 2013 01:00:28 +0000 [thread overview]
Message-ID: <2775658.fxp7sbhy9u@avalon> (raw)
In-Reply-To: <874n7q1ha3.wl%kuninori.morimoto.gx@renesas.com>
Hi Morimoto-san,
On Tuesday 05 November 2013 16:54:31 Kuninori Morimoto wrote:
> Hi Laurent
>
> > > > + for (i = 0; i < CPG_NUM_CLOCKS; ++i) {
> > > > + const struct clk_div_table *table = NULL;
> > > > + const char *parent_name = "main";
> > > > + const char *name;
> > > > + unsigned int shift;
> > > > + unsigned int mult = 1;
> > > > + unsigned int div = 1;
> > > > + struct clk *clk;
> > > > +
> > > > + of_property_read_string_index(np, "clock-output-names", i,
> > > > + &name);
> > > > +
> > > > + switch (i) {
> > > > + case R8A7790_CLK_MAIN:
> > > > + parent_name = of_clk_get_parent_name(np, 0);
> > > > + div = config->extal_div;
> > > > + break;
> > > > + case R8A7790_CLK_PLL1:
> > > > + mult = config->pll1_mult / 2;
> > > > + break;
> > > > + case R8A7790_CLK_PLL3:
> > > > + mult = config->pll3_mult;
> > > > + break;
> > > > + case R8A7790_CLK_LB:
> > > > + div = cpg_mode & BIT(18) ? 36 : 24;
> > > > + break;
> > > > + case R8A7790_CLK_QSPI:
> > > > + div = (cpg_mode & (BIT(3) | BIT(2) | BIT(1))) = BIT(2)
> > > > + ? 16 : 20;
> > > > + break;
> > > > + case R8A7790_CLK_SDH:
> > > > + table = cpg_sdh_div_table;
> > > > + shift = 8;
> > > > + break;
> > > > + case R8A7790_CLK_SD0:
> > > > + table = cpg_sd01_div_table;
> > > > + shift = 4;
> > > > + break;
> > > > + case R8A7790_CLK_SD1:
> > > > + table = cpg_sd01_div_table;
> > > > + shift = 0;
> > > > + break;
> > > > + }
> > >
> > > Is this clock-output-names realy "Required" property ?
> > > The "name" and "order" seem fixed, then,
> > > I guess it can simply use "name array" ?
> >
> > The clock-output-names property is required by the
> > of_clk_get_parent_name()
> > function. The property is mandatory for all clocks that need to be
> > referenced by name, which is the case of all non-leaf clocks on our
> > platforms. We thus need it.
>
> Please correct me if my understanding was wrong.
> Does your "of_clk_get_parent_name()" means "case R8A7790_CLK_MAIN"'s one ?
> If Yes, it is needed on "parent" clock side, not here ?
> If No, who need/call of_clk_get_parent_name() for this ?
> does "qspi", "sdh", "sd0", "sd1" can be parent clock for some device ??
All those clocks are parents of other clocks (DIV6, MSTP or fixed-factor
clocks). The DIV6, MSTP and fixed-factor clock drivers call
of_clk_get_parent_name() to get the name of their parent clock, which is
required to register the clocks with CCF. See of_fixed_factor_clk_setup() for
instance.
> And, parent of main clock is fixed by MD pin settings.
> SW can't exchange it.
--
Regards,
Laurent Pinchart
WARNING: multiple messages have this Message-ID (diff)
From: laurent.pinchart@ideasonboard.com (Laurent Pinchart)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/3] clk: shmobile: Add R8A7790 clocks support
Date: Wed, 06 Nov 2013 02:00:28 +0100 [thread overview]
Message-ID: <2775658.fxp7sbhy9u@avalon> (raw)
In-Reply-To: <874n7q1ha3.wl%kuninori.morimoto.gx@renesas.com>
Hi Morimoto-san,
On Tuesday 05 November 2013 16:54:31 Kuninori Morimoto wrote:
> Hi Laurent
>
> > > > + for (i = 0; i < CPG_NUM_CLOCKS; ++i) {
> > > > + const struct clk_div_table *table = NULL;
> > > > + const char *parent_name = "main";
> > > > + const char *name;
> > > > + unsigned int shift;
> > > > + unsigned int mult = 1;
> > > > + unsigned int div = 1;
> > > > + struct clk *clk;
> > > > +
> > > > + of_property_read_string_index(np, "clock-output-names", i,
> > > > + &name);
> > > > +
> > > > + switch (i) {
> > > > + case R8A7790_CLK_MAIN:
> > > > + parent_name = of_clk_get_parent_name(np, 0);
> > > > + div = config->extal_div;
> > > > + break;
> > > > + case R8A7790_CLK_PLL1:
> > > > + mult = config->pll1_mult / 2;
> > > > + break;
> > > > + case R8A7790_CLK_PLL3:
> > > > + mult = config->pll3_mult;
> > > > + break;
> > > > + case R8A7790_CLK_LB:
> > > > + div = cpg_mode & BIT(18) ? 36 : 24;
> > > > + break;
> > > > + case R8A7790_CLK_QSPI:
> > > > + div = (cpg_mode & (BIT(3) | BIT(2) | BIT(1))) == BIT(2)
> > > > + ? 16 : 20;
> > > > + break;
> > > > + case R8A7790_CLK_SDH:
> > > > + table = cpg_sdh_div_table;
> > > > + shift = 8;
> > > > + break;
> > > > + case R8A7790_CLK_SD0:
> > > > + table = cpg_sd01_div_table;
> > > > + shift = 4;
> > > > + break;
> > > > + case R8A7790_CLK_SD1:
> > > > + table = cpg_sd01_div_table;
> > > > + shift = 0;
> > > > + break;
> > > > + }
> > >
> > > Is this clock-output-names realy "Required" property ?
> > > The "name" and "order" seem fixed, then,
> > > I guess it can simply use "name array" ?
> >
> > The clock-output-names property is required by the
> > of_clk_get_parent_name()
> > function. The property is mandatory for all clocks that need to be
> > referenced by name, which is the case of all non-leaf clocks on our
> > platforms. We thus need it.
>
> Please correct me if my understanding was wrong.
> Does your "of_clk_get_parent_name()" means "case R8A7790_CLK_MAIN"'s one ?
> If Yes, it is needed on "parent" clock side, not here ?
> If No, who need/call of_clk_get_parent_name() for this ?
> does "qspi", "sdh", "sd0", "sd1" can be parent clock for some device ??
All those clocks are parents of other clocks (DIV6, MSTP or fixed-factor
clocks). The DIV6, MSTP and fixed-factor clock drivers call
of_clk_get_parent_name() to get the name of their parent clock, which is
required to register the clocks with CCF. See of_fixed_factor_clk_setup() for
instance.
> And, parent of main clock is fixed by MD pin settings.
> SW can't exchange it.
--
Regards,
Laurent Pinchart
WARNING: multiple messages have this Message-ID (diff)
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
linux-sh@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
devicetree@vger.kernel.org,
Mike Turquette <mturquette@linaro.org>
Subject: Re: [PATCH 3/3] clk: shmobile: Add R8A7790 clocks support
Date: Wed, 06 Nov 2013 02:00:28 +0100 [thread overview]
Message-ID: <2775658.fxp7sbhy9u@avalon> (raw)
In-Reply-To: <874n7q1ha3.wl%kuninori.morimoto.gx@renesas.com>
Hi Morimoto-san,
On Tuesday 05 November 2013 16:54:31 Kuninori Morimoto wrote:
> Hi Laurent
>
> > > > + for (i = 0; i < CPG_NUM_CLOCKS; ++i) {
> > > > + const struct clk_div_table *table = NULL;
> > > > + const char *parent_name = "main";
> > > > + const char *name;
> > > > + unsigned int shift;
> > > > + unsigned int mult = 1;
> > > > + unsigned int div = 1;
> > > > + struct clk *clk;
> > > > +
> > > > + of_property_read_string_index(np, "clock-output-names", i,
> > > > + &name);
> > > > +
> > > > + switch (i) {
> > > > + case R8A7790_CLK_MAIN:
> > > > + parent_name = of_clk_get_parent_name(np, 0);
> > > > + div = config->extal_div;
> > > > + break;
> > > > + case R8A7790_CLK_PLL1:
> > > > + mult = config->pll1_mult / 2;
> > > > + break;
> > > > + case R8A7790_CLK_PLL3:
> > > > + mult = config->pll3_mult;
> > > > + break;
> > > > + case R8A7790_CLK_LB:
> > > > + div = cpg_mode & BIT(18) ? 36 : 24;
> > > > + break;
> > > > + case R8A7790_CLK_QSPI:
> > > > + div = (cpg_mode & (BIT(3) | BIT(2) | BIT(1))) == BIT(2)
> > > > + ? 16 : 20;
> > > > + break;
> > > > + case R8A7790_CLK_SDH:
> > > > + table = cpg_sdh_div_table;
> > > > + shift = 8;
> > > > + break;
> > > > + case R8A7790_CLK_SD0:
> > > > + table = cpg_sd01_div_table;
> > > > + shift = 4;
> > > > + break;
> > > > + case R8A7790_CLK_SD1:
> > > > + table = cpg_sd01_div_table;
> > > > + shift = 0;
> > > > + break;
> > > > + }
> > >
> > > Is this clock-output-names realy "Required" property ?
> > > The "name" and "order" seem fixed, then,
> > > I guess it can simply use "name array" ?
> >
> > The clock-output-names property is required by the
> > of_clk_get_parent_name()
> > function. The property is mandatory for all clocks that need to be
> > referenced by name, which is the case of all non-leaf clocks on our
> > platforms. We thus need it.
>
> Please correct me if my understanding was wrong.
> Does your "of_clk_get_parent_name()" means "case R8A7790_CLK_MAIN"'s one ?
> If Yes, it is needed on "parent" clock side, not here ?
> If No, who need/call of_clk_get_parent_name() for this ?
> does "qspi", "sdh", "sd0", "sd1" can be parent clock for some device ??
All those clocks are parents of other clocks (DIV6, MSTP or fixed-factor
clocks). The DIV6, MSTP and fixed-factor clock drivers call
of_clk_get_parent_name() to get the name of their parent clock, which is
required to register the clocks with CCF. See of_fixed_factor_clk_setup() for
instance.
> And, parent of main clock is fixed by MD pin settings.
> SW can't exchange it.
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2013-11-06 1:00 UTC|newest]
Thread overview: 105+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-29 14:55 [PATCH 0/3] Renesas R8A7790 Common Clock Framework support Laurent Pinchart
2013-10-29 14:55 ` Laurent Pinchart
2013-10-29 14:55 ` Laurent Pinchart
2013-10-29 14:55 ` [PATCH 1/3] clk: shmobile: Add DIV6 clock support Laurent Pinchart
2013-10-29 14:55 ` Laurent Pinchart
2013-10-29 14:55 ` Laurent Pinchart
2013-10-29 23:33 ` Kumar Gala
2013-10-29 23:33 ` Kumar Gala
2013-10-29 23:33 ` Kumar Gala
2013-10-29 23:54 ` Laurent Pinchart
2013-10-29 23:54 ` Laurent Pinchart
2013-10-29 23:54 ` Laurent Pinchart
2013-10-29 23:56 ` Kumar Gala
2013-10-29 23:56 ` Kumar Gala
2013-10-29 23:56 ` Kumar Gala
2013-10-29 14:55 ` [PATCH 2/3] clk: shmobile: Add MSTP " Laurent Pinchart
2013-10-29 14:55 ` Laurent Pinchart
2013-10-29 14:55 ` Laurent Pinchart
2013-10-29 23:36 ` Kumar Gala
2013-10-29 23:36 ` Kumar Gala
2013-10-29 23:36 ` Kumar Gala
2013-10-30 0:06 ` Laurent Pinchart
2013-10-30 0:06 ` Laurent Pinchart
2013-10-30 0:06 ` Laurent Pinchart
2013-10-30 0:19 ` Kumar Gala
2013-10-30 0:19 ` Kumar Gala
2013-10-30 0:19 ` Kumar Gala
2013-10-31 15:15 ` Laurent Pinchart
2013-10-31 15:15 ` Laurent Pinchart
2013-10-31 15:15 ` Laurent Pinchart
2013-11-06 2:09 ` Simon Horman
2013-11-06 2:09 ` Simon Horman
2013-11-06 2:09 ` Simon Horman
2013-11-06 12:22 ` Laurent Pinchart
2013-11-06 12:22 ` Laurent Pinchart
2013-11-06 12:22 ` Laurent Pinchart
2013-11-06 8:33 ` Magnus Damm
2013-11-06 8:33 ` Magnus Damm
2013-11-06 8:33 ` Magnus Damm
2013-11-06 12:13 ` Laurent Pinchart
2013-11-06 12:13 ` Laurent Pinchart
2013-11-06 12:13 ` Laurent Pinchart
2013-10-29 14:55 ` [PATCH 3/3] clk: shmobile: Add R8A7790 clocks support Laurent Pinchart
2013-10-29 14:55 ` Laurent Pinchart
2013-10-29 14:55 ` Laurent Pinchart
2013-10-29 23:56 ` Kumar Gala
2013-10-29 23:56 ` Kumar Gala
2013-10-29 23:56 ` Kumar Gala
2013-11-05 7:56 ` Magnus Damm
2013-11-05 7:56 ` Magnus Damm
2013-11-05 7:56 ` Magnus Damm
2013-11-05 23:47 ` Laurent Pinchart
2013-11-05 23:47 ` Laurent Pinchart
2013-11-05 23:47 ` Laurent Pinchart
2013-11-06 8:19 ` Magnus Damm
2013-11-06 8:19 ` Magnus Damm
2013-11-06 8:19 ` Magnus Damm
2013-11-06 12:45 ` Laurent Pinchart
2013-11-06 12:45 ` Laurent Pinchart
2013-11-06 12:45 ` Laurent Pinchart
2013-11-05 8:52 ` Kuninori Morimoto
2013-11-05 8:52 ` Kuninori Morimoto
2013-11-05 8:52 ` Kuninori Morimoto
2013-11-05 23:57 ` Laurent Pinchart
2013-11-05 23:57 ` Laurent Pinchart
2013-11-05 23:57 ` Laurent Pinchart
2013-11-06 0:54 ` Kuninori Morimoto
2013-11-06 0:54 ` Kuninori Morimoto
2013-11-06 0:54 ` Kuninori Morimoto
2013-11-06 1:00 ` Laurent Pinchart [this message]
2013-11-06 1:00 ` Laurent Pinchart
2013-11-06 1:00 ` Laurent Pinchart
2013-11-06 2:31 ` Kuninori Morimoto
2013-11-06 2:31 ` Kuninori Morimoto
2013-11-06 2:31 ` Kuninori Morimoto
2013-11-06 12:41 ` Laurent Pinchart
2013-11-06 12:41 ` Laurent Pinchart
2013-11-06 12:41 ` Laurent Pinchart
2013-11-07 3:22 ` Kuninori Morimoto
2013-11-07 3:22 ` Kuninori Morimoto
2013-11-07 3:22 ` Kuninori Morimoto
2013-11-07 7:20 ` Kuninori Morimoto
2013-11-07 7:20 ` Kuninori Morimoto
2013-11-07 7:20 ` Kuninori Morimoto
2013-11-07 12:15 ` Laurent Pinchart
2013-11-07 12:15 ` Laurent Pinchart
2013-11-07 12:15 ` Laurent Pinchart
2013-11-08 0:06 ` Kuninori Morimoto
2013-11-08 0:06 ` Kuninori Morimoto
2013-11-08 0:06 ` Kuninori Morimoto
2013-11-08 1:00 ` Laurent Pinchart
2013-11-08 1:00 ` Laurent Pinchart
2013-11-08 1:00 ` Laurent Pinchart
2013-11-08 6:02 ` Kuninori Morimoto
2013-11-08 6:02 ` Kuninori Morimoto
2013-11-08 6:02 ` Kuninori Morimoto
2013-11-06 7:18 ` Simon Horman
2013-11-06 7:18 ` Simon Horman
2013-11-06 7:18 ` Simon Horman
2013-11-06 12:56 ` Laurent Pinchart
2013-11-06 12:56 ` Laurent Pinchart
2013-11-06 12:56 ` Laurent Pinchart
2013-11-08 6:34 ` Simon Horman
2013-11-08 6:34 ` Simon Horman
2013-11-08 6:34 ` Simon Horman
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=2775658.fxp7sbhy9u@avalon \
--to=laurent.pinchart@ideasonboard.com \
--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 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.