lkml.org 
[lkml]   [2018]   [Dec]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v2] clk: npcm7xx: get fixed clocks from DT
Date
Quoting Tali Perry (2018-12-06 00:44:31)
> diff --git a/drivers/clk/clk-npcm7xx.c b/drivers/clk/clk-npcm7xx.c
> index 27a86b7a34db..4bd2e40997d4 100644
> --- a/drivers/clk/clk-npcm7xx.c
> +++ b/drivers/clk/clk-npcm7xx.c
> @@ -8,13 +8,19 @@
> */
>
> #include <linux/module.h>
> +#include <linux/clk.h>
> #include <linux/clk-provider.h>
> +#include <linux/device.h>
> #include <linux/io.h>
> #include <linux/kernel.h>
> #include <linux/of.h>
> +#include <linux/of_device.h>
> +#include <linux/of_platform.h>
> #include <linux/of_address.h>
> +#include <linux/platform_device.h>
> #include <linux/slab.h>
> #include <linux/err.h>
> +#include <linux/rational.h>

Why?

> #include <linux/bitfield.h>
>
> #include <dt-bindings/clock/nuvoton,npcm7xx-clock.h>
> @@ -568,6 +575,31 @@ static void __init npcm7xx_clk_init(struct device_node *clk_np)
> for (i = 0; i < NPCM7XX_NUM_CLOCKS; i++)
> npcm7xx_clk_data->hws[i] = ERR_PTR(-EPROBE_DEFER);
>
> + /* Read fixed clocks. These 3 clocks must be defined in DT */
> + clk = of_clk_get_by_name(clk_np, NPCM7XX_CLK_S_REFCLK);
> + if (IS_ERR(clk)) {
> + pr_err("failed to find external REFCLK on device tree, err=%ld\n",
> + PTR_ERR(clk));
> + clk_put(clk);
> + goto npcm7xx_init_fail_no_clk_on_dt;
> + }
> +
> + clk = of_clk_get_by_name(clk_np, NPCM7XX_CLK_S_SYSBYPCK);
> + if (IS_ERR(clk)) {
> + pr_err("failed to find external SYSBYPCK on device tree, err=%ld\n",
> + PTR_ERR(clk));
> + clk_put(clk);
> + goto npcm7xx_init_fail_no_clk_on_dt;
> + }
> +
> + clk = of_clk_get_by_name(clk_np, NPCM7XX_CLK_S_MCBYPCK);
> + if (IS_ERR(clk)) {
> + pr_err("failed to find external MCBYPCK on device tree, err=%ld\n",
> + PTR_ERR(clk));
> + clk_put(clk);
> + goto npcm7xx_init_fail_no_clk_on_dt;
> + }

Now this looks like a DT validator in the kernel. DT folks are working
on a schema and validator, which should be able to make sure that the
DTS file has the proper set of clks specified for this drivers' node so
that we don't need to check in the kernel.

So it looks like nothing needs to change here?

\
 
 \ /
  Last update: 2018-12-06 19:50    [W:0.035 / U:1.188 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site