[i2c] [lm-sensors] Help on i2c-parport-light

Jean Delvare khali at linux-fr.org
Sun Aug 12 18:49:34 CEST 2007


Huuu, please don't cross post from one list to another! Moving back to
the i2c list...

On Wed, 1 Aug 2007 09:47:44 -0700, Juerg Haefliger wrote:
> > Thanks for your help. I managed to work out a solution. My C program
> > had an error, that I eventually found.
> 
> Good.
> 
> > I have another question. Do you know how to change the Baud rate of
> > the transfert? I would like to speed up my communication, I suspect
> to have to change i2c.c but I did not find the contant to change.
> 
> Check i2c-parport-light.c and change the udelay value in the following struct:
> 
> static struct i2c_algo_bit_data parport_algo_data = {
>         .setsda         = parport_setsda,
>         .setscl         = parport_setscl,
>         .getsda         = parport_getsda,
>         .getscl         = parport_getscl,
>         .udelay         = 50,
>         .timeout        = HZ,
> };
> 
> And the description for udelay from i2c-algo-bit.h:
> int udelay;             /* half clock cycle time in us,
>                                minimum 2 us for fast-mode I2C,
>                                minimum 5 us for standard-mode I2C and SMBus,
>                                maximum 50 us for SMBus */
> 
> 
> Maybe there's a way to change this value with a module load parameter,
> but I couldn't figure it out. Didn't spend too much time on it
> though...

No, there is no such parameter. I guess it could be added if needed, or
maybe we can simply make the default speed faster. The i2c-parport
(non-light) driver now defaults to udelay = 10 (50 kbps.) Patches are
welcome.

-- 
Jean Delvare



More information about the i2c mailing list