Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: qcom: gdsc: Add support for ALWAYS_ON gdscs

Some GDSCs might have software control to turn them off, but we might
want to keep them enabled always, in some cases because of lack of
support in kernel to handle a graceful turning off/on of such GDSCs.
Most common instances would be the GDCSs which power up the noc/bus
fabrics, which need bus drivers to handle them and atleast support for
which is missing on all qcom SoCs.

Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Tested-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>

authored by

Rajendra Nayak and committed by
Stephen Boyd
fb55bea1 60cc43fc

+9
+8
drivers/clk/qcom/gdsc.c
··· 291 291 if ((sc->flags & VOTABLE) && on) 292 292 gdsc_enable(&sc->pd); 293 293 294 + /* If ALWAYS_ON GDSCs are not ON, turn them ON */ 295 + if (sc->flags & ALWAYS_ON) { 296 + if (!on) 297 + gdsc_enable(&sc->pd); 298 + on = true; 299 + sc->pd.flags |= GENPD_FLAG_ALWAYS_ON; 300 + } 301 + 294 302 if (on || (sc->pwrsts & PWRSTS_RET)) 295 303 gdsc_force_mem_on(sc); 296 304 else
+1
drivers/clk/qcom/gdsc.h
··· 53 53 #define VOTABLE BIT(0) 54 54 #define CLAMP_IO BIT(1) 55 55 #define HW_CTRL BIT(2) 56 + #define ALWAYS_ON BIT(3) 56 57 struct reset_controller_dev *rcdev; 57 58 unsigned int *resets; 58 59 unsigned int reset_count;