diff options
author | Stefan Ringel <stefan.ringel@arcor.de> | 2010-02-22 12:35:06 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-05-17 23:44:08 -0400 |
commit | 02512fe33e9162713cd522937aabc81fcd97ad74 (patch) | |
tree | 50e382c7fb6bb06ae38bd9f9af9b165074267dda | |
parent | 4e11502d4597c6252411dc1b5c16b47d08b5f246 (diff) |
V4L/DVB: tm6000: bugfix reading problems with demodulator zl10353
Reading from zl10353 with tm6000 has a bug. For example:
regs w/o patch with patch
0x06 0x00 0x7f
0x07 0x33 0x30
0x08 0x00 0x00
0x09 0x58 0x50
0x0f 0x31 0x28
0x10 0x00 0x84
This patch provides the workaround for the bug
[mchehab@redhat.com: Fix merge conflict and add a comment at the workaround]
Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/staging/tm6000/tm6000-i2c.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/staging/tm6000/tm6000-i2c.c b/drivers/staging/tm6000/tm6000-i2c.c index a5323303c34a..ec4c9381c14a 100644 --- a/drivers/staging/tm6000/tm6000-i2c.c +++ b/drivers/staging/tm6000/tm6000-i2c.c | |||
@@ -56,9 +56,23 @@ static int tm6000_i2c_recv_regs(struct tm6000_core *dev, unsigned char addr, | |||
56 | __u8 reg, char *buf, int len) | 56 | __u8 reg, char *buf, int len) |
57 | { | 57 | { |
58 | int rc; | 58 | int rc; |
59 | u8 b[2]; | ||
59 | 60 | ||
60 | rc = tm6000_read_write_usb(dev, USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, | 61 | if ((dev->caps.has_zl10353) && (dev->demod_addr << 1 == addr) && (reg % 2 == 0)) { |
62 | /* | ||
63 | * Workaround an I2C bug when reading from zl10353 | ||
64 | */ | ||
65 | reg -= 1; | ||
66 | len += 1; | ||
67 | |||
68 | rc = tm6000_read_write_usb(dev, USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, | ||
69 | REQ_16_SET_GET_I2C_WR1_RDN, addr | reg << 8, 0, b, len); | ||
70 | |||
71 | *buf = b[1]; | ||
72 | } else { | ||
73 | rc = tm6000_read_write_usb(dev, USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, | ||
61 | REQ_16_SET_GET_I2C_WR1_RDN, addr | reg << 8, 0, buf, len); | 74 | REQ_16_SET_GET_I2C_WR1_RDN, addr | reg << 8, 0, buf, len); |
75 | } | ||
62 | 76 | ||
63 | return rc; | 77 | return rc; |
64 | } | 78 | } |