Re: [PATCH V3 2/3] dt-bindings: i2c: add attribute default-timing-adjust

From: Kewei Xu
Date: Wed Jul 14 2021 - 03:49:53 EST


On Mon, 2021-07-12 at 14:53 -0600, Rob Herring wrote:
> On Mon, Jun 21, 2021 at 06:39:44PM +0800, kewei.xu@xxxxxxxxxxxx wrote:
> > From: Kewei Xu <kewei.xu@xxxxxxxxxxxx>
> >
> > Add attribute default-timing-adjust for DT-binding document.
> >
> > Fixes: be5ce0e97cc7 ("i2c: mediatek: Add i2c ac-timing adjust support")
>
> You want to fix a kernel change with a DT change? That's not a
> compatible change (and I guess neither was the kernel change). Sounds
> like the above commit should be reverted and rethink how to add a new
> feature...
>
> > Signed-off-by: Kewei Xu <kewei.xu@xxxxxxxxxxxx>
> > ---
> > Documentation/devicetree/bindings/i2c/i2c-mt65xx.txt | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/i2c/i2c-mt65xx.txt b/Documentation/devicetree/bindings/i2c/i2c-mt65xx.txt
> > index 7c4915bc..7b80a11 100644
> > --- a/Documentation/devicetree/bindings/i2c/i2c-mt65xx.txt
> > +++ b/Documentation/devicetree/bindings/i2c/i2c-mt65xx.txt
> > @@ -33,6 +33,8 @@ Optional properties:
> > - mediatek,have-pmic: platform can control i2c form special pmic side.
> > Only mt6589 and mt8135 support this feature.
> > - mediatek,use-push-pull: IO config use push-pull mode.
> > + - mediatek,default-timing-adjust: use default timing calculation, no timing
> > + adjustment.
> >
> > Example:
> >
> > --
> > 1.9.1
> >
> >

Hi Rob,

In the commit be5ce0e97cc7 ("i2c: mediatek: Add i2c ac-timing adjust
support"), the I2C timing calculation has been revised to support
ac-timing adjustment.But in our design, it will make
tSU,STA/tHD,STA/tSU,STO shorter when the slave device have
clock-stretching feature.
Then we upload the commit a80f24945fcf ("i2c: mediatek: Use
scl_int_delay_ns to compensate clock-stretching") to support adjusting
tSU,STA/tHD,STA/tSU,STO when the slave device clock-stretching. But if
the slave device stretch the SCL line for too long time, our design
still cannot make tSU,STA/tHD,STA/tSU,STO meet spec.
However in the old (default) timing algorithm before the commit
be5ce0e97cc7 ("i2c: mediatek: Add i2c ac-timing adjust support"),
tSU,STA/tHD,STA/tSU,STO can meet spec. So we want to define a new
setting "default-adjust-timing" for using the old (default) timing
algorithm.

thanks
kewei