]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
clk: qcom: gdsc: Add set and get hwmode callbacks to switch GDSC mode
authorJagadeesh Kona <quic_jkona@quicinc.com>
Mon, 24 Jun 2024 04:48:07 +0000 (10:18 +0530)
committerUlf Hansson <ulf.hansson@linaro.org>
Tue, 9 Jul 2024 10:59:58 +0000 (12:59 +0200)
commitf7ccdaad612a093c4a7c1840245c77eaffce09ab
tree3fc96c18023e362fb58dede2f55130dba0f3e1fc
parent0155aaf95a2a09bad567e5f775bfa8559e79f395
clk: qcom: gdsc: Add set and get hwmode callbacks to switch GDSC mode

Some GDSC client drivers require the GDSC mode to be switched dynamically
to HW mode at runtime to gain the power benefits. Typically such client
drivers require the GDSC to be brought up in SW mode initially to enable
the required dependent clocks and configure the hardware to proper state.
Once initial hardware set up is done, they switch the GDSC to HW mode to
save power. At the end of usecase, they switch the GDSC back to SW mode
and disable the GDSC.

Introduce HW_CTRL_TRIGGER flag to register the set_hwmode_dev and
get_hwmode_dev callbacks for GDSC's whose respective client drivers
require the GDSC mode to be switched dynamically at runtime using
dev_pm_genpd_set_hwmode() API.

Signed-off-by: Jagadeesh Kona <quic_jkona@quicinc.com>
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Reviewed-by: Taniya Das <quic_tdas@quicinc.com>
Reviewed-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20240624044809.17751-4-quic_jkona@quicinc.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/clk/qcom/gdsc.c
drivers/clk/qcom/gdsc.h