Linux has clk_register_divider() and clk_register_divider_table(). Add
the same functions with the same prototypes for barebox to ease code
porting from Linux.

Signed-off-by: Sascha Hauer <[email protected]>
---
 drivers/clk/clk-divider.c | 19 +++++++++++++++++++
 include/linux/clk.h       |  9 +++++++++
 2 files changed, 28 insertions(+)

diff --git a/drivers/clk/clk-divider.c b/drivers/clk/clk-divider.c
index 080aaa58a2..1b61a9edfb 100644
--- a/drivers/clk/clk-divider.c
+++ b/drivers/clk/clk-divider.c
@@ -409,3 +409,22 @@ struct clk *clk_divider_table(const char *name, const char 
*parent,
 
        return &div->hw.clk;
 }
+
+struct clk *clk_register_divider_table(struct device_d *dev, const char *name,
+               const char *parent_name, unsigned long flags,
+               void __iomem *reg, u8 shift, u8 width,
+               u8 clk_divider_flags, const struct clk_div_table *table,
+               spinlock_t *lock)
+{
+       return clk_divider_table(name, parent_name, flags, reg, shift, width,
+                                table, clk_divider_flags);
+}
+
+struct clk *clk_register_divider(struct device_d *dev, const char *name,
+               const char *parent_name, unsigned long flags,
+               void __iomem *reg, u8 shift, u8 width,
+               u8 clk_divider_flags, spinlock_t *lock)
+{
+       return clk_divider(name, parent_name, flags, reg, shift, width,
+                          clk_divider_flags);
+}
diff --git a/include/linux/clk.h b/include/linux/clk.h
index 85242b3bbc..04dd4b0116 100644
--- a/include/linux/clk.h
+++ b/include/linux/clk.h
@@ -475,6 +475,10 @@ void clk_divider_free(struct clk *clk_divider);
 struct clk *clk_divider(const char *name, const char *parent,
                        unsigned clk_flags, void __iomem *reg, u8 shift,
                        u8 width, unsigned div_flags);
+struct clk *clk_register_divider(struct device_d *dev, const char *name,
+               const char *parent_name, unsigned long flags,
+               void __iomem *reg, u8 shift, u8 width,
+               u8 clk_divider_flags, spinlock_t *lock);
 struct clk *clk_divider_one_based(const char *name, const char *parent,
                                  unsigned clk_flags, void __iomem *reg,
                                  u8 shift, u8 width, unsigned div_flags);
@@ -482,6 +486,11 @@ struct clk *clk_divider_table(const char *name, const char 
*parent,
                              unsigned clk_flags, void __iomem *reg, u8 shift,
                              u8 width, const struct clk_div_table *table,
                              unsigned div_flags);
+struct clk *clk_register_divider_table(struct device_d *dev, const char *name,
+               const char *parent_name, unsigned long flags,
+               void __iomem *reg, u8 shift, u8 width,
+               u8 clk_divider_flags, const struct clk_div_table *table,
+               spinlock_t *lock);
 
 struct clk_fixed_factor {
        struct clk_hw hw;
-- 
2.29.2


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

Reply via email to