2010-04-26 02:56:55     Set I2C-Driver detect Timeout

Document created by Aaronwu Employee on Aug 21, 2013
Version 1Show Document
  • View in full screen mode

2010-04-26 02:56:55     Set I2C-Driver detect Timeout

Patrick Hotz (GERMANY)

Message: 88884   

 

Hi,

 

i have written a i2c-Driver for the uClinux-dist2008R1.

This driver is working fine for me but there is one problem left i dont know how to fix it.

 

Sometimes we haven´t the i2c-Chip mounted (but the linux-kernel is always the same) and therefore i have so set the detect timeout to 2 or 3 seconds... (currently the timeout is about 15 seconds).

 

Is there a value i can use?

 

 

 

Best regards,

Patrick

TranslateQuoteReplyEditDelete

 

 

2010-04-26 12:53:19     Re: Set I2C-Driver detect Timeout

Mike Frysinger (UNITED STATES)

Message: 88911   

 

what timeout are you talking about  exactly ?

QuoteReplyEditDelete

 

 

2010-04-29 02:39:10     Re: Set I2C-Driver detect Timeout

Patrick Hotz (GERMANY)

Message: 89003   

 

Hi,

 

i dont know which command is the fist in my driver that uses the i2c-Chip.

 

This is the "probe" function:

static int tsc2003_probe(struct i2c_adapter *adap, int addr, int kind)

    {

    struct tsc2003 *data;

    struct i2c_client *client;

    struct input_dev *input_dev;

    int rc;

 

    data = kzalloc(sizeof(struct tsc2003), GFP_KERNEL);

    if (!data)

        {

        return -ENOMEM;

        }

 

    client = &data->client;

    i2c_set_clientdata(client, data);

 

    data->irq = TSC2003_IRQ;

 

    strlcpy(client->name, "tsc2003", I2C_NAME_SIZE);

    client->addr = addr;

    client->irq = data->irq;

    client->adapter = adap;

    client->driver = &tsc2003_driver;

 

    rc = i2c_attach_client(client);

    if (rc)

        {

        printk(KERN_ERR "i2c_attach_client fail: %d\n", rc);

        goto fail_attach;

        }

 

    rc = i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_READ_WORD_DATA);

    if (!rc)

        {

        printk(KERN_ERR    "tsc2003: i2c bus doesn't support I2C_FUNC_SMBUS_READ_WORD_DATA\n");

        rc = -ENOSYS;

        goto fail_check;

        }

.... and so on...

 

This function blocks the boot for about 15 seconds if i haven´t the chip connected to the blackfin.

I think the first command which is accessing my i2c-chip is blocking the system.

TranslateQuoteReplyEditDelete

 

 

2010-04-29 03:08:31     Re: Set I2C-Driver detect Timeout

Mike Frysinger (UNITED STATES)

Message: 89008   

 

build the driver as a module then so the init can be done asynchronously

QuoteReplyEditDelete

 

 

2010-04-30 06:02:35     Re: Set I2C-Driver detect Timeout

Patrick Hotz (GERMANY)

Message: 89063   

 

OK, i will try this.

 

 

 

Thanks

Attachments

    Outcomes