Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[sfrench/cifs-2.6.git] / drivers / clk / sunxi / clk-factors.h
index d2d0efa39379985f284387d87bba2159627480b1..9913840018d3fdb4f4717a4636b68f8dc6f4a6e6 100644 (file)
@@ -3,9 +3,12 @@
 
 #include <linux/clk-provider.h>
 #include <linux/clkdev.h>
+#include <linux/spinlock.h>
 
 #define SUNXI_FACTORS_NOT_APPLICABLE   (0)
 
+#define SUNXI_FACTORS_MUX_MASK 0x3
+
 struct clk_factors_config {
        u8 nshift;
        u8 nwidth;
@@ -18,6 +21,14 @@ struct clk_factors_config {
        u8 n_start;
 };
 
+struct factors_data {
+       int enable;
+       int mux;
+       struct clk_factors_config *table;
+       void (*getter) (u32 *rate, u32 parent_rate, u8 *n, u8 *k, u8 *m, u8 *p);
+       const char *name;
+};
+
 struct clk_factors {
        struct clk_hw hw;
        void __iomem *reg;
@@ -26,5 +37,8 @@ struct clk_factors {
        spinlock_t *lock;
 };
 
-extern const struct clk_ops clk_factors_ops;
+struct clk * __init sunxi_factors_register(struct device_node *node,
+                                          const struct factors_data *data,
+                                          spinlock_t *lock);
+
 #endif