From: mturquette@linaro.org (Mike Turquette)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 1/4] clk: add of_clk_src_onecell_get() support
Date: Thu, 06 Sep 2012 15:11:55 -0700 [thread overview]
Message-ID: <20120906221155.20289.73650@nucleus> (raw)
In-Reply-To: <20120831064125.GA3271@r65073-Latitude-D630>
Quoting Shawn Guo (2012-08-30 23:41:27)
> Ping, Mike.
>
Hi Shawn,
Do you want me to take everything including patch #2? I'm OK with the
series but want to make sure it won't cause too much problem for you if
the DTS and arch/arm changes go through my tree.
Regards,
Mike
> Regards,
> Shawn
>
> On Wed, Aug 22, 2012 at 09:36:27PM +0800, Shawn Guo wrote:
> > For those SoCs that have hundreds of clock outputs, their clock
> > DT bindings could reasonably define #clock-cells as 1 and require
> > the client device specify the index of the clock it consumes in the
> > cell of its "clocks" phandle.
> >
> > Add a generic of_clk_src_onecell_get() function for this purpose.
> >
> > Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> > ---
> > drivers/clk/clk.c | 14 ++++++++++++++
> > include/linux/clk-provider.h | 5 +++++
> > 2 files changed, 19 insertions(+), 0 deletions(-)
> >
> > diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
> > index efdfd00..308f058 100644
> > --- a/drivers/clk/clk.c
> > +++ b/drivers/clk/clk.c
> > @@ -1582,6 +1582,20 @@ struct clk *of_clk_src_simple_get(struct of_phandle_args *clkspec,
> > }
> > EXPORT_SYMBOL_GPL(of_clk_src_simple_get);
> >
> > +struct clk *of_clk_src_onecell_get(struct of_phandle_args *clkspec, void *data)
> > +{
> > + struct clk_onecell_data *clk_data = data;
> > + unsigned int idx = clkspec->args[0];
> > +
> > + if (idx >= clk_data->clk_num) {
> > + pr_err("%s: invalid clock index %d\n", __func__, idx);
> > + return ERR_PTR(-EINVAL);
> > + }
> > +
> > + return clk_data->clks[idx];
> > +}
> > +EXPORT_SYMBOL_GPL(of_clk_src_onecell_get);
> > +
> > /**
> > * of_clk_add_provider() - Register a clock provider for a node
> > * @np: Device node pointer associated with clock provider
> > diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
> > index 77335fa..8fe6ec7 100644
> > --- a/include/linux/clk-provider.h
> > +++ b/include/linux/clk-provider.h
> > @@ -360,6 +360,11 @@ int of_clk_add_provider(struct device_node *np,
> > void of_clk_del_provider(struct device_node *np);
> > struct clk *of_clk_src_simple_get(struct of_phandle_args *clkspec,
> > void *data);
> > +struct clk_onecell_data {
> > + struct clk **clks;
> > + unsigned int clk_num;
> > +};
> > +struct clk *of_clk_src_onecell_get(struct of_phandle_args *clkspec, void *data);
> > const char *of_clk_get_parent_name(struct device_node *np, int index);
> > void of_clk_init(const struct of_device_id *matches);
> >
> > --
> > 1.7.5.4
> >
WARNING: multiple messages have this Message-ID (diff)
From: Mike Turquette <mturquette@linaro.org>
To: Shawn Guo <shawn.guo@linaro.org>,
linux-arm-kernel@lists.infradead.org,
devicetree-discuss@lists.ozlabs.org
Cc: Russell King - ARM Linux <linux@arm.linux.org.uk>,
Rob Herring <rob.herring@calxeda.com>
Subject: Re: [PATCH v2 1/4] clk: add of_clk_src_onecell_get() support
Date: Thu, 06 Sep 2012 15:11:55 -0700 [thread overview]
Message-ID: <20120906221155.20289.73650@nucleus> (raw)
In-Reply-To: <20120831064125.GA3271@r65073-Latitude-D630>
Quoting Shawn Guo (2012-08-30 23:41:27)
> Ping, Mike.
>
Hi Shawn,
Do you want me to take everything including patch #2? I'm OK with the
series but want to make sure it won't cause too much problem for you if
the DTS and arch/arm changes go through my tree.
Regards,
Mike
> Regards,
> Shawn
>
> On Wed, Aug 22, 2012 at 09:36:27PM +0800, Shawn Guo wrote:
> > For those SoCs that have hundreds of clock outputs, their clock
> > DT bindings could reasonably define #clock-cells as 1 and require
> > the client device specify the index of the clock it consumes in the
> > cell of its "clocks" phandle.
> >
> > Add a generic of_clk_src_onecell_get() function for this purpose.
> >
> > Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> > ---
> > drivers/clk/clk.c | 14 ++++++++++++++
> > include/linux/clk-provider.h | 5 +++++
> > 2 files changed, 19 insertions(+), 0 deletions(-)
> >
> > diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
> > index efdfd00..308f058 100644
> > --- a/drivers/clk/clk.c
> > +++ b/drivers/clk/clk.c
> > @@ -1582,6 +1582,20 @@ struct clk *of_clk_src_simple_get(struct of_phandle_args *clkspec,
> > }
> > EXPORT_SYMBOL_GPL(of_clk_src_simple_get);
> >
> > +struct clk *of_clk_src_onecell_get(struct of_phandle_args *clkspec, void *data)
> > +{
> > + struct clk_onecell_data *clk_data = data;
> > + unsigned int idx = clkspec->args[0];
> > +
> > + if (idx >= clk_data->clk_num) {
> > + pr_err("%s: invalid clock index %d\n", __func__, idx);
> > + return ERR_PTR(-EINVAL);
> > + }
> > +
> > + return clk_data->clks[idx];
> > +}
> > +EXPORT_SYMBOL_GPL(of_clk_src_onecell_get);
> > +
> > /**
> > * of_clk_add_provider() - Register a clock provider for a node
> > * @np: Device node pointer associated with clock provider
> > diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
> > index 77335fa..8fe6ec7 100644
> > --- a/include/linux/clk-provider.h
> > +++ b/include/linux/clk-provider.h
> > @@ -360,6 +360,11 @@ int of_clk_add_provider(struct device_node *np,
> > void of_clk_del_provider(struct device_node *np);
> > struct clk *of_clk_src_simple_get(struct of_phandle_args *clkspec,
> > void *data);
> > +struct clk_onecell_data {
> > + struct clk **clks;
> > + unsigned int clk_num;
> > +};
> > +struct clk *of_clk_src_onecell_get(struct of_phandle_args *clkspec, void *data);
> > const char *of_clk_get_parent_name(struct device_node *np, int index);
> > void of_clk_init(const struct of_device_id *matches);
> >
> > --
> > 1.7.5.4
> >
next prev parent reply other threads:[~2012-09-06 22:11 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-22 13:36 [PATCH v2 0/4] Move imx6q/28/23 clock lookup over to device tree Shawn Guo
2012-08-22 13:36 ` Shawn Guo
2012-08-22 13:36 ` [PATCH v2 1/4] clk: add of_clk_src_onecell_get() support Shawn Guo
2012-08-22 13:36 ` Shawn Guo
2012-08-23 1:42 ` Rob Herring
2012-08-23 1:42 ` Rob Herring
2012-08-31 6:41 ` Shawn Guo
2012-08-31 6:41 ` Shawn Guo
2012-09-06 22:11 ` Mike Turquette [this message]
2012-09-06 22:11 ` Mike Turquette
2012-09-07 0:26 ` Shawn Guo
2012-09-07 0:26 ` Shawn Guo
2012-09-07 19:24 ` Mike Turquette
2012-09-07 19:24 ` Mike Turquette
2012-09-10 6:25 ` Shawn Guo
2012-09-10 6:25 ` Shawn Guo
2012-09-10 17:32 ` Mike Turquette
2012-09-10 17:32 ` Mike Turquette
2012-09-11 1:19 ` Shawn Guo
2012-09-11 1:19 ` Shawn Guo
2012-08-22 13:36 ` [PATCH v2 2/4] ARM: imx6q: replace clk_register_clkdev with clock DT lookup Shawn Guo
2012-08-22 13:36 ` Shawn Guo
2012-08-22 13:36 ` [PATCH v2 3/4] clk: mxs: replace imx28 " Shawn Guo
2012-08-22 13:36 ` Shawn Guo
2012-08-22 13:36 ` [PATCH v2 4/4] clk: mxs: replace imx23 " Shawn Guo
2012-08-22 13:36 ` Shawn Guo
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=20120906221155.20289.73650@nucleus \
--to=mturquette@linaro.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 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.