summaryrefslogtreecommitdiffstats
path: root/drivers/clk/sprd/gate.h
diff options
context:
space:
mode:
authorChunyan Zhang <chunyan.zhang@unisoc.com>2020-05-27 13:36:35 +0800
committerStephen Boyd <sboyd@kernel.org>2020-05-26 23:41:14 -0700
commit8b4f6b8d59c614477ce65da15a4f5ddc31b2c398 (patch)
tree6ce63204cf6ca568ebbbf41c12cf746cbe009cdf /drivers/clk/sprd/gate.h
parentc2f30986d418f26abefc2eec90ebf06716c970d2 (diff)
downloadlinux-8b4f6b8d59c614477ce65da15a4f5ddc31b2c398.tar.bz2
clk: sprd: check its parent status before reading gate clock
Some clocks only can be accessed if their parent is enabled. mipi_csi_xx clocks on SC9863A are an examples. We have to ensure the parent clock is enabled when reading those clocks. Signed-off-by: Chunyan Zhang <chunyan.zhang@unisoc.com> Link: https://lkml.kernel.org/r/20200527053638.31439-2-zhang.lyra@gmail.com Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'drivers/clk/sprd/gate.h')
-rw-r--r--drivers/clk/sprd/gate.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/clk/sprd/gate.h b/drivers/clk/sprd/gate.h
index b55817869367..e738dafa4fe9 100644
--- a/drivers/clk/sprd/gate.h
+++ b/drivers/clk/sprd/gate.h
@@ -19,6 +19,15 @@ struct sprd_gate {
struct sprd_clk_common common;
};
+/*
+ * sprd_gate->flags is used for:
+ * CLK_GATE_SET_TO_DISABLE BIT(0)
+ * CLK_GATE_HIWORD_MASK BIT(1)
+ * CLK_GATE_BIG_ENDIAN BIT(2)
+ * so we define new flags from BIT(3)
+ */
+#define SPRD_GATE_NON_AON BIT(3) /* not alway powered on, check before read */
+
#define SPRD_SC_GATE_CLK_HW_INIT_FN(_struct, _name, _parent, _reg, \
_sc_offset, _enable_mask, _flags, \
_gate_flags, _udelay, _ops, _fn) \