Commit 32c000ad authored by Devin Heitmueller's avatar Devin Heitmueller Committed by Mauro Carvalho Chehab

V4L/DVB (11067): au0828: workaround a bug in the au0828 i2c handling

There is an issue related to the i2c clock for addressing the xc5000.  The
au0828 chip does not support clock stretching, which the xc5000 makes use of.
This results in cases where we silently get back garbage in i2c read
operations.  To work around this issue until we slow down the i2c clock when
talking with that specific device.

This was not an issue before we had analog support because we never needed to
enumerate the i2c bus, and digital tuning never actually needed to perform
read operations against the xc5000.

Thanks to Michael Krufky <mkrufky@linuxtv.org> and Steven Toth
<stoth@linuxtv.org> for providing sample hardware, engineering level support,
and testing.
Signed-off-by: default avatarDevin Heitmueller <dheitmueller@linuxtv.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 8b2f0795
...@@ -140,7 +140,16 @@ static int i2c_sendbytes(struct i2c_adapter *i2c_adap, ...@@ -140,7 +140,16 @@ static int i2c_sendbytes(struct i2c_adapter *i2c_adap,
dprintk(4, "%s()\n", __func__); dprintk(4, "%s()\n", __func__);
au0828_write(dev, REG_2FF, 0x01); au0828_write(dev, REG_2FF, 0x01);
au0828_write(dev, REG_202, 0x07);
/* FIXME: There is a problem with i2c communications with xc5000 that
requires us to slow down the i2c clock until we have a better
strategy (such as using the secondary i2c bus to do firmware
loading */
if ((msg->addr << 1) == 0xc2) {
au0828_write(dev, REG_202, 0x40);
} else {
au0828_write(dev, REG_202, 0x07);
}
/* Hardware needs 8 bit addresses */ /* Hardware needs 8 bit addresses */
au0828_write(dev, REG_203, msg->addr << 1); au0828_write(dev, REG_203, msg->addr << 1);
...@@ -191,7 +200,16 @@ static int i2c_readbytes(struct i2c_adapter *i2c_adap, ...@@ -191,7 +200,16 @@ static int i2c_readbytes(struct i2c_adapter *i2c_adap,
dprintk(4, "%s()\n", __func__); dprintk(4, "%s()\n", __func__);
au0828_write(dev, REG_2FF, 0x01); au0828_write(dev, REG_2FF, 0x01);
au0828_write(dev, REG_202, 0x07);
/* FIXME: There is a problem with i2c communications with xc5000 that
requires us to slow down the i2c clock until we have a better
strategy (such as using the secondary i2c bus to do firmware
loading */
if ((msg->addr << 1) == 0xc2) {
au0828_write(dev, REG_202, 0x40);
} else {
au0828_write(dev, REG_202, 0x07);
}
/* Hardware needs 8 bit addresses */ /* Hardware needs 8 bit addresses */
au0828_write(dev, REG_203, msg->addr << 1); au0828_write(dev, REG_203, msg->addr << 1);
......
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