From 5aef9fb6664c1c89ea5b551f2f226e4ec52303f9 Mon Sep 17 00:00:00 2001 From: Elaine Zhang Date: Fri, 5 Nov 2021 18:03:17 +0800 Subject: [PATCH] clk: gate: add clk_always_on for debug use: bootargs = "earlycon=uart8250,mmio32,0xfe660000 console=ttyFIQ0 clk_gate.always_on=y"; Signed-off-by: Elaine Zhang Change-Id: Iff38f71b31bf1de4b5e18bdaefd695d60cd2e124 --- drivers/clk/clk-gate.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/clk/clk-gate.c b/drivers/clk/clk-gate.c index 5a0d5b23a3bf..573c9ac4c454 100644 --- a/drivers/clk/clk-gate.c +++ b/drivers/clk/clk-gate.c @@ -16,6 +16,10 @@ #include #include +static bool clk_always_on; +module_param_named(always_on, clk_always_on, bool, 0644); +MODULE_PARM_DESC(always_on, "Always keep clks on except for system suspend."); + /** * DOC: basic gatable clock which can gate and ungate it's ouput * @@ -46,6 +50,9 @@ static void clk_gate_endisable(struct clk_hw *hw, int enable) unsigned long uninitialized_var(flags); u32 reg; + if (clk_always_on && !enable) + return; + set ^= enable; if (gate->lock)