clk: qcom: regmap-phy-mux: Rework the implementation
authorKonrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Thu, 9 Apr 2026 11:57:45 +0000 (13:57 +0200)
committerBjorn Andersson <andersson@kernel.org>
Mon, 8 Jun 2026 14:17:24 +0000 (09:17 -0500)
commite108373c54fbc844b7f541c6fd7ecb31772afd3c
treee3ab735faec7eba8a04451daec0dee99b77621ff
parentbb56147ea9fce98ebde1d367335ba006cba61fbd
clk: qcom: regmap-phy-mux: Rework the implementation

The sole reason this hw exists is to let the branch clock downstream of
it keep running, with the PHY disengaged. This is not possible with the
current implementation, as the enabled status is hijacked to mean
"enabled" = "use fast/PHY source" and "disabled" = "use XO source".

This is an issue, since the mux enable state follows that of the child
branch, making the desired "child enabled, MUX @ XO" combination
impossible.

Solve that by implementing ratesetting. Because PHY clock rates may
change at runtime and aren't really deterministic from Linux, assume
ULONG_MAX as "fast clock" and 19.2 MHz as XO. All the branches in
question already set CLK_SET_RATE_PARENT, so everything works out.

Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20260409-topic-phy_fastclk-v1-1-6b4aaee56b90@oss.qualcomm.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
drivers/clk/qcom/clk-regmap-phy-mux.c