summaryrefslogtreecommitdiff
path: root/drivers/media/video/pvrusb2/pvrusb2-hdw.c
diff options
context:
space:
mode:
authorMike Isely <isely@pobox.com>2007-11-26 02:04:11 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-01-25 19:03:03 -0200
commitaaf7884db395332ae8474f3ea5bcdd39c0a941ea (patch)
tree3ce32381724e54c4071e5887ce31842ade021a38 /drivers/media/video/pvrusb2/pvrusb2-hdw.c
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/media/video/pvrusb2/pvrusb2-hdw.c')
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-hdw.c25
1 files changed, 16 insertions, 9 deletions
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)
}
if (tp < 0) return -EINVAL;
hdw->tuner_type = tp;
+ hdw->tuner_updated = !0;
return 0;
}
@@ -1669,15 +1670,22 @@ static void pvr2_hdw_setup_low(struct pvr2_hdw *hdw)
// thread-safe against the normal pvr2_send_request() mechanism.
// (We should make it thread safe).
- ret = pvr2_hdw_get_eeprom_addr(hdw);
- if (!pvr2_hdw_dev_ok(hdw)) return;
- if (ret < 0) {
- pvr2_trace(PVR2_TRACE_ERROR_LEGS,
- "Unable to determine location of eeprom, skipping");
- } else {
- hdw->eeprom_addr = ret;
- pvr2_eeprom_analyze(hdw);
+ if (hdw->hdw_desc->flag_has_hauppauge_rom) {
+ ret = pvr2_hdw_get_eeprom_addr(hdw);
if (!pvr2_hdw_dev_ok(hdw)) return;
+ if (ret < 0) {
+ pvr2_trace(PVR2_TRACE_ERROR_LEGS,
+ "Unable to determine location of eeprom,"
+ " skipping");
+ } else {
+ hdw->eeprom_addr = ret;
+ pvr2_eeprom_analyze(hdw);
+ if (!pvr2_hdw_dev_ok(hdw)) return;
+ }
+ } else {
+ hdw->tuner_type = hdw->hdw_desc->default_tuner_type;
+ hdw->tuner_updated = !0;
+ hdw->std_mask_eeprom = V4L2_STD_ALL;
}
pvr2_hdw_setup_std(hdw);
@@ -1686,7 +1694,6 @@ static void pvr2_hdw_setup_low(struct pvr2_hdw *hdw)
pvr2_trace(PVR2_TRACE_INIT,
"pvr2_hdw_setup: Tuner type overridden to %d",
hdw->tuner_type);
- hdw->tuner_updated = !0;
}
pvr2_i2c_core_check_stale(hdw);