Signed-off-by: Alexander Shiyan <shc_work@xxxxxxx> --- drivers/clk/clk-gate.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/drivers/clk/clk-gate.c b/drivers/clk/clk-gate.c index 2dca11c..580720b 100644 --- a/drivers/clk/clk-gate.c +++ b/drivers/clk/clk-gate.c @@ -48,9 +48,17 @@ static void clk_gate_disable(struct clk *clk) writel(val, g->reg); } +static int clk_gate_is_enabled(struct clk *clk) +{ + struct clk_gate *g = container_of(clk, struct clk_gate, clk); + + return !!(readl(g->reg) & (1 << g->shift)); +} + struct clk_ops clk_gate_ops = { .enable = clk_gate_enable, .disable = clk_gate_disable, + .is_enabled = clk_gate_is_enabled, }; struct clk *clk_gate(const char *name, const char *parent, void __iomem *reg, -- 1.7.3.4 _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox