Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1532779
| From | Stephen Boyd <sboyd@codeaurora.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [alsa-devel] [PATCH v2] clkdev: add devm_of_clk_get() |
| Date | 2016-11-29 22:10 +0100 |
| Message-ID | <sIXP5-5gZ-35@gated-at.bofh.it> (permalink) |
| References | (5 earlier) <sGLfj-uo-11@gated-at.bofh.it> <sGLfj-uo-13@gated-at.bofh.it> <sGLfj-uo-7@gated-at.bofh.it> <sIXP5-5gZ-37@gated-at.bofh.it> <sIXP5-5gZ-39@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 11/24, Kuninori Morimoto wrote:
>
> Hi Stephen, again
>
> > > 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);
>
> Thanks, but, my point is that Linux already have "of_clk_get()",
> but we don't have its devm_ version.
> The point is that of_clk_get() can get clock from "device_node".
> Why having devm_ version become so problem ?
The problem is that it encourages the use of of_clk_get() when
clk_get() is more desirable. Ideally of_clk_get() is never used
when a device exists. In this case, it seems like we need to
support it though, hence the suggestion of having a
devm_get_clk_from_child() API, that explicitly reads as "get a
clock from a child node of this device". The distinction is
important, because of_clk_get() should rarely be used.
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
Re: [alsa-devel] [PATCH v2] clkdev: add devm_of_clk_get() Stephen Boyd <sboyd@codeaurora.org> - 2016-11-29 22:10 +0100
csiph-web