devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@codeaurora.org>
To: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Michael Turquette <mturquette@baylibre.com>,
	Rob Herring <robh@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Mark Brown <broonie@kernel.org>,
	Linux-ALSA <alsa-devel@alsa-project.org>,
	Linux-DT <devicetree@vger.kernel.org>,
	Linux-Kernel <linux-kernel@vger.kernel.org>,
	linux-clk@vger.kernel.org,
	Linux-ARM <linux-arm-kernel@lists.infradead.org>
Subject: Re: [alsa-devel] [PATCH v2] clkdev: add devm_of_clk_get()
Date: Wed, 23 Nov 2016 11:10:37 -0800	[thread overview]
Message-ID: <20161123191037.GE25626@codeaurora.org> (raw)
In-Reply-To: <8737isvwc6.wl%kuninori.morimoto.gx@renesas.com>

On 11/16, Kuninori Morimoto wrote:
> 
> Hi Rob, Michael, Russell
> 
> 
> What is the conclusion of this patch ?
> We shouldn't add devm_of_clk_get() ? or can I continue ?
> 
> The problem of current [devm_]clk_get() handles *dev only,
> but I need to get clocks from DT node, not dev
> 
> 	sound_soc {
> 		...
> 		cpu {
> 			...
> =>			clocks = <&xxx>;
> 		};
> 		codec {
> 			...
> =>			clocks = <&xxx>;
> 		};
> 	};
> 

I've seen bindings that have the 'clocks' property at the top
level and the appropriate 'clock-names' property to relate the
clocks to a subnode.

 	sound_soc {
		clocks = <&xxx>, <&xxx>;
		clock-names = "cpu", "codec";
 		...
 		cpu {
 			...
 		};
 		codec {
 			...
 		};
 	};

Then the subnodes call clk_get() with the top level device and
the name of their node and things match up. I suppose this
binding is finalized though, so we can't really do that?

I see that the gpio framework has a similar design called
devm_get_gpiod_from_child(), so how about we add a
devm_get_clk_from_child() API? That would more closely match the
intent here, which is to restrict the clk_get() operation to
child nodes of the device passed as the first argument.

struct clk *devm_get_clk_from_child(struct device *dev,
				    const char *con_id,
				    struct device_node *child);

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

  reply	other threads:[~2016-11-23 19:10 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-04  1:36 [PATCH v2] clkdev: add devm_of_clk_get() Kuninori Morimoto
2016-07-07  0:43 ` Michael Turquette
2016-07-07  9:54   ` Kuninori Morimoto
2016-07-07 12:26     ` Russell King - ARM Linux
2016-07-08  0:03       ` Kuninori Morimoto
2016-07-08  1:30         ` Michael Turquette
2016-07-08  3:18           ` Kuninori Morimoto
2016-07-27  0:51             ` [alsa-devel] " Kuninori Morimoto
2016-07-27  0:51             ` Kuninori Morimoto
2016-11-16  5:17               ` Kuninori Morimoto
2016-11-23 19:10                 ` Stephen Boyd [this message]
     [not found]                   ` <20161123191037.GE25626-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2016-11-24  1:45                     ` Kuninori Morimoto
2016-11-24  4:57                       ` Kuninori Morimoto
     [not found]                         ` <87y409cw71.wl%kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
2016-11-29 21:05                           ` Stephen Boyd
     [not found]                             ` <20161129210556.GC6095-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2016-11-30  1:08                               ` Kuninori Morimoto
     [not found]                                 ` <874m2pbwsn.wl%kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
2016-12-01  1:43                                   ` Kuninori Morimoto

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=20161123191037.GE25626@codeaurora.org \
    --to=sboyd@codeaurora.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mturquette@baylibre.com \
    --cc=robh@kernel.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).