i2c: mpc: assign the correct prescaler from SVR
authorValentin Longchamp <valentin.longchamp@keymile.com>
Tue, 10 Feb 2015 15:46:33 +0000 (16:46 +0100)
committerWolfram Sang <wsa@the-dreams.de>
Sun, 15 Mar 2015 10:04:54 +0000 (11:04 +0100)
commit8ce795cb0c6b8214779c4a220781a26f096e4442
treeec29263e34e460c18806c9db94bb10c94c69f44b
parent913b1d85cdde5f1fc081aa84f548270a15027abb
i2c: mpc: assign the correct prescaler from SVR

For the 85xx platforms, the source clock for the i2c-mpc can change from
one SoC to another. This is documented in the AN2919 "Determining the
I2C Frequency Divider Ratio for SCL" by Freescale. Not taking this into
account can lead to the output SCL frequency to by off by an offset. It
was observed on the P2041 from the QorIQ family.

This patch fixes this problem by setting the prescaler value to the
appropriate value when required. The SoCs that required a different
prescaler than 1 are identified by reading out the SVR as discussed in
http://thread.gmane.org/gmane.linux.drivers.devicetree/94247/focus=20556

Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/busses/i2c-mpc.c