From: Michael Turquette <mturquette@baylibre.com>
To: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
"Russell King - ARM Linux" <linux@armlinux.org.uk>
Cc: "Rob Herring" <robh@kernel.org>,
"Mark Brown" <broonie@kernel.org>,
"Linux-Kernel" <linux-kernel@vger.kernel.org>,
"Linux-DT" <devicetree@vger.kernel.org>,
"Linux-ARM" <linux-arm-kernel@lists.infradead.org>,
"Linux-ALSA" <alsa-devel@alsa-project.org>,
linux-clk@vger.kernel.org
Subject: Re: [PATCH v2] clkdev: add devm_of_clk_get()
Date: Thu, 07 Jul 2016 18:30:09 -0700 [thread overview]
Message-ID: <146794140875.73491.7115209079607438738@resonance> (raw)
In-Reply-To: <8760shgfzu.wl%kuninori.morimoto.gx@renesas.com>
Quoting Kuninori Morimoto (2016-07-07 17:03:00)
>
> Hi Russell
>
> > > > > +struct clk *devm_of_clk_get(struct device *dev,
> > > > > + struct device_node *np, int index)
> > > >
> > > > Any reason not to use devm_clk_get? Why do we need this helper?
> > >
> > > Because of_clk_get() can parse "clocks", "#clock-cells" on DT.
> >
> > clk_get() should also work just fine. clk_get() uses
> > __of_clk_get_by_name() internally, which uses "clock-names" to
> > locate the index if a connection id is given. of_clk_get() allows
> > lookup of a clock by index only, omitting the name, which means
> > you need to coordinate the order of clocks in DT with the order
> > that the driver wants... which sounds error prone to me.
>
> Thanks.
>
> But, I have 1 issue on [devm_]clk_get().
> It can't select device_node on [devm_]clk_get(), it uses dev->of_node directly.
>
> struct clk *clk_get(struct device *dev, const char *con_id)
> {
> ...
> if (dev) {
> clk = __of_clk_get_by_name(dev->of_node, dev_id, con_id);
> ~~~~~~~~~~~~
> ...
> }
> }
>
> I would like to select specific device_node.
Do you have access to the struct device that you want to target? Can you
pass that device into either clk_get or devm_clk_get?
Regards,
Mike
>
> sound_soc {
> ...
> cpu {
> ...
> => clocks = <&xxx>;
> };
>
> codec {
> ...
> => clocks = <&xxx>;
> };
> };
>
> But, of_clk_get_by_name() / of_clk_get() doesn't have devm_xxx version
next prev parent reply other threads:[~2016-07-08 1:30 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-04 1:36 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 [this message]
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
2016-11-24 1:45 ` Kuninori Morimoto
2016-11-24 4:57 ` Kuninori Morimoto
2016-11-29 21:05 ` Stephen Boyd
2016-11-30 1:08 ` Kuninori Morimoto
2016-12-01 1:43 ` Kuninori Morimoto
2016-11-28 6:56 Kuninori Morimoto
2016-11-28 9:14 ` Russell King - ARM Linux
2016-11-28 9:21 ` 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=146794140875.73491.7115209079607438738@resonance \
--to=mturquette@baylibre.com \
--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=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
all inboxes | Powered by JetHome®