On Mon, Jul 18, 2011 at 11:31 AM, Shubhrajyoti <shubhrajy...@ti.com> wrote:
> Hi Manuel,
>>
>> From: *Manuel Lauss* <manuel.la...@googlemail.com
>> <mailto:manuel.la...@googlemail.com>>
>> Date: Thu, Jul 14, 2011 at 2:26 PM
>> Subject: [PATCH 3/4] i2c/au1550: increase timeout limit
>> To: Linux-I2C <linux-i2c@vger.kernel.org
>> <mailto:linux-i2c@vger.kernel.org>>, Ben Dooks <ben-li...@fluff.org
>> <mailto:ben-li...@fluff.org>>
>> Cc: Manuel Lauss <manuel.la...@googlemail.com
>> <mailto:manuel.la...@googlemail.com>>
>>
>>
>> The timeout waiting for various events to occur is tailored for
>> a module clock of 50MHz.  On the DB1300 board only 48MHz can be
>> supplied to the i2c module, which results in the timeout aborting
>> complex transfers to slaves slightly too early if they employ
>> for example clock stretching.
>>
>> With this change the WM8731 codec on the DB1300 board is correctly
>> detected and initialized.
>>
>> Signed-off-by: Manuel Lauss <manuel.la...@googlemail.com
>> <mailto:manuel.la...@googlemail.com>>
>> ---
>>  drivers/i2c/busses/i2c-au1550.c |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/i2c/busses/i2c-au1550.c
>> b/drivers/i2c/busses/i2c-au1550.c
>> index 98ee11a..36d1b29 100644
>> --- a/drivers/i2c/busses/i2c-au1550.c
>> +++ b/drivers/i2c/busses/i2c-au1550.c
>> @@ -344,7 +344,7 @@ i2c_au1550_probe(struct platform_device *pdev)
>>               ret = -EIO;
>>               goto out_map;
>>       }
>> -       priv->xfer_timeout = 200;
>> +       priv->xfer_timeout = 400;
>
> What is the unit of the timeout. If it is in usec then how is it dependent
> on the clock
> supplied to the i2c module.
>
> Am I missing something.

It's used as a loop counter, with udelay()s in the various loops.
On the DB1300 board I observed that the function "wait_master_done()"
returns an error due to the loop counter reaching zero when accessing
the WM8731; an adm1025 hwmon actually works without this patch.
That timeout is more or less a safeguard against busy waiting forever
on various event bits.

Manuel
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to