aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMike Isely <isely@pobox.com>2007-11-26 00:04:11 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-01-25 16:03:03 -0500
commitaaf7884db395332ae8474f3ea5bcdd39c0a941ea (patch)
tree3ce32381724e54c4071e5887ce31842ade021a38 /drivers
parent56dcbfa0d5a46f137df5047ae8f3aab30f59954e (diff)
V4L/DVB (6697): pvrusb2: Existence of Hauppauge ROM is a device-specific attribute
Arrange so that the pvrusb2 driver can optionally work without a Hauppauge ROM being present - which is fairly important for devices that happen to not come from Hauppauge. The expected existence of a Hauppauge ROM is now a device attribute. The tuner type is now also a device attribute, which is consulted if there is no ROM. Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-devattr.c2
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-devattr.h7
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-hdw.c25
3 files changed, 25 insertions, 9 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-devattr.c b/drivers/media/video/pvrusb2/pvrusb2-devattr.c
index aebcb846de6a..54a401e8bb14 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-devattr.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-devattr.c
@@ -72,6 +72,7 @@ const struct pvr2_device_desc pvr2_device_descriptions[] = {
72 .client_modules.cnt = ARRAY_SIZE(pvr2_client_29xxx), 72 .client_modules.cnt = ARRAY_SIZE(pvr2_client_29xxx),
73 .fx2_firmware.lst = pvr2_fw1_names_29xxx, 73 .fx2_firmware.lst = pvr2_fw1_names_29xxx,
74 .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_29xxx), 74 .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_29xxx),
75 .flag_has_hauppauge_rom = !0,
75 }, 76 },
76 [PVR2_HDW_TYPE_24XXX] = { 77 [PVR2_HDW_TYPE_24XXX] = {
77 .description = "WinTV PVR USB2 Model Category 24xxxx", 78 .description = "WinTV PVR USB2 Model Category 24xxxx",
@@ -82,6 +83,7 @@ const struct pvr2_device_desc pvr2_device_descriptions[] = {
82 .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_24xxx), 83 .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_24xxx),
83 .flag_has_cx25840 = !0, 84 .flag_has_cx25840 = !0,
84 .flag_has_wm8775 = !0, 85 .flag_has_wm8775 = !0,
86 .flag_has_hauppauge_rom = !0,
85 }, 87 },
86}; 88};
87 89
diff --git a/drivers/media/video/pvrusb2/pvrusb2-devattr.h b/drivers/media/video/pvrusb2/pvrusb2-devattr.h
index 6576aefd27c3..f63c3ddb8a72 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-devattr.h
+++ b/drivers/media/video/pvrusb2/pvrusb2-devattr.h
@@ -55,9 +55,16 @@ struct pvr2_device_desc {
55 was initialized from internal ROM. */ 55 was initialized from internal ROM. */
56 struct pvr2_string_table fx2_firmware; 56 struct pvr2_string_table fx2_firmware;
57 57
58 /* V4L tuner type ID to use with this device (only used if the
59 driver could not discover the type any other way). */
60 int default_tuner_type;
61
58 /* If set, we don't bother trying to load cx23416 firmware. */ 62 /* If set, we don't bother trying to load cx23416 firmware. */
59 char flag_skip_cx23416_firmware; 63 char flag_skip_cx23416_firmware;
60 64
65 /* Device has a hauppauge eeprom which we can interrogate. */
66 char flag_has_hauppauge_rom;
67
61 /* Device does not require a powerup command to be issued. */ 68 /* Device does not require a powerup command to be issued. */
62 char flag_no_powerup; 69 char flag_no_powerup;
63 70
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
index 6a7b9af55e43..b7b2d90a4912 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
@@ -1428,6 +1428,7 @@ static int get_default_tuner_type(struct pvr2_hdw *hdw)
1428 } 1428 }
1429 if (tp < 0) return -EINVAL; 1429 if (tp < 0) return -EINVAL;
1430 hdw->tuner_type = tp; 1430 hdw->tuner_type = tp;
1431 hdw->tuner_updated = !0;
1431 return 0; 1432 return 0;
1432} 1433}
1433 1434
@@ -1669,15 +1670,22 @@ static void pvr2_hdw_setup_low(struct pvr2_hdw *hdw)
1669 // thread-safe against the normal pvr2_send_request() mechanism. 1670 // thread-safe against the normal pvr2_send_request() mechanism.
1670 // (We should make it thread safe). 1671 // (We should make it thread safe).
1671 1672
1672 ret = pvr2_hdw_get_eeprom_addr(hdw); 1673 if (hdw->hdw_desc->flag_has_hauppauge_rom) {
1673 if (!pvr2_hdw_dev_ok(hdw)) return; 1674 ret = pvr2_hdw_get_eeprom_addr(hdw);
1674 if (ret < 0) {
1675 pvr2_trace(PVR2_TRACE_ERROR_LEGS,
1676 "Unable to determine location of eeprom, skipping");
1677 } else {
1678 hdw->eeprom_addr = ret;
1679 pvr2_eeprom_analyze(hdw);
1680 if (!pvr2_hdw_dev_ok(hdw)) return; 1675 if (!pvr2_hdw_dev_ok(hdw)) return;
1676 if (ret < 0) {
1677 pvr2_trace(PVR2_TRACE_ERROR_LEGS,
1678 "Unable to determine location of eeprom,"
1679 " skipping");
1680 } else {
1681 hdw->eeprom_addr = ret;
1682 pvr2_eeprom_analyze(hdw);
1683 if (!pvr2_hdw_dev_ok(hdw)) return;
1684 }
1685 } else {
1686 hdw->tuner_type = hdw->hdw_desc->default_tuner_type;
1687 hdw->tuner_updated = !0;
1688 hdw->std_mask_eeprom = V4L2_STD_ALL;
1681 } 1689 }
1682 1690
1683 pvr2_hdw_setup_std(hdw); 1691 pvr2_hdw_setup_std(hdw);
@@ -1686,7 +1694,6 @@ static void pvr2_hdw_setup_low(struct pvr2_hdw *hdw)
1686 pvr2_trace(PVR2_TRACE_INIT, 1694 pvr2_trace(PVR2_TRACE_INIT,
1687 "pvr2_hdw_setup: Tuner type overridden to %d", 1695 "pvr2_hdw_setup: Tuner type overridden to %d",
1688 hdw->tuner_type); 1696 hdw->tuner_type);
1689 hdw->tuner_updated = !0;
1690 } 1697 }
1691 1698
1692 pvr2_i2c_core_check_stale(hdw); 1699 pvr2_i2c_core_check_stale(hdw);