Re: [PATCH] i2c: designware: Get HCNT/LCNT values from dts

Andy Shevchenko
2021-11-15T10:28:40Z

On Mon, Nov 15, 2021 at 12:19:26PM +0200, Andy Shevchenko wrote:
> On Mon, Nov 15, 2021 at 10:35:55AM +0100, Lawrence,Wang wrote:
> > From: "Wang, Lawrence" <lawrence.wang@nokia-sbell.com>
> >
> > Current code support config the HCNT/LCNT only via ACPI method. for those
> > platform that not support ACPI, will get the HCNT/LCNT value based on input
> > clock. But it is not always accuracy. for example in some platform will get
> > lower speed(320khz) in fast mode, and get faster speed(105khz/even more) in
> > standard mode.
> >
> > This patch makes it possible for the non-ACPI platform to pass more optimal
> > HCNT/LCNT values to the core driver via dts if they are known beforehand.
> > If these are not set we use the calculated values.
>
> Besides the fact it misses DT schema update, why this is needed at all?
> What's wrong with the existing DT timings?

Just for your convenience an excerpt from
Documentation/devicetree/bindings/i2c/i2c.txt

- i2c-scl-falling-time-ns
Number of nanoseconds the SCL signal takes to fall; t(f) in the I2C
specification.

- i2c-scl-internal-delay-ns
Number of nanoseconds the IP core additionally needs to setup SCL.

- i2c-scl-rising-time-ns
Number of nanoseconds the SCL signal takes to rise; t(r) in the I2C
specification.

- i2c-sda-falling-time-ns
Number of nanoseconds the SDA signal takes to fall; t(f) in the I2C
specification.