summaryrefslogtreecommitdiff
path: root/drivers/clk/spacemit/ccu_mix.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/clk/spacemit/ccu_mix.h')
-rw-r--r--drivers/clk/spacemit/ccu_mix.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/clk/spacemit/ccu_mix.h b/drivers/clk/spacemit/ccu_mix.h
index c406508e3504..dbba9bf49b3b 100644
--- a/drivers/clk/spacemit/ccu_mix.h
+++ b/drivers/clk/spacemit/ccu_mix.h
@@ -16,9 +16,11 @@
*
* @mask: Mask to enable the gate. Some clocks may have more than one bit
* set in this field.
+ * @inverted: Enable bit is inverted, 1 - disable clock, 0 - enable clock
*/
struct ccu_gate_config {
u32 mask;
+ bool inverted;
};
struct ccu_factor_config {
@@ -48,6 +50,7 @@ struct ccu_mix {
#define CCU_FACTOR_INIT(_div, _mul) { .div = _div, .mul = _mul }
#define CCU_MUX_INIT(_shift, _width) { .shift = _shift, .width = _width }
#define CCU_DIV_INIT(_shift, _width) { .shift = _shift, .width = _width }
+#define CCU_GATE_FLAGS_INIT(_mask, _inverted) { .mask = _mask, .inverted = _inverted }
#define CCU_PARENT_HW(_parent) { .hw = &_parent.common.hw }
#define CCU_PARENT_NAME(_name) { .fw_name = #_name }
@@ -101,6 +104,15 @@ static struct ccu_mix _name = { \
} \
}
+#define CCU_GATE_FLAGS_DEFINE(_name, _parent, _reg_ctrl, _mask_gate, _inverted, _flags) \
+static struct ccu_mix _name = { \
+ .gate = CCU_GATE_FLAGS_INIT(_mask_gate, _inverted), \
+ .common = { \
+ .reg_ctrl = _reg_ctrl, \
+ CCU_MIX_INITHW(_name, _parent, spacemit_ccu_gate_ops, _flags), \
+ } \
+}
+
#define CCU_FACTOR_GATE_FLAGS_DEFINE(_name, _parent, _reg_ctrl, _mask_gate, _div, \
_mul, _flags) \
static struct ccu_mix _name = { \