ARM: shmobile: kzm9g legacy: Set i2c clks_per_count to 2
authorGeert Uytterhoeven <geert+renesas@glider.be>
Thu, 6 Nov 2014 11:52:06 +0000 (12:52 +0100)
committerSimon Horman <horms+renesas@verge.net.au>
Fri, 5 Dec 2014 08:34:07 +0000 (17:34 +0900)
commit2c57f87dbe07856c105dc53cacc67e9275c5e528
tree48b324b66c8d2c1d412fd73b41173577ebf2dc1b
parent6f9fb8f837a8290e5bafcc9075c7b084d3e607c6
ARM: shmobile: kzm9g legacy: Set i2c clks_per_count to 2

On sh73a0/kzm9g-legacy, probing of the i2c masters fails with:

    i2c-sh_mobile i2c-sh_mobile.0: timing values out of range: L/H=0x208/0x1bf
    sh_mobile: probe of i2c-sh_mobile.0 failed with error -22

According to the datasheet, the transfer rate is derived from the HP
clock (which runs at 104 MHz) divided by two. Hence
i2c_sh_mobile_platform_data.clks_per_count should be set to two.

Now probing succeeds, and i2c works:

    i2c-sh_mobile i2c-sh_mobile.0: I2C adapter 0 with bus speed 100000 Hz (L/H=0x104/0xe0)

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit b207422bb92f17f4f892a9b8737d44b37fece25b)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
arch/arm/mach-shmobile/setup-sh73a0.c