summaryrefslogtreecommitdiff
path: root/linux/drivers/media
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media')
-rw-r--r--linux/drivers/media/video/pvrusb2/pvrusb2-main.c5
-rw-r--r--linux/drivers/media/video/tda8290.c22
2 files changed, 21 insertions, 6 deletions
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-main.c b/linux/drivers/media/video/pvrusb2/pvrusb2-main.c
index 73be66dd3..687096d1f 100644
--- a/linux/drivers/media/video/pvrusb2/pvrusb2-main.c
+++ b/linux/drivers/media/video/pvrusb2/pvrusb2-main.c
@@ -140,14 +140,13 @@ static int __init pvr_init(void)
static void __exit pvr_exit(void)
{
-
pvr2_trace(PVR2_TRACE_INIT,"pvr_exit");
+ usb_deregister(&pvr_driver);
+
#ifdef CONFIG_VIDEO_PVRUSB2_SYSFS
pvr2_sysfs_class_destroy(class_ptr);
#endif /* CONFIG_VIDEO_PVRUSB2_SYSFS */
-
- usb_deregister(&pvr_driver);
}
module_init(pvr_init);
diff --git a/linux/drivers/media/video/tda8290.c b/linux/drivers/media/video/tda8290.c
index c063381e8..8fed39d31 100644
--- a/linux/drivers/media/video/tda8290.c
+++ b/linux/drivers/media/video/tda8290.c
@@ -680,7 +680,7 @@ static int tda8290_probe(struct tuner_i2c_props *i2c_props)
return 0;
}
- return -1;
+ return -ENODEV;
}
static int tda8295_probe(struct tuner_i2c_props *i2c_props)
@@ -700,7 +700,7 @@ static int tda8295_probe(struct tuner_i2c_props *i2c_props)
return 0;
}
- return -1;
+ return -ENODEV;
}
static struct analog_tuner_ops tda8290_tuner_ops = {
@@ -777,6 +777,22 @@ int tda829x_probe(struct tuner *t)
unsigned char restore_9886[] = { 0x00, 0xd6, 0x30 };
unsigned char addr_dto_lsb = 0x07;
unsigned char data;
+#define PROBE_BUFFER_SIZE 8
+ unsigned char buf[PROBE_BUFFER_SIZE];
+ int i;
+
+ /* rule out tda9887, which would return the same byte repeatedly */
+ tuner_i2c_xfer_send(&i2c_props, soft_reset, 1);
+ tuner_i2c_xfer_recv(&i2c_props, buf, PROBE_BUFFER_SIZE);
+ for (i = 1; i < PROBE_BUFFER_SIZE; i++) {
+ if (buf[i] == buf[0])
+ continue;
+ break;
+ }
+
+ /* all bytes are equal, not a tda829x - probably a tda9887 */
+ if (i == PROBE_BUFFER_SIZE)
+ return -ENODEV;
if ((tda8290_probe(&i2c_props) == 0) ||
(tda8295_probe(&i2c_props) == 0))
@@ -797,7 +813,7 @@ int tda829x_probe(struct tuner *t)
}
}
tuner_i2c_xfer_send(&i2c_props, restore_9886, 3);
- return -1;
+ return -ENODEV;
}
EXPORT_SYMBOL_GPL(tda829x_probe);