[PATCH] at91sam9g45: fix i2c bus speed

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Thu Sep 23 07:16:04 EDT 2010


On 12:54 Thu 23 Sep     , Peter Korsgaard wrote:
> >>>>> "Russell" == Russell King <- ARM Linux <linux at arm.linux.org.uk>> writes:
> 
> Hi,
> 
>  Russell> Jean is right - if you want to care this much about getting the I2C
>  Russell> transfer rate as close to 100kHz or 400kHz (without exceeding it),
>  Russell> you need to pass the required speed and run some sort of calibration
>  Russell> in the driver to calculate the correct delay.
> 
> I don't care about all those things. I just want to fix the obvious bug
> that happened while copying this code from the older (slower) SoCs
> without taking into consideration the faster gpio handling - E.G.
> 
> -       .udelay                 = 2,            /* ~100 kHz */
> +       .udelay                 = 5,            /* ~100 kHz */
> 
> So the comment matches and devices that don't handle >100KHz works on
> the new SoCs as well.
> 
> And yes, if you run the SoC at nonstandard (slower) speed this might be
> slower than 100Khz, but that's still safe, so not a big deal.
except you can also overclock the SoC in some case so it's still not safe

and force this speed for all boards :(

so specify the speed in the board is the right way to fix the current issue

as you may find some stupid i2c chip that does not work at 100kHz (some low
cost MCU as example)

Best Regards,
J.



More information about the linux-arm-kernel mailing list