diff options
| author | Loic Poulain <loic.poulain@oss.qualcomm.com> | 2026-09-29 14:25:49 +0200 |
|---|---|---|
| committer | Andi Shyti <andi.shyti@kernel.org> | 2026-10-04 16:33:00 +0200 |
| commit | fa1eb3af12fa71964ff965726bd65c69a76d1de7 (patch) | |
| tree | bf27845473180e3d0791a477154e691fa34ac655 /tools/lib/python | |
| parent | 826a1d134c3ea80d6cc2cd763bda7a374ae2be9f (diff) | |
| download | linux-next-fa1eb3af12fa71964ff965726bd65c69a76d1de7.tar.gz linux-next-fa1eb3af12fa71964ff965726bd65c69a76d1de7.zip | |
i2c: qcom-cci: Enforce the required CCI clock rate
The CCI hw_params timing values are only valid at the specific clock
rate they were calibrated for. A previous change made the driver select
the timing set matching the currently running clock rate, but the rate
itself was still left to the DT (assigned-clock-rates) or the bootloader,
which is fragile: if no rate is enforced the timings may not match and
violate the I2C specification.
Actively drive the CCI clock to the rate required by the configured
modes. The single CCI clock is shared by all masters, which may run in
different modes, so cci_get_required_rate() picks the lowest rate that
has a valid timing set for every active master's mode. This avoids
clocking the bus faster than necessary while still satisfying every
master (e.g. a Fast+ master forces 37.5 MHz).
Apply the rate through the OPP framework so that boards describing an
opp table also get the required power-domain/regulator votes for that rate.
Boards without an OPP table simply fall back to plain clk_set_rate()
behavior, so existing DTs keep working.
Drop the now-redundant hw_params[].thigh check in cci_get_hw_params(),
cci_get_required_rate() already rejects rates lacking a valid timing
set for an active master's mode.
Suggested-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Loic Poulain <loic.poulain@oss.qualcomm.com>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Link: https://patch.msgid.link/20260929-cci-clk-fix-v6-5-62a268cccb0f@oss.qualcomm.com
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions
