Taniya Das
165d0b6dd2
clk: qcom: clk_mem_branch: add enable mask and invert flags
...
Introduce mem_enable_mask and mem_enable_invert in clk_mem_branch to
describe memory gating implementations that use a separate mask and/or
inverted enable logic. This documents hardware behavior in data instead
of code and will be used by upcoming platform descriptions.
Signed-off-by: Taniya Das <taniya.das@oss.qualcomm.com >
Reviewed-by: Imran Shaik <imran.shaik@oss.qualcomm.com >
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com >
Link: https://lore.kernel.org/r/20251118-sm8750-videocc-v2-v4-1-049882a70c9f@oss.qualcomm.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org >
2025-11-18 10:30:43 -06:00
Luo Jie
7311bbfff3
clk: qcom: branch: Add clk_branch2_prepare_ops
...
Add the clk_branch2_prepare_ops for supporting clock controller
where the hardware register is accessed by MDIO bus, and the
spin lock can't be used because of sleep during the MDIO
operation.
The clock is enabled by the .prepare instead of .enable when
the clk_branch2_prepare_ops is used.
Acked-by: Stephen Boyd <sboyd@kernel.org >
Signed-off-by: Luo Jie <quic_luoj@quicinc.com >
Link: https://lore.kernel.org/r/20240605124541.2711467-2-quic_luoj@quicinc.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org >
2024-06-12 23:04:26 -05:00
Konrad Dybcio
a58009dc6f
clk: qcom: branch: Add a helper for setting the enable bit
...
We hardcode some clocks to be always-on, as they're essential to the
functioning of the SoC / some peripherals. Add a helper to do so
to make the writes less magic.
Reviewed-by: Johan Hovold <johan+linaro@kernel.org >
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org >
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Link: https://lore.kernel.org/r/20240212-topic-clk_branch_en-v7-1-5b79eb7278b2@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org >
2024-02-14 11:59:07 -06:00
Taniya Das
261625e0ba
clk: qcom: branch: Add mem ops support for branch2 clocks
...
Add the support for mem ops implementation to handle the sequence of
enable/disable of the memories in ethernet PHY, prior to enable/disable
of the respective clocks, which helps retain the respecive block's
register contents.
Signed-off-by: Taniya Das <quic_tdas@quicinc.com >
Signed-off-by: Imran Shaik <quic_imrashai@quicinc.com >
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Link: https://lore.kernel.org/r/20231123064735.2979802-3-quic_imrashai@quicinc.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org >
2023-12-07 08:47:05 -08:00
Konrad Dybcio
b96fbb03fb
clk: qcom: branch: Clean up branch enable registers
...
Prefix the "branch enable" registers with CBCR_ to be closer to what
they are actually called in Qualcomm terms, use GENMASK instead of
shifting values around and adjust their usage accordingly.
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Signed-off-by: Bjorn Andersson <andersson@kernel.org >
Link: https://lore.kernel.org/r/20230208091340.124641-5-konrad.dybcio@linaro.org
2023-03-13 12:59:44 -07:00
Konrad Dybcio
5ab6561da9
clk: qcom: branch: Move CBCR bits definitions to the header file
...
Move the definitions of CBCR bits to the branch header file.
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Signed-off-by: Bjorn Andersson <andersson@kernel.org >
Link: https://lore.kernel.org/r/20230208091340.124641-4-konrad.dybcio@linaro.org
2023-03-13 12:59:44 -07:00
Konrad Dybcio
0932e565ba
clk: qcom: branch: Add helper functions for setting SLEEP/WAKE bits
...
HLOS-controlled branch clocks on non-ancient Qualcomm platforms
feature SLEEP and WAKE fields which can be written to to configure
how long the clock hardware should wait internally before being
(un)gated. Some very sensitive clocks need to have these values
programmed to prevent putting the hardware in a not-exactly-good
state. Add definitions of these fields and introduce helpers for
setting them inside clock drivers.
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Signed-off-by: Bjorn Andersson <andersson@kernel.org >
Link: https://lore.kernel.org/r/20230208091340.124641-3-konrad.dybcio@linaro.org
2023-03-13 12:59:44 -07:00
Konrad Dybcio
b594e6f660
clk: qcom: branch: Add helper functions for setting retain bits
...
Most Qualcomm branch clocks come with a pretty usual set of bits that
can enable memory retention by means of not turning off parts of the
memory logic. Add them to the common header file and introduce helper
functions for setting them instead of using magic writes.
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Signed-off-by: Bjorn Andersson <andersson@kernel.org >
Link: https://lore.kernel.org/r/20230208091340.124641-2-konrad.dybcio@linaro.org
2023-03-13 12:59:44 -07:00
Bjorn Andersson
360fed4228
clk: qcom: branch: Add AON clock ops
...
Some clocks can only be turned on by resetting the block containing
them, provide a clock type that allow us to reference these clocks and
have the client drivers enable and "disable" them.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
Signed-off-by: Stephen Boyd <sboyd@kernel.org >
2019-04-11 13:34:21 -07:00
Taniya Das
f9419783a6
clk: qcom: Update SPDX headers for common files
...
SPDX headers updated for common/branch/pll/regmap files.
Signed-off-by: Taniya Das <tdas@codeaurora.org >
Signed-off-by: Stephen Boyd <sboyd@kernel.org >
2018-07-25 09:23:33 -07:00
Amit Nischal
7d99ced8f4
clk: qcom: Add support for BRANCH_HALT_SKIP flag for branch clocks
...
There could be few clocks where the clock status bit is not
required to be polled as the clock on/off would be controlled
by enabling/disabling external source. Add support for the
same by introducing new flag named as 'BRANCH_HALT_SKIP'.
Signed-off-by: Amit Nischal <anischal@codeaurora.org >
[sboyd@kernel.org: Rename flag to BRANCH_HALT_SKIP]
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
2018-05-08 11:22:55 -07:00
Stephen Boyd
6e0ad1b6c1
clk: qcom: Add support for branches/gate clocks
...
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org >
Signed-off-by: Mike Turquette <mturquette@linaro.org >
2014-01-16 12:01:01 -08:00