@@ -8,3 +8,7 @@ config HAVE_MACH_CLKDEV
config GENERIC_CLK
bool
+
+config GENERIC_CLK_FIXED
+ bool
+ depends on GENERIC_CLK
@@ -1,3 +1,4 @@
obj-$(CONFIG_CLKDEV_LOOKUP) += clkdev.o
obj-$(CONFIG_GENERIC_CLK) += clk.o
+obj-$(CONFIG_GENERIC_CLK_FIXED) += clk-fixed.o
new file mode 100644
@@ -0,0 +1,17 @@
+
+#include <linux/clk.h>
+#include <linux/module.h>
+
+#define to_clk_fixed(c) container_of(c, struct clk_hw_fixed, hw)
+
+static unsigned long clk_fixed_recalc_rate(struct clk_hw *hw)
+{
+ return to_clk_fixed(hw)->rate;
+}
+
+struct clk_hw_ops clk_fixed_ops = {
+ .recalc_rate = clk_fixed_recalc_rate,
+};
+EXPORT_SYMBOL_GPL(clk_fixed_ops);
+
+
@@ -110,6 +110,20 @@ int clk_prepare(struct clk *clk);
*/
void clk_unprepare(struct clk *clk);
+/* Base clock implementations. Platform clock implementations can use these
+ * directly, or 'subclass' as approprate */
+
+#ifdef CONFIG_GENERIC_CLK_FIXED
+
+struct clk_hw_fixed {
+ struct clk_hw hw;
+ unsigned long rate;
+};
+
+extern struct clk_hw_ops clk_fixed_ops;
+
+#endif /* CONFIG_GENERIC_CLK_FIXED */
+
#else /* !CONFIG_GENERIC_CLK */
/*