[linux-dvb] mdelay(10) ves1820_writereg()

Johannes Stezenbach js at linuxtv.org
Wed Mar 23 22:57:42 CET 2005


Tony Glader wrote:
> Is there some good reason why there is mdelay(10) in ves1820_writereg():

That is a good question.

> static int ves1820_writereg(struct ves1820_state *state, u8 reg, u8 data)
> {
>         u8 buf[] = { 0x00, reg, data };
>         struct i2c_msg msg = {.addr = state->config->demod_address,.flags = 0,.buf = buf,.len = 3};
>         int ret;
> 
>         ret = i2c_transfer(state->i2c, &msg, 1);
> 
>         if (ret != 1)
>                 printk("ves1820: %s(): writereg error (reg == 0x%02x,"
>                         "val == 0x%02x, ret == %i)\n", __FUNCTION__, reg, data, ret);
> 
>         msleep(10);
>         return (ret != 1) ? -EREMOTEIO : 0;
> }
> 
> Doesn't it slow down lot of i2c communication?

Yes, but maybe that's the intention (bad hardware).
Does it work for you without the sleep?

Johannes




More information about the linux-dvb mailing list