[ARM] integrator: convert to clkdev and lookup clocks by device name
[safe/jmp/linux-2.6] / arch / arm / mach-integrator / include / mach / clkdev.h
diff --git a/arch/arm/mach-integrator/include/mach/clkdev.h b/arch/arm/mach-integrator/include/mach/clkdev.h
new file mode 100644 (file)
index 0000000..9293e41
--- /dev/null
@@ -0,0 +1,25 @@
+#ifndef __ASM_MACH_CLKDEV_H
+#define __ASM_MACH_CLKDEV_H
+
+#include <linux/module.h>
+#include <asm/hardware/icst525.h>
+
+struct clk {
+       unsigned long           rate;
+       struct module           *owner;
+       const struct icst525_params *params;
+       void                    *data;
+       void                    (*setvco)(struct clk *, struct icst525_vco vco);
+};
+
+static inline int __clk_get(struct clk *clk)
+{
+       return try_module_get(clk->owner);
+}
+
+static inline void __clk_put(struct clk *clk)
+{
+       module_put(clk->owner);
+}
+
+#endif