FROMLIST: clk: rockchip: add new clock-type for the ddrclk
[firefly-linux-kernel-4.4.55.git] / drivers / clk / sunxi / clk-factors.h
index 441fdc3f57173f628639c336fb1cc8f6a38d3080..171085ab5513e4f724017d05d6f91929262a4f78 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <linux/clk-provider.h>
 #include <linux/clkdev.h>
+#include <linux/spinlock.h>
 
 #define SUNXI_FACTORS_NOT_APPLICABLE   (0)
 
@@ -18,11 +19,26 @@ struct clk_factors_config {
        u8 n_start;
 };
 
-struct clk *clk_register_factors(struct device *dev, const char *name,
-                                const char *parent_name,
-                                unsigned long flags, void __iomem *reg,
-                                struct clk_factors_config *config,
-                                void (*get_factors) (u32 *rate, u32 parent_rate,
-                                                     u8 *n, u8 *k, u8 *m, u8 *p),
-                                spinlock_t *lock);
+struct factors_data {
+       int enable;
+       int mux;
+       int muxmask;
+       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;
+       struct clk_factors_config *config;
+       void (*get_factors) (u32 *rate, u32 parent, u8 *n, u8 *k, u8 *m, u8 *p);
+       spinlock_t *lock;
+};
+
+struct clk *sunxi_factors_register(struct device_node *node,
+                                  const struct factors_data *data,
+                                  spinlock_t *lock,
+                                  void __iomem *reg);
+
 #endif