]> git.kernelconcepts.de Git - karo-tx-uboot.git/commit
i2c: mvtwsi: Fix problem with baud rate calculation
authorStefan Roese <sr@denx.de>
Wed, 18 Mar 2015 08:30:54 +0000 (09:30 +0100)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 1 Sep 2015 12:34:14 +0000 (14:34 +0200)
commitd37cd5883d8a004a1d849e332342081cc1154fd8
tree4acf9c90ec364d0649c74e1fad1759e3488a32f3
parent9e6a0335c96103fd551e7a0787875e4a271f40c7
i2c: mvtwsi: Fix problem with baud rate calculation

The current implementation for baudrate calculation is incorrect.
This part from the formula:

"2 ^ (n + 1)" is not equivalent to (1 << n) but to (2 << n)!

This patch fixes this and moves this calculation to a function instead of using a macro.
This new function is taken from the Linux kernel.

This was detected and tested on the Marvell Armada A38x DB-88F6820-GP eval board.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Prafulla Wadaskar <prafulla@marvell.com>
Cc: Luka Perkov <luka.perkov@sartura.hr>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Ian Campbell <ijc@hellion.org.uk>
Cc: Heiko Schocher <hs@denx.de>
Acked-by: Hans de Goede <hdegoede@redhat.com>
drivers/i2c/mvtwsi.c