devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
To: Shawn Guo <shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	linaro-dev-cunTk1MwBs8s++Sfvej+rw@public.gmane.org,
	patches-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org
Subject: Re: [PATCH v2 3/6] dt: add new member 'clk' into device_node
Date: Thu, 31 Mar 2011 13:59:51 -0600	[thread overview]
Message-ID: <20110331195951.GA31846@ponder.secretlab.ca> (raw)
In-Reply-To: <1300472672-13392-4-git-send-email-shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>

On Sat, Mar 19, 2011 at 02:24:29AM +0800, Shawn Guo wrote:
> This pointer to 'struct clk' is added to save the reference to 'clk'
> which is dynamically created per dt clock node, so that clkdev API
> like clk_get can work with dt based device driver.
> 
> Signed-off-by: Shawn Guo <shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> ---
>  include/linux/of.h |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/include/linux/of.h b/include/linux/of.h
> index d9dd664..e621295 100644
> --- a/include/linux/of.h
> +++ b/include/linux/of.h
> @@ -54,6 +54,7 @@ struct device_node {
>  	struct	device_node *allnext;	/* next in list of all nodes */
>  	struct	proc_dir_entry *pde;	/* this node's proc directory */
>  	struct	kref kref;
> +	struct	clk *clk;

The dt clock support code can already translate from dt node to a
clock provider, and each clock provider should provide a .get() hook
to return the correct struct clk.  of_clk_add_provider() inserts a
mapping into the of_clk_providers() list, and clk_get() calls
of_clk_get() which will process a devicenode->clk provider mapping.

Adding a struct clk pointer to the device node isn't sufficient since
a single clock provider node can provide multiple clock outputs.

g.

  parent reply	other threads:[~2011-03-31 19:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-18 18:24 [PATCH v2 0/6] add full platform dt clock support for mx51 babbage Shawn Guo
     [not found] ` <1300472672-13392-1-git-send-email-shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2011-03-18 18:24   ` [PATCH v2 1/6] arm/dts: babbage: add all available clock nodes Shawn Guo
2011-03-18 18:24   ` [PATCH v2 2/6] arm/mxc: add clk member 'rate' to ease dt fixed-clock support Shawn Guo
2011-03-18 18:24   ` [PATCH v2 3/6] dt: add new member 'clk' into device_node Shawn Guo
     [not found]     ` <1300472672-13392-4-git-send-email-shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2011-03-31 19:59       ` Grant Likely [this message]
2011-03-18 18:24   ` [PATCH v2 4/6] arm/dt: mx51: dynamically add clocks per dt nodes Shawn Guo
     [not found]     ` <1300472672-13392-5-git-send-email-shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2011-03-31 20:40       ` Grant Likely
2011-03-18 18:24   ` [PATCH v2 5/6] arm/dt: mx5: change timer init function to dt clock way Shawn Guo
2011-03-18 18:24   ` [PATCH v2 6/6] of/clock: eliminate function __of_clk_get_from_provider Shawn Guo
     [not found]     ` <1300472672-13392-7-git-send-email-shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2011-03-31 20:41       ` Grant Likely

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=20110331195951.GA31846@ponder.secretlab.ca \
    --to=grant.likely-s3s/wqlpoipyb63q8fvjnq@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=linaro-dev-cunTk1MwBs8s++Sfvej+rw@public.gmane.org \
    --cc=patches-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.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 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).