Closed ashyti closed 1 year ago
v2 -> v3 Changed "i2c-scl-clk-low-timeout-ms" to "i2c-scl-clk-low-timeout-us" (milliseconds to microseconds) in order to reduce code impact and fix the inconsistency generated. (Thanks krzk!)
v1 -> v2 Added the allOf as recommended by Krzsysztof and added the "type: boolean" under the "i2c-scl-has-clk-low-timeout" that I forgot.
I'm not sure how to log things in github, but meantime I made 2 force pushes:
In the future, please just rebase your branch instead of opening a new PR each time.
The I2C specification allows for the clock line to be held low for a specified timeout to force the slave device into a 'wait' mode. This feature is known as 'Clock stretching' and is optional.
In the NXP I2C specification, clock stretching is described as the process of pausing a transaction by holding the SCL line LOW. The transaction can only continue when the line is released HIGH again.[*] However, most target devices do not include an SCL driver and are therefore unable to stretch the clock.
Add the following properties:
i2c-scl-clk-low-timeout-us: This property specifies the duration, in microseconds, for which the clock is kept low and a client needs to detect a forced waiting state.
i2c-scl-has-clk-low-timeout: This property specifies whether the I2C controller implements the clock stretching property.
It's important to note that this feature should not be confused with the SMBUS clock timeout, which serves a similar function but specifies a timeout of 25-35ms. The I2C specification does not recommend any specific timeout.
[*] NXP, UM10204 - I2C-bus specification and user manual Rev. 7.0, 1 October 2021, chapter 3.1.9.