Hello Simon,

Am 03.01.2020 um 23:26 schrieb Simon Glass:
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: Simon Glass <s...@chromium.org>
---

Changes in v2: None

  drivers/i2c/designware_i2c.c | 18 ++++++++----------
  drivers/i2c/designware_i2c.h |  4 ++--
  2 files changed, 10 insertions(+), 12 deletions(-)

Reviewed-by: Heiko Schocher <h...@denx.de>

bye,
Heiko
--
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: h...@denx.de

Reply via email to