“fb2a27e743cd565c25cd896911e494482a8b7251”上不存在“arch/mips/include/asm/uasm.h”
提交 4c7cad4b 编写于 作者: A Antti Palosaari 提交者: Mauro Carvalho Chehab

[media] rtl28xxu: retry failed i2c messages

Sometimes i2c transfer fails. That happens especially when large
amount of data is written sequentially eg. firmware download.
Problem arises with both integrated rtl2832 demod and external
mn88472 demod, which is clear indicator it is busy i2c bus issue.
Use i2c core retry logic in order fix the issue by repeating failed
message. Another solution which also works is to add ~100us delay
between i2c messages - but repeating sounds more elegant and does
not cause any extra delay for success cases.
Signed-off-by: NAntti Palosaari <crope@iki.fi>
Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
上级 d309c8bb
...@@ -259,6 +259,10 @@ static int rtl28xxu_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[], ...@@ -259,6 +259,10 @@ static int rtl28xxu_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[],
ret = -EOPNOTSUPP; ret = -EOPNOTSUPP;
} }
/* Retry failed I2C messages */
if (ret == -EPIPE)
ret = -EAGAIN;
err_mutex_unlock: err_mutex_unlock:
mutex_unlock(&d->i2c_mutex); mutex_unlock(&d->i2c_mutex);
...@@ -619,6 +623,10 @@ static int rtl28xxu_identify_state(struct dvb_usb_device *d, const char **name) ...@@ -619,6 +623,10 @@ static int rtl28xxu_identify_state(struct dvb_usb_device *d, const char **name)
} }
dev_dbg(&d->intf->dev, "chip_id=%u\n", dev->chip_id); dev_dbg(&d->intf->dev, "chip_id=%u\n", dev->chip_id);
/* Retry failed I2C messages */
d->i2c_adap.retries = 1;
d->i2c_adap.timeout = msecs_to_jiffies(10);
return WARM; return WARM;
err: err:
dev_dbg(&d->intf->dev, "failed=%d\n", ret); dev_dbg(&d->intf->dev, "failed=%d\n", ret);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册