-
Notifications
You must be signed in to change notification settings - Fork 6.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
i2c: Update API to support arbitrary bus speed values #4039
Comments
Values in DT are already arbitrary integers, this requires a change in |
API Meeting 19th May:
|
Yes, I believe we should support arbitrary bus speeds as defined by the standard, even if it requires API change. There are a few more API modifications which might be worth doing. I added a comment to #4040. |
This has been fixed, at least for most people, with #42812 which allows arbitrary but statically defined scl rates without breaking the API Dynamically changing the clock to arbitrary values is probably error prone as not every clock value is going to be valid. |
I'm considering this closed as I2C speeds are set per bus rather than per device, and DT_SPEED enables just that. |
Reported by Piotr Mienkowski:
As defined by I2C standard: "The minimum HIGH and LOW periods of the SCL clock specified in Table 10 determine the maximum bit transfer rates of 100 kbit/s for Standard-mode devices, 400 kbit/s for Fast-mode devices, and 1000 kbit/s for Fast-mode Plus. Devices must be able to follow transfers at their own maximum bit rates, either by being able to transmit or receive at that speed or by applying the clock synchronization procedure". Thus the standard does not require that devices always run at the maximum speed allowed at any given mode.
Current I2C API does not allow to set an arbitrary I2C bus speed instead it is using a bit-field encoded value to always select a maximum one.
Recently I2C drivers were updated to use DTS which, based on the existing Linux definitions, allows to set an arbitrary bus speed value. The existing DTS support is only partial since the DTS provided values are only accepted if they match maximum allowed speed.
I2C API should be updated to support arbitrary bus speed values.
(Imported from Jira ZEP-2611)
The text was updated successfully, but these errors were encountered: