v1 -> v2: - Use CLK_IS_CRITICAL instead of leaving a clk enable vote, expand macros to do so - Fix the keepalive clocks for 8998 & 660 (CNoC -> PNoC, it was confusingly named cnoc_periph downstream) - Introduce .determinte_rate to ensure we don't set keepalive clocks' rates below 19.2 MHz - Add a (!conditional!) way to test the ultimate goal of all these changes by essentially enabling unused clk cleanup through a dt property (for legacy reasons) v2 was tested on: - MSM8996 Sony Kagura (can disable unused) - MSM8998 Sony Maple (can disable unused with OOT icc) - SM6375 Sony PDX225 (can disable unused with OOT icc) v1: https://lore.kernel.org/r/20230303-topic-rpmcc_sleep-v1-0-d9cfaf9b27a7@xxxxxxxxxx This series brings support for a couple of things necessary for the full system idle on SMD RPM SoCs, namely unused clk shutdown and keepalive votes (permanent active votes that are required on certain clocks for the platform to function). Tested on MSM8996 and SM6375, does not seem to introduce any additional regressions. Keepalive clocks for other platforms were gathered by digging in old downstream kernels, please give them a test. Signed-off-by: Konrad Dybcio <konrad.dybcio@xxxxxxxxxx> --- Konrad Dybcio (11): dt-bindings: clock: qcom,rpmcc: Add a way to enable unused clock cleanup clk: qcom: smd-rpm_ Make __DEFINE_CLK_SMD_RPM_BRANCH_PREFIX accept flags clk: qcom: smd-rpm: Make DEFINE_CLK_SMD_RPM_BRANCH_A accept flags clk: qcom: smd-rpm: Make BI_TCXO_AO critical clk: qcom: smd-rpm: Make __DEFINE_CLK_SMD_RPM_PREFIX accept flags clk: qcom: smd-rpm: Separate out a macro for defining an AO clock clk: qcom: smd-rpm: Add support for keepalive votes clk: qcom: smd-rpm: Introduce DEFINE_CLK_SMD_RPM_BUS_KEEPALIVE clk: qcom: smd-rpm: Hook up PCNoC_0 keep_alive clk: qcom: smd-rpm: Hook up CNoC_1 and SNoC_2 keep_alive arm64: dts: qcom: msm8996: Enable rpmcc unused clk disablement Shawn Guo (3): clk: qcom: smd-rpm: Add .is_enabled hook clk: qcom: smd-rpm: Add .is_prepared hook clk: qcom: smd-rpm: Mark clock enabled in clk_smd_rpm_handoff() .../devicetree/bindings/clock/qcom,rpmcc.yaml | 6 + arch/arm64/boot/dts/qcom/msm8996.dtsi | 1 + drivers/clk/qcom/clk-smd-rpm.c | 133 +++++++++++++++------ 3 files changed, 106 insertions(+), 34 deletions(-) --- base-commit: fc31900c948610e7b5c2f15fb7795832c8325327 change-id: 20230303-topic-rpmcc_sleep-d67aad9f3012 Best regards, -- Konrad Dybcio <konrad.dybcio@xxxxxxxxxx>