Commit 3c1e0906 authored by Jean-Paul Saman's avatar Jean-Paul Saman

tlv320aic23.c detect i2c retries on read

parent 3a781f21
......@@ -124,7 +124,7 @@ int tlv320aic32_write_value(u8 reg, u16 value)
{
ret = i2c_smbus_write_byte_data(client, reg, val);
if (-1 != ret) break;
printk(KERN_ERR "!!!! sil9034_write retry [%d]\n", retry);
printk(KERN_ERR "!!!! tvl320aic32_write retry [%d]\n", retry);
mdelay(I2C_RETRY_SLEEP);
}
return ret;
......@@ -133,9 +133,18 @@ int tlv320aic32_write_value(u8 reg, u16 value)
int tlv320aic32_read_value(u8 reg)
{
static struct i2c_client *client;
client = new_client;
int retry = I2C_RETRY_COUNT;
int ret = -1;
return i2c_smbus_read_byte_data(client, reg);
client = new_client;
while(retry--)
{
ret = i2c_smbus_read_byte_data(client, reg);
if (-1 != ret) break;
printk(KERN_ERR "!!!! tvl320aic32_read retry [%d]\n", retry);
mdelay(I2C_RETRY_SLEEP);
}
return ret;
}
#endif /* CONFIG_SENSORS_TLV320AIC32 */
......@@ -724,5 +733,6 @@ EXPORT_SYMBOL(tlv320aic33_write_value);
#ifdef CONFIG_SENSORS_TLV320AIC32
EXPORT_SYMBOL(tlv320aic32_write_value);
EXPORT_SYMBOL(tlv320aic32_read_value);
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment