[PATCH 2/2] i2c: qcom-cci: Add DT property for SCL clock stretching
From: Cory Keitz via B4 Relay
Date: Thu Mar 05 2026 - 09:42:06 EST
From: Cory Keitz <ckeitz@xxxxxxxxxx>
The CCI hardware supports an SCL clock stretch enable bit in the
MISC_CTL register, but the driver hardcodes it off for most SoC
variants. This makes the bus driver unstable for configurations which
rely on clock stretching. Notably, GMSL uses clock stretching to absorb
the latency of transaction forwarding across the link.
Add a per-master "qcom,scl-stretch-enable" boolean DT property that
ORs with the existing hw_params default, allowing clock stretching to
be enabled on individual CCI masters without affecting others.
Signed-off-by: Cory Keitz <ckeitz@xxxxxxxxxx>
---
drivers/i2c/busses/i2c-qcom-cci.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/i2c/busses/i2c-qcom-cci.c b/drivers/i2c/busses/i2c-qcom-cci.c
index 884055df1560..022c10b310a0 100644
--- a/drivers/i2c/busses/i2c-qcom-cci.c
+++ b/drivers/i2c/busses/i2c-qcom-cci.c
@@ -111,6 +111,7 @@ struct cci_master {
struct i2c_adapter adap;
u16 master;
u8 mode;
+ bool scl_stretch_en;
int status;
struct completion irq_complete;
struct cci *cci;
@@ -284,7 +285,8 @@ static int cci_init(struct cci *cci)
val = hw->tbuf;
writel(val, cci->base + CCI_I2C_Mm_SDA_CTL_2(i));
- val = hw->scl_stretch_en << 8 | hw->trdhld << 4 | hw->tsp;
+ val = (hw->scl_stretch_en | cci->master[i].scl_stretch_en) << 8 |
+ hw->trdhld << 4 | hw->tsp;
writel(val, cci->base + CCI_I2C_Mm_MISC_CTL(i));
}
@@ -572,6 +574,9 @@ static int cci_probe(struct platform_device *pdev)
master->mode = I2C_MODE_FAST_PLUS;
}
+ master->scl_stretch_en =
+ of_property_read_bool(child, "qcom,scl-stretch-enable");
+
init_completion(&master->irq_complete);
}
--
2.47.3