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

i2c: designware_i2c: Rewrite timing calculation



At present the driver can end up with timing parameters which are slightly
faster than those expected. It is possible to optimise the parameters to
get the best possible result.

Create a new function to handle the timing calculation. This uses a table
of defaults for each speed mode rather than writing it in code.

The function works by calculating the 'period' of each bit on the bus in
terms of the input clock to the controller (IC_CLK). It makes sure that
the constraints are met and that the different components of that period
add up correctly.

This code was taken from coreboot which has ended up with this same
driver, but now in a much-different form.

Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
Reviewed-by: default avatarHeiko Schocher <hs@denx.de>
parent 31adb873
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