[RFC PATCHv3 1/2] ARM: socfpga: initial support for Altera's SOCFPGA platform
Arnd Bergmann
arnd at arndb.de
Wed Jul 18 03:27:31 EDT 2012
On Wednesday 18 July 2012, dinguyen at altera.com wrote:
> +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", },
I have one comment left: You still define "struct clk" privately here,
which means that any driver using clk_get and clk_get_rate will
access an invalid data structure and not get the rate you put in here.
I believe you just need to be using clk_register_fixed_rate()
rather than defining the clk structures statically.
Arnd
More information about the linux-arm-kernel
mailing list