devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike Turquette <mturquette-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
To: Linus Walleij
	<linus.walleij-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org>,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	Rob Herring <robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
Subject: Re: [PATCH 3/6] clk: move the U300 fixed and fixed-factor to DT
Date: Thu, 30 May 2013 12:00:12 -0700	[thread overview]
Message-ID: <20130530190012.4470.50181@quantum> (raw)
In-Reply-To: <1369330288-14856-4-git-send-email-linus.walleij-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org>

Quoting Linus Walleij (2013-05-23 10:31:25)
> From: Linus Walleij <linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> 
> This converts the fixed and fixed-factor clocks in the U300
> platform to register themselves from the device tree.
> 
> Cc: Mike Turquette <mturquette-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> Signed-off-by: Linus Walleij <linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> ---
> Hi Mike, seeking an ACK on this to take the series through
> ARM SoC.

I'm happy to see another conversion to of_clk_init.

Acked-by: Mike Turquette <mturquette-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>

> ---
>  arch/arm/boot/dts/ste-u300.dts | 44 ++++++++++++++++++++++++++++++++++++++++++
>  drivers/clk/clk-u300.c         | 33 +++++++++++++------------------
>  2 files changed, 57 insertions(+), 20 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/ste-u300.dts b/arch/arm/boot/dts/ste-u300.dts
> index 0530095..c51a8c7 100644
> --- a/arch/arm/boot/dts/ste-u300.dts
> +++ b/arch/arm/boot/dts/ste-u300.dts
> @@ -33,6 +33,49 @@
>         syscon: syscon@c0011000 {
>                 compatible = "stericsson,u300-syscon";
>                 reg = <0xc0011000 0x1000>;
> +               clk32: app_32_clk@32k {
> +                       #clock-cells = <0>;
> +                       compatible = "fixed-clock";
> +                       clock-frequency = <32768>;
> +               };
> +               pll13: pll13@13M {
> +                       #clock-cells = <0>;
> +                       compatible = "fixed-clock";
> +                       clock-frequency = <13000000>;
> +               };
> +               pll208: pll208@208M {
> +                       #clock-cells = <0>;
> +                       compatible = "fixed-clock";
> +                       clock-frequency = <208000000>;
> +               };
> +               app208: app_208_clk@208M {
> +                       #clock-cells = <0>;
> +                       compatible = "fixed-factor-clock";
> +                       clock-div = <1>;
> +                       clock-mult = <1>;
> +                       clocks = <&pll208>;
> +               };
> +               app104: app_104_clk@104M {
> +                       #clock-cells = <0>;
> +                       compatible = "fixed-factor-clock";
> +                       clock-div = <2>;
> +                       clock-mult = <1>;
> +                       clocks = <&pll208>;
> +               };
> +               app52: app_52_clk@52M {
> +                       #clock-cells = <0>;
> +                       compatible = "fixed-factor-clock";
> +                       clock-div = <4>;
> +                       clock-mult = <1>;
> +                       clocks = <&pll208>;
> +               };
> +               app26: app_26_clk@26M {
> +                       #clock-cells = <0>;
> +                       compatible = "fixed-factor-clock";
> +                       clock-div = <2>;
> +                       clock-mult = <1>;
> +                       clocks = <&app52>;
> +               };
>         };
>  
>         timer: timer@c0014000 {
> @@ -65,6 +108,7 @@
>                 reg = <0xc0012000 0x1000>;
>                 interrupt-parent = <&vicb>;
>                 interrupts = <3>;
> +               clocks = <&clk32>;
>         };
>  
>         rtc: rtc@c0017000 {
> diff --git a/drivers/clk/clk-u300.c b/drivers/clk/clk-u300.c
> index a41e42e..bebd6c9 100644
> --- a/drivers/clk/clk-u300.c
> +++ b/drivers/clk/clk-u300.c
> @@ -11,6 +11,7 @@
>  #include <linux/io.h>
>  #include <linux/clk-provider.h>
>  #include <linux/spinlock.h>
> +#include <linux/of.h>
>  
>  /* APP side SYSCON registers */
>  /* CLK Control Register 16bit (R/W) */
> @@ -931,6 +932,17 @@ mclk_clk_register(struct device *dev, const char *name,
>         return clk;
>  }
>  
> +static const __initconst struct of_device_id u300_clk_match[] = {
> +       {
> +               .compatible = "fixed-clock",
> +               .data = of_fixed_clk_setup,
> +       },
> +       {
> +               .compatible = "fixed-factor-clock",
> +               .data = of_fixed_factor_clk_setup,
> +       },
> +};
> +
>  void __init u300_clk_init(void __iomem *base)
>  {
>         u16 val;
> @@ -951,26 +963,7 @@ void __init u300_clk_init(void __iomem *base)
>         val |= U300_SYSCON_PMCR_PWR_MGNT_ENABLE;
>         writew(val, syscon_vbase + U300_SYSCON_PMCR);
>  
> -       /* These are always available (RTC and PLL13) */
> -       clk = clk_register_fixed_rate(NULL, "app_32_clk", NULL,
> -                                     CLK_IS_ROOT, 32768);
> -       /* The watchdog sits directly on the 32 kHz clock */
> -       clk_register_clkdev(clk, NULL, "coh901327_wdog");
> -       clk = clk_register_fixed_rate(NULL, "pll13", NULL,
> -                                     CLK_IS_ROOT, 13000000);
> -
> -       /* These derive from PLL208 */
> -       clk = clk_register_fixed_rate(NULL, "pll208", NULL,
> -                                     CLK_IS_ROOT, 208000000);
> -       clk = clk_register_fixed_factor(NULL, "app_208_clk", "pll208",
> -                                       0, 1, 1);
> -       clk = clk_register_fixed_factor(NULL, "app_104_clk", "pll208",
> -                                       0, 1, 2);
> -       clk = clk_register_fixed_factor(NULL, "app_52_clk", "pll208",
> -                                       0, 1, 4);
> -       /* The 52 MHz is divided down to 26 MHz */
> -       clk = clk_register_fixed_factor(NULL, "app_26_clk", "app_52_clk",
> -                                       0, 1, 2);
> +       of_clk_init(u300_clk_match);
>  
>         /* Directly on the AMBA interconnect */
>         clk = syscon_clk_register(NULL, "cpu_clk", "app_208_clk", 0, true,
> -- 
> 1.7.11.3

  parent reply	other threads:[~2013-05-30 19:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-23 17:31 [PATCH 0/6] U300 device tree clocks Linus Walleij
2013-05-23 17:31 ` [PATCH 2/6] ARM: u300: remove register definition file Linus Walleij
     [not found] ` <1369330288-14856-1-git-send-email-linus.walleij-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org>
2013-05-23 17:31   ` [PATCH 1/6] ARM: u300: add syscon node Linus Walleij
2013-05-23 17:31   ` [PATCH 3/6] clk: move the U300 fixed and fixed-factor to DT Linus Walleij
     [not found]     ` <1369330288-14856-4-git-send-email-linus.walleij-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org>
2013-05-30 19:00       ` Mike Turquette [this message]
2013-05-23 17:31   ` [PATCH 4/6] i2c: stu300: do not request a specific clock name Linus Walleij
2013-05-23 23:09     ` Wolfram Sang
2013-05-23 17:31   ` [PATCH 5/6] ARM: u300: move the gated system controller clocks to DT Linus Walleij
     [not found]     ` <1369330288-14856-6-git-send-email-linus.walleij-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org>
2013-05-30 19:06       ` Mike Turquette
2013-05-23 17:31 ` [PATCH 6/6] ARM: u300: convert MMC/SD clock to device tree Linus Walleij
     [not found]   ` <1369330288-14856-7-git-send-email-linus.walleij-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org>
2013-05-30 19:07     ` Mike Turquette

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=20130530190012.4470.50181@quantum \
    --to=mturquette-qsej5fyqhm4dnm+yrofe0a@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=linus.walleij-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.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).