[PATCH] at91sam9g45: fix i2c bus speed

Peter Korsgaard jacmet at sunsite.dk
Thu Sep 23 06:54:30 EDT 2010


>>>>> "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.

And then if Jean wants to extend the interface to make the speed
configurable from the board code, he can do so independently of this
patch.

-- 
Bye, Peter Korsgaard



More information about the linux-arm-kernel mailing list