Commit 89a8969a authored by Jarod Wilson's avatar Jarod Wilson Committed by Mauro Carvalho Chehab

[media] tda829x: fix regression in probe functions

In commit 567aba0b, the probe address
for tda8290_probe and tda8295_probe was hard-coded to 0x4b, which is the
default i2c address for those devices, but its possible for the device
to be at an alternate address, 0x42, which is the case for the HVR-1950.
If we probe the wrong address, probe fails and we have a non-working
device. We have the actual address passed into the function by way of
i2c_props, we just need to use it. Also fix up some copy/paste comment
issues and streamline debug spew a touch. Verified to restore my
HVR-1950 to full working order.

Special thanks to Ken Bass for reporting the issue in the first place,
and to both he and Gary Buhrmaster for aiding in debugging and analysis
of the problem.
Reported-by: default avatarKen Bass <kbass@kenbass.com>
Tested-by: default avatarJarod Wilson <jarod@redhat.com>
Signed-off-by: default avatarJarod Wilson <jarod@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent a6994eb0
......@@ -658,13 +658,13 @@ static int tda8290_probe(struct tuner_i2c_props *i2c_props)
#define TDA8290_ID 0x89
u8 reg = 0x1f, id;
struct i2c_msg msg_read[] = {
{ .addr = 0x4b, .flags = 0, .len = 1, .buf = &reg },
{ .addr = 0x4b, .flags = I2C_M_RD, .len = 1, .buf = &id },
{ .addr = i2c_props->addr, .flags = 0, .len = 1, .buf = &reg },
{ .addr = i2c_props->addr, .flags = I2C_M_RD, .len = 1, .buf = &id },
};
/* detect tda8290 */
if (i2c_transfer(i2c_props->adap, msg_read, 2) != 2) {
printk(KERN_WARNING "%s: tda8290 couldn't read register 0x%02x\n",
printk(KERN_WARNING "%s: couldn't read register 0x%02x\n",
__func__, reg);
return -ENODEV;
}
......@@ -685,13 +685,13 @@ static int tda8295_probe(struct tuner_i2c_props *i2c_props)
#define TDA8295C2_ID 0x8b
u8 reg = 0x2f, id;
struct i2c_msg msg_read[] = {
{ .addr = 0x4b, .flags = 0, .len = 1, .buf = &reg },
{ .addr = 0x4b, .flags = I2C_M_RD, .len = 1, .buf = &id },
{ .addr = i2c_props->addr, .flags = 0, .len = 1, .buf = &reg },
{ .addr = i2c_props->addr, .flags = I2C_M_RD, .len = 1, .buf = &id },
};
/* detect tda8290 */
/* detect tda8295 */
if (i2c_transfer(i2c_props->adap, msg_read, 2) != 2) {
printk(KERN_WARNING "%s: tda8290 couldn't read register 0x%02x\n",
printk(KERN_WARNING "%s: couldn't read register 0x%02x\n",
__func__, reg);
return -ENODEV;
}
......
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