[PATCH v3 0/5] i2c: qcom-cci: Enforce the required CCI clock rate

From: Loic Poulain

Date: Wed Jul 29 2026 - 08:42:00 EST


The CCI hw_params timing values (thigh, tlow, etc.) are expressed in
clock ticks and are only valid at the specific CCI clock rate they were
calibrated for. Running at the wrong rate causes incorrect I2C timings
that may violate the I2C specification. Today the rate is left to the DT
(assigned-clock-rates) or the bootloader, which is fragile: the driver
owns the hw_params and should own the clock rate too.

- Move the msm8953 to reusing the common v2 config.
- Turn the timing table into a two-dimensional [mode][rate]
- Add the 19.2 MHz Standard/Fast timing sets for the v2 CCI
- Promote v2 to the generic common table for all revisions
- Actively enforce the required rate.

This ordering also addresses Vladimir's point that the clock rate is a
property of the mode/timing settings rather than of the CCI revision.
the per-mode [mode][rate] table lands first, and rate enforcement is
built on top of it.

Patches 2/5 and 4/5 are the result of discussions with Vladimir and
some code sharing. I would expect him to add a Co-developed-by and
corresponding Signed-off-by tag if he agrees that the submitted
implementation still matches his original intent.

Signed-off-by: Loic Poulain <loic.poulain@xxxxxxxxxxxxxxxx>
---
Changes in v3:
- Reorder the series so per-mode clock support comes before rate
enforcement. Introduce a [rate][mode] timing table and select the row
matching the running clock rate. (Vladimir)
- The per-mode patch only validates the running rate (error out on a
missing entry), the following patches enforce it.
- Split the addition of the v2 19.2 MHz Standard/Fast timings into its
own patch, keeping the [rate][mode] conversion a pure refactor.
- Drop the "Revert ... Remove unused struct member cci_clk_rate" patch:
the per-mode [mode][rate] table replaces cci_clk_rate entirely.
- Introduce a common params table (revision agnostic) (Vladimir)
- Link to v2: https://lore.kernel.org/r/20260727-cci-clk-fix-v2-0-c3958f28b045@xxxxxxxxxxxxxxxx

Changes in v2:
- Instead of adding a 19.2 MHz cci_clk_rate for msm8953, switch it to
the v2 config (37.5 MHz). The msm8953 table was internally
inconsistent (Standard/Fast for 19.2 MHz, Fast+ for 37.5 MHz), so a
single rate could not satisfy all modes. msm8953 is the same HW
version as msm8996/sdm630, which already use v2. (Vladimir)
- Remove the msm8953 fix tag (Vladimir)
- Apply the rate via the OPP framework instead of a bare clk_set_rate(),
managing the vote across runtime PM. (Konrad)
- Link to v1: https://lore.kernel.org/r/20260721-cci-clk-fix-v1-0-5eae78700da8@xxxxxxxxxxxxxxxx

---
Loic Poulain (5):
i2c: qcom-cci: Switch msm8953 to the CCI v2 timing/rate config
i2c: qcom-cci: Support per-mode CCI clock rates
i2c: qcom-cci: Add 19.2 MHz timings for the v2 CCI
i2c: qcom-cci: Share the timing table across CCI revisions
i2c: qcom-cci: Enforce the required CCI clock rate

drivers/i2c/busses/i2c-qcom-cci.c | 333 ++++++++++++++++++++++----------------
1 file changed, 195 insertions(+), 138 deletions(-)
---
base-commit: fce2dfa773ced15f27dd27cd0b482a7473cdcf2a
change-id: 20260721-cci-clk-fix-fe145b2acfa7

Best regards,
--
Loic Poulain <loic.poulain@xxxxxxxxxxxxxxxx>