Skip to content
Commit dd3c1602 authored by Simon Glass's avatar Simon Glass Committed by Heiko Schocher
Browse files

i2c: designware_i2c: Use an accurate bus clock instead of MHz



At present the driver uses an approximation for the bus clock, e.g. 166MHz
instead of 166 2/3 MHz.

This can result in small errors in the resulting I2C speed, perhaps 0.5%
or so.

Adjust the existing code to start from the accurate figure, even if later
rounding reduces this accuracy.

Update the bus speed code to work in KHz instead of MHz, which removes
most of the error.

Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
Reviewed-by: default avatarHeiko Schocher <hs@denx.de>
parent 65190d15
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment