linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: pavel@denx.de (Pavel Machek)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCHv3 1/2] ARM: socfpga: initial support for Altera's SOCFPGA platform
Date: Wed, 18 Jul 2012 12:04:35 +0200	[thread overview]
Message-ID: <20120718100435.GA7607@elf.ucw.cz> (raw)
In-Reply-To: <20120718091407.0489e501@skate>

Hi!

> > +struct clk {
> > +	unsigned long rate;
> > +};
> > +
> > +static struct clk apb_pclk = { .rate = 200000000};
> > +static struct clk i2c_clk = { .rate = 100000000};
> > +static struct clk spim_clk = { .rate = 100000000};
> > +static struct clk mpu_pclk = { .rate = SOCFPGA_MPU_PERIHCLK_FREQ_HZ};
> > +static struct clk l4_main_clk = { .rate = SOCFPGA_L4_MAIN_CLK};
> > +
> > +static struct clk_lookup lookups[] = {
> > +	{ .clk = &apb_pclk, .con_id = "apb_pclk", },
> > +	{ .clk = &i2c_clk, .dev_id = "ffc04000.i2c", },
> > +	{ .clk = &i2c_clk, .dev_id = "ffc05000.i2c", },
> > +	{ .clk = &spim_clk, .dev_id = "dw-spi-mmio.0", },
> > +	{ .clk = &spim_clk, .dev_id = "dw-spi-mmio.1", },
> > +	{ .clk = &mpu_pclk, .dev_id = "smp_twd", },
> > +	{ .clk = &l4_main_clk, .dev_id = "dma-pl330", },
> > +};
> > +
> > +void __init socfpga_init_clocks(void)
> > +{
> > +	clkdev_add_table(lookups, ARRAY_SIZE(lookups));
> > +}
> 
> I am not sure this is the proper way of using the clock framework.
> Individual platforms should no longer define their own "struct clk".
> They should either use the common clock types (fixed rate, fixed
> factor, divider, mux, gate, etc.). or implement their own specialized
> clock types.
> 
> So in your case, since you apparently only have fixed rate clock, you
> would use clk_register_fixed_rate() to register your clocks, and it
> would return to you an opaque 'struct clk' reference.
> 
> For more details, you can look at Documentation/clk.txt.

Ok, I had version that did that at one point. But... as bootloader
currently sets up the clock, this code is currently mostly unused. So
what about removing it from initial merge and re-adding it when it is
used/neccessary?

								Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

  reply	other threads:[~2012-07-18 10:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-18  0:50 [RFC PATCHv3 0/2] arm: socfpga: Add initial support for Altera's SOCFPGA HW dinguyen at altera.com
2012-07-18  0:50 ` [RFC PATCHv3 1/2] ARM: socfpga: initial support for Altera's SOCFPGA platform dinguyen at altera.com
2012-07-18  7:14   ` Thomas Petazzoni
2012-07-18 10:04     ` Pavel Machek [this message]
2012-07-18  7:27   ` Arnd Bergmann
2012-07-18  0:50 ` [RFC PATCHv3 2/2] ARM: socfpga: Add DTS bindings for Altera's SOCFPGA dinguyen at altera.com
2012-07-18  7:16   ` Thomas Petazzoni
2012-07-18 10:13     ` Pavel Machek
2012-07-18 11:19       ` Thomas Petazzoni

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=20120718100435.GA7607@elf.ucw.cz \
    --to=pavel@denx.de \
    --cc=linux-arm-kernel@lists.infradead.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).