Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1479865
| From | Alexandre Belloni <alexandre.belloni@free-electrons.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v2 2/5] clk: at91: Add sama5d4 sckc support |
| Date | 2016-09-09 13:00 +0200 |
| Message-ID | <sfrHj-1Mf-3@gated-at.bofh.it> (permalink) |
| References | <sf8Y1-75b-3@gated-at.bofh.it> <sf8Y1-75b-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Hi,
On 08/09/2016 at 16:51:43 +0200, Alexandre Belloni wrote :
> +static void __init of_sama5d4_sckc_setup(struct device_node *np)
> +{
> + void __iomem *regbase = of_iomap(np, 0);
> + struct clk *clk = NULL;
> + struct clk_sama5d4_slow_osc *osc;
> + struct clk_init_data init;
> + const char *xtal_name;
> + const char *parent_names[2] = { "slow_rc_osc", "slow_osc" };
> + bool bypass;
> +
> + if (!regbase)
> + return;
> +
> + xtal_name = of_clk_get_parent_name(np, 0);
> +
> + bypass = of_property_read_bool(np, "atmel,osc-bypass");
> +
> + osc = kzalloc(sizeof(*osc), GFP_KERNEL);
> + if (!osc)
> + return;
> +
> + init.name = parent_names[1];
> + init.ops = &sama5d4_slow_osc_ops;
> + init.parent_names = &xtal_name;
> + init.num_parents = 1;
> + init.flags = CLK_IGNORE_UNUSED;
> +
> + osc->hw.init = &init;
> + osc->sckcr = regbase;
> + osc->startup_usec = 1200000;
> +
> + if (bypass)
> + writel((readl(regbase) | AT91_SCKC_OSC32BYP), regbase);
> +
> + clk = clk_register(NULL, &osc->hw);
> + if (IS_ERR(clk))
> + kfree(osc);
> +
> + clk = at91_clk_register_slow_rc_osc(regbase, parent_names[0], 32768,
> + 250000000, 75);
That one could be a fixed clock as it is actually impossible to
enable/disable it on sama5d4/2.
I'll send an updated patch series (maybe after getting some feedback).
--
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v2 0/5] AT91: sckc improvements Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2016-09-08 17:00 +0200
[PATCH v2 2/5] clk: at91: Add sama5d4 sckc support Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2016-09-08 17:00 +0200
Re: [PATCH v2 2/5] clk: at91: Add sama5d4 sckc support Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2016-09-09 13:00 +0200
[PATCH v2 4/5] ARM: dts: at91: sama5d2: use correct sckc compatible Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2016-09-08 17:00 +0200
[PATCH v2 3/5] ARM: dts: at91: sama5d4: use proper sckc compatible Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2016-09-08 17:00 +0200
[PATCH v2 5/5] clk: at91: sckc: optimize boot time Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2016-09-08 17:00 +0200
[PATCH v2 1/5] clk: at91: move slow clock controller clocks to sckc.c Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2016-09-08 17:00 +0200
Re: [PATCH v2 0/5] AT91: sckc improvements Stephen Boyd <sboyd@codeaurora.org> - 2016-09-15 02:50 +0200
csiph-web