Skip to content
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

Improve reliability at higher bus speeds #6050

Merged
merged 1 commit into from Mar 18, 2024

Conversation

pelwell
Copy link
Contributor

@pelwell pelwell commented Mar 18, 2024

cea76e5 calculates timings for arbitrary clock speeds, but it does so aiming for a 50% SCL duty cycle. This is the wrong goal, particularly for high clock speeds, but it doesn't allow the device sufficient time to pull the bus low to issue an ACK.

Change the algorithm to aim for the minimum SCL high time (tHIGH) for the requested speed according to the I2C Specification, using linear interpolation between the values for the standard speeds.

[1] calculates timings for arbitrary clock speeds, but it does so aiming
for a 50% SCL duty cycle. This is the wrong goal, particularly for high
clock speeds, because it doesn't allow the device sufficient time to
pull the bus low to issue an ACK.

Change the algorithm to aim for the minimum SCL high time (tHIGH) for
the requested speed according to the I2C Specification, using linear
interpolation between the values for the standard speeds.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>

[1] commit cea76e5 ("i2c: designware: Support non-standard bus speeds")
@pelwell pelwell merged commit 6a38c69 into raspberrypi:rpi-6.6.y Mar 18, 2024
12 checks passed
popcornmix added a commit to raspberrypi/firmware that referenced this pull request Mar 19, 2024
See: raspberrypi/linux#6054

kernel: overlays: i2c-rtc: pcf8563 supports wakeup-source
See: raspberrypi/linux#6052

kernel: ARM: dts: bcm2712: Move /soc/sound to bcm2712-rpi
See: raspberrypi/linux#6051

kernel: I2C: Improve reliability at higher bus speeds
See: raspberrypi/linux#6050

kernel: dmaengine: dw-axi-dmac: Fix a non-atomic update
See: raspberrypi/linux#6044

kernel: dtoverlays: Add a disconnect_on_idle override to i2c-mux
See: raspberrypi/linux#6040

kernel: Add support for generic i2c-mux base-nr property
See: raspberrypi/linux#6038

kernel: dtoverlays: Fixup pendown gpio polarity for ads7846 users
See: raspberrypi/linux#6029
popcornmix added a commit to raspberrypi/rpi-firmware that referenced this pull request Mar 19, 2024
See: raspberrypi/linux#6054

kernel: overlays: i2c-rtc: pcf8563 supports wakeup-source
See: raspberrypi/linux#6052

kernel: ARM: dts: bcm2712: Move /soc/sound to bcm2712-rpi
See: raspberrypi/linux#6051

kernel: I2C: Improve reliability at higher bus speeds
See: raspberrypi/linux#6050

kernel: dmaengine: dw-axi-dmac: Fix a non-atomic update
See: raspberrypi/linux#6044

kernel: dtoverlays: Add a disconnect_on_idle override to i2c-mux
See: raspberrypi/linux#6040

kernel: Add support for generic i2c-mux base-nr property
See: raspberrypi/linux#6038

kernel: dtoverlays: Fixup pendown gpio polarity for ads7846 users
See: raspberrypi/linux#6029
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants