diff options
author | Mike Isely <isely@pobox.com> | 2007-11-25 23:04:11 -0600 |
---|---|---|
committer | Mike Isely <isely@pobox.com> | 2007-11-25 23:04:11 -0600 |
commit | e859ac824f9a284fa50783c8536c5b95c6ff2e79 (patch) | |
tree | 7be568d23c97bfa6cc786efb6172741980877ff1 /linux/drivers | |
parent | 4cb090552f06470e17ce82a5f4290ad5ac41f62c (diff) | |
download | mediapointer-dvb-s2-e859ac824f9a284fa50783c8536c5b95c6ff2e79.tar.gz mediapointer-dvb-s2-e859ac824f9a284fa50783c8536c5b95c6ff2e79.tar.bz2 |
pvrusb2: Existence of Hauppauge ROM is a device-specific attribute
From: Mike Isely <isely@pobox.com>
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>
Diffstat (limited to 'linux/drivers')
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-devattr.c | 2 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-devattr.h | 7 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c | 25 |
3 files changed, 25 insertions, 9 deletions
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-devattr.c b/linux/drivers/media/video/pvrusb2/pvrusb2-devattr.c index aebcb846d..54a401e8b 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-devattr.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-devattr.c @@ -72,6 +72,7 @@ const struct pvr2_device_desc pvr2_device_descriptions[] = { .client_modules.cnt = ARRAY_SIZE(pvr2_client_29xxx), .fx2_firmware.lst = pvr2_fw1_names_29xxx, .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_29xxx), + .flag_has_hauppauge_rom = !0, }, [PVR2_HDW_TYPE_24XXX] = { .description = "WinTV PVR USB2 Model Category 24xxxx", @@ -82,6 +83,7 @@ const struct pvr2_device_desc pvr2_device_descriptions[] = { .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_24xxx), .flag_has_cx25840 = !0, .flag_has_wm8775 = !0, + .flag_has_hauppauge_rom = !0, }, }; diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-devattr.h b/linux/drivers/media/video/pvrusb2/pvrusb2-devattr.h index 6576aefd2..f63c3ddb8 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-devattr.h +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-devattr.h @@ -55,9 +55,16 @@ struct pvr2_device_desc { was initialized from internal ROM. */ struct pvr2_string_table fx2_firmware; + /* V4L tuner type ID to use with this device (only used if the + driver could not discover the type any other way). */ + int default_tuner_type; + /* If set, we don't bother trying to load cx23416 firmware. */ char flag_skip_cx23416_firmware; + /* Device has a hauppauge eeprom which we can interrogate. */ + char flag_has_hauppauge_rom; + /* Device does not require a powerup command to be issued. */ char flag_no_powerup; diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c index 76611f2cf..477955f7a 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c @@ -1438,6 +1438,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; } @@ -1679,15 +1680,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); @@ -1696,7 +1704,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); |