OMAP2/3/4 clock: combine all omap2_clk_functions
authorPaul Walmsley <paul@pwsan.com>
Wed, 27 Jan 2010 03:13:04 +0000 (20:13 -0700)
committerPaul Walmsley <paul@pwsan.com>
Wed, 27 Jan 2010 03:13:04 +0000 (20:13 -0700)
The struct clk_functions for OMAP2, 3, and 4 are all essentially the
same, so combine them.  This removes one multi-OMAP kernel impediment
and saves memory on multi-OMAP builds.

The stubs for omap2_clk_{init,exit}_cpufreq() code will removed once
the OPP layer code that's currently in Kevin's PM branch is merged.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
arch/arm/mach-omap2/clock.c
arch/arm/mach-omap2/clock.h
arch/arm/mach-omap2/clock2xxx.c
arch/arm/mach-omap2/clock34xx.c
arch/arm/mach-omap2/clock44xx.c

index 0d54fde5b455305bbeb290b36ca83a7a63146681..999b91e023b149641f2ff66f0d6460089909dde8 100644 (file)
@@ -351,3 +351,20 @@ void omap2_clk_disable_unused(struct clk *clk)
                pwrdm_clkdm_state_switch(clk->clkdm);
 }
 #endif
+
+/* Common data */
+
+struct clk_functions omap2_clk_functions = {
+       .clk_enable             = omap2_clk_enable,
+       .clk_disable            = omap2_clk_disable,
+       .clk_round_rate         = omap2_clk_round_rate,
+       .clk_set_rate           = omap2_clk_set_rate,
+       .clk_set_parent         = omap2_clk_set_parent,
+       .clk_disable_unused     = omap2_clk_disable_unused,
+#ifdef CONFIG_CPU_FREQ
+       /* These will be removed when the OPP code is integrated */
+       .clk_init_cpufreq_table = omap2_clk_init_cpufreq_table,
+       .clk_exit_cpufreq_table = omap2_clk_exit_cpufreq_table,
+#endif
+};
+
index 0d21702a3cddbe5fb6edc7ce8dbb9a45f0df998a..dcd58cde13b6f25095fd267428f49666aa0abf5e 100644 (file)
@@ -105,5 +105,12 @@ extern const struct clksel_rate gpt_32k_rates[];
 extern const struct clksel_rate gpt_sys_rates[];
 extern const struct clksel_rate gfx_l3_rates[];
 
+#if defined(CONFIG_ARCH_OMAP24XX) && defined(CONFIG_CPU_FREQ)
+extern void omap2_clk_init_cpufreq_table(struct cpufreq_frequency_table **table);
+extern void omap2_clk_exit_cpufreq_table(struct cpufreq_frequency_table **table);
+#else
+#define omap2_clk_init_cpufreq_table   0
+#define omap2_clk_exit_cpufreq_table   0
+#endif
 
 #endif
index 5420356eb40734128bf904ab9ac387e6b277f182..bef557488fec802883a9d8bfb0f7038388c83017 100644 (file)
@@ -453,13 +453,16 @@ int omap2_select_table_rate(struct clk *clk, unsigned long rate)
  */
 static struct cpufreq_frequency_table *freq_table;
 
-void omap2_clk_init_cpufreq_table(struct cpufreq_frequency_table **table)
+void omap2xxx_clk_init_cpufreq_table(struct cpufreq_frequency_table **table)
 {
        const struct prcm_config *prcm;
        long sys_ck_rate;
        int i = 0;
        int tbl_sz = 0;
 
+       if (!cpu_is_omap2xxx())
+               return;
+
        sys_ck_rate = clk_get_rate(sclk);
 
        for (prcm = rate_table; prcm->mpu_speed; prcm++) {
@@ -516,26 +519,16 @@ void omap2_clk_init_cpufreq_table(struct cpufreq_frequency_table **table)
        *table = &freq_table[0];
 }
 
-void omap2_clk_exit_cpufreq_table(struct cpufreq_frequency_table **table)
+void omap2xxx_clk_exit_cpufreq_table(struct cpufreq_frequency_table **table)
 {
+       if (!cpu_is_omap2xxx())
+               return;
+
        kfree(freq_table);
 }
 
 #endif
 
-struct clk_functions omap2_clk_functions = {
-       .clk_enable             = omap2_clk_enable,
-       .clk_disable            = omap2_clk_disable,
-       .clk_round_rate         = omap2_clk_round_rate,
-       .clk_set_rate           = omap2_clk_set_rate,
-       .clk_set_parent         = omap2_clk_set_parent,
-       .clk_disable_unused     = omap2_clk_disable_unused,
-#ifdef CONFIG_CPU_FREQ
-       .clk_init_cpufreq_table = omap2_clk_init_cpufreq_table,
-       .clk_exit_cpufreq_table = omap2_clk_exit_cpufreq_table,
-#endif
-};
-
 static u32 omap2_get_apll_clkin(void)
 {
        u32 aplls, srate = 0;
index d4217b93e10befee1360785af72e277c9af203ab..4c4bb3cb79e8af7507efe1000abad57e65bb8665 100644 (file)
@@ -258,15 +258,6 @@ int omap3_core_dpll_m2_set_rate(struct clk *clk, unsigned long rate)
  */
 #if defined(CONFIG_ARCH_OMAP3)
 
-struct clk_functions omap2_clk_functions = {
-       .clk_enable             = omap2_clk_enable,
-       .clk_disable            = omap2_clk_disable,
-       .clk_round_rate         = omap2_clk_round_rate,
-       .clk_set_rate           = omap2_clk_set_rate,
-       .clk_set_parent         = omap2_clk_set_parent,
-       .clk_disable_unused     = omap2_clk_disable_unused,
-};
-
 /*
  * Set clocks for bypass mode for reboot to work.
  */
index e370868a79a862c4263238ab5272d8404d9d80ec..08dd6427df7004f06149f67a43c0a3bfe71df036 100644 (file)
 #include <linux/errno.h>
 #include "clock.h"
 
-struct clk_functions omap2_clk_functions = {
-       .clk_enable             = omap2_clk_enable,
-       .clk_disable            = omap2_clk_disable,
-       .clk_round_rate         = omap2_clk_round_rate,
-       .clk_set_rate           = omap2_clk_set_rate,
-       .clk_set_parent         = omap2_clk_set_parent,
-       .clk_disable_unused     = omap2_clk_disable_unused,
-};
-
 const struct clkops clkops_noncore_dpll_ops = {
        .enable         = &omap3_noncore_dpll_enable,
        .disable        = &omap3_noncore_dpll_disable,
This page took 0.033809 seconds and 5 git commands to generate.