summaryrefslogtreecommitdiff
path: root/v4l_experimental/pvrusb2/pvrusb2-hdw.c
diff options
context:
space:
mode:
Diffstat (limited to 'v4l_experimental/pvrusb2/pvrusb2-hdw.c')
-rw-r--r--v4l_experimental/pvrusb2/pvrusb2-hdw.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/v4l_experimental/pvrusb2/pvrusb2-hdw.c b/v4l_experimental/pvrusb2/pvrusb2-hdw.c
index 48e9ada28..940f105c2 100644
--- a/v4l_experimental/pvrusb2/pvrusb2-hdw.c
+++ b/v4l_experimental/pvrusb2/pvrusb2-hdw.c
@@ -954,6 +954,7 @@ static unsigned int get_default_error_tolerance(struct pvr2_hdw *hdw)
static void pvr2_hdw_setup_low(struct pvr2_hdw *hdw)
{
+ int ret;
unsigned int idx;
if (hdw->usb_intf->cur_altsetting->desc.bNumEndpoints == 0) {
if (pvr2_upload_firmware1(hdw) != 0) {
@@ -987,8 +988,16 @@ static void pvr2_hdw_setup_low(struct pvr2_hdw *hdw)
pvr2_reset_ctl_endpoints(hdw);
if (!pvr2_hdw_dev_ok(hdw)) return;
- pvr2_eeprom_analyze(hdw);
+ 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;
+ }
if (!get_default_tuner_type(hdw)) {
pvr2_trace(PVR2_TRACE_INIT,
@@ -1115,6 +1124,7 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf)
pvr2_trace(PVR2_TRACE_INIT,"pvr2_hdw_create: hdw=%p",hdw);
if (!hdw) goto fail;
memset(hdw,0,sizeof(*hdw));
+ hdw->eeprom_addr = -1;
hdw->unit_number = -1;
hdw->v4l_minor_number = -1;
hdw->ctl_write_buffer = kmalloc(PVR2_CTL_BUFFSIZE,GFP_KERNEL);
@@ -2327,6 +2337,21 @@ int pvr2_hdw_gpio_chg_out(struct pvr2_hdw *hdw,u32 msk,u32 val)
}
+int pvr2_hdw_get_eeprom_addr(struct pvr2_hdw *hdw)
+{
+ int result;
+ LOCK_TAKE(hdw->ctl_lock); do {
+ hdw->cmd_buffer[0] = 0xeb;
+ result = pvr2_send_request(hdw,
+ hdw->cmd_buffer,1,
+ hdw->cmd_buffer,1);
+ if (result < 0) break;
+ result = hdw->cmd_buffer[0];
+ } while(0); LOCK_GIVE(hdw->ctl_lock);
+ return result;
+}
+
+
/*
Stuff for Emacs to see, in order to encourage consistent editing style:
*** Local Variables: ***