]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
m68knommu: add clock creation support macro for other ColdFire CPUs
authorGreg Ungerer <gerg@uclinux.org>
Fri, 13 Jul 2012 04:48:23 +0000 (14:48 +1000)
committerGreg Ungerer <gerg@uclinux.org>
Wed, 5 Dec 2012 00:51:24 +0000 (10:51 +1000)
The clock support code for ColdFire CPUs currently supports those that
have the clock control register PPMCR. Expose the struct clk for all CPU
types and add a definition for all other ColdFire CPU types.

With this we will be able to define simple clock trees for all ColdFire
CPU types, even though they will not be able to be enabled or disabled.
They will be able to report the clock rate.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
arch/m68k/include/asm/mcfclk.h

index b676a02bb3926c032f5b2348b0009d70ebd332df..ea4791e3a55759c77ac3dd4fe17b2c9b016a0983 100644 (file)
@@ -8,7 +8,6 @@
 
 struct clk;
 
-#ifdef MCFPM_PPMCR0
 struct clk_ops {
        void (*enable)(struct clk *);
        void (*disable)(struct clk *);
@@ -23,6 +22,8 @@ struct clk {
 };
 
 extern struct clk *mcf_clks[];
+
+#ifdef MCFPM_PPMCR0
 extern struct clk_ops clk_ops0;
 #ifdef MCFPM_PPMCR1
 extern struct clk_ops clk_ops1;
@@ -38,6 +39,12 @@ static struct clk __clk_##clk_bank##_##clk_slot = { \
 
 void __clk_init_enabled(struct clk *);
 void __clk_init_disabled(struct clk *);
+#else
+#define DEFINE_CLK(clk_ref, clk_name, clk_rate) \
+        static struct clk clk_##clk_ref = { \
+                .name = clk_name, \
+                .rate = clk_rate, \
+        }
 #endif /* MCFPM_PPMCR0 */
 
 #endif /* mcfclk_h */