[PATCH 2/2] ARM: nomadik: add the new clocks to the device tree

Linus Walleij linus.walleij at linaro.org
Mon Jun 10 08:29:17 EDT 2013


On Mon, Jun 10, 2013 at 7:12 AM, Bjorn Andersson <bjorn at kryo.se> wrote:

> While hacking on clock support for msm8960 the other day I did the
> same thing; I figured that providing clocks with descriptive names
> would be of great benefit while reading the dts.
>
> I had my uart device setup with:
> clocks = <&gsbi8_uart_clk>, <&gsbi8_p_clk>;
>
> However, all currently present clock bindings follow the pattern
> described by Arnd.
> Following this pattern my uart would be setup as:
> clocks = <&clks 42>, <&clks 44>;
>
> Needless to say there is no way to make sense of this without
> consulting the specific binding documentation. So, although your way
> of setting up the clock binding is not the standard way I do prefer
> it, but it comes with plenty extra nodes in the tree.

I agree. In my case this was just a side-effect of the different
bits in the register having different parents, so the common pattern
could not be used, but when looking at the end result it's strikingly
more readable than the cryptic numbers.

However it is possible to mitigate the latter by using the new DTS
preprocessor support like so:

#include <dt-bindings/clk/my-clocks.h>:

/* Clock IDs */
#define GSBI8_UART_CLK 42
#define GSBI8_P_CLK 44

(...)
clocks = <&clks GSBI8_UART_CLK>, <&clks GSBI8_P_CLK>;

Yours,
Linus Walleij



More information about the linux-arm-kernel mailing list