summaryrefslogtreecommitdiffstats
path: root/drivers/clk/sprd/div.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/clk/sprd/div.h')
-rw-r--r--drivers/clk/sprd/div.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/clk/sprd/div.h b/drivers/clk/sprd/div.h
index f5d614b3dcf1..a0bcad80498f 100644
--- a/drivers/clk/sprd/div.h
+++ b/drivers/clk/sprd/div.h
@@ -20,12 +20,14 @@
* classes.
*/
struct sprd_div_internal {
+ s32 offset;
u8 shift;
u8 width;
};
-#define _SPRD_DIV_CLK(_shift, _width) \
+#define _SPRD_DIV_CLK(_offset, _shift, _width) \
{ \
+ .offset = _offset, \
.shift = _shift, \
.width = _width, \
}
@@ -35,10 +37,10 @@ struct sprd_div {
struct sprd_clk_common common;
};
-#define SPRD_DIV_CLK_HW_INIT_FN(_struct, _name, _parent, _reg, \
+#define SPRD_DIV_CLK_HW_INIT_FN(_struct, _name, _parent, _reg, _offset, \
_shift, _width, _flags, _fn) \
struct sprd_div _struct = { \
- .div = _SPRD_DIV_CLK(_shift, _width), \
+ .div = _SPRD_DIV_CLK(_offset, _shift, _width), \
.common = { \
.regmap = NULL, \
.reg = _reg, \
@@ -49,12 +51,17 @@ struct sprd_div {
#define SPRD_DIV_CLK(_struct, _name, _parent, _reg, \
_shift, _width, _flags) \
- SPRD_DIV_CLK_HW_INIT_FN(_struct, _name, _parent, _reg, \
+ SPRD_DIV_CLK_HW_INIT_FN(_struct, _name, _parent, _reg, 0x0, \
_shift, _width, _flags, CLK_HW_INIT)
+#define SPRD_DIV_CLK_FW_NAME(_struct, _name, _parent, _reg, \
+ _shift, _width, _flags) \
+ SPRD_DIV_CLK_HW_INIT_FN(_struct, _name, _parent, _reg, 0x0, \
+ _shift, _width, _flags, CLK_HW_INIT_FW_NAME)
+
#define SPRD_DIV_CLK_HW(_struct, _name, _parent, _reg, \
_shift, _width, _flags) \
- SPRD_DIV_CLK_HW_INIT_FN(_struct, _name, _parent, _reg, \
+ SPRD_DIV_CLK_HW_INIT_FN(_struct, _name, _parent, _reg, 0x0, \
_shift, _width, _flags, CLK_HW_INIT_HW)
static inline struct sprd_div *hw_to_sprd_div(const struct clk_hw *hw)