[PATCH v2 06/19] i2c: designware_i2c: Use an accurate bus clock instead of MHz

Heiko Schocher hs at denx.de
Thu Jan 16 07:45:36 CET 2020


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 <sjg at 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 <hs at 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: hs at denx.de


More information about the U-Boot mailing list