aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/pvrusb2
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/pvrusb2')
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-debugifc.c17
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-devattr.c13
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-devattr.h1
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-encoder.c5
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h1
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-hdw.c63
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-hdw.h2
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-i2c-core.c1
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-v4l2.c15
9 files changed, 92 insertions, 26 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-debugifc.c b/drivers/media/video/pvrusb2/pvrusb2-debugifc.c
index fbe3856bdca6..ae977668c496 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-debugifc.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-debugifc.c
@@ -142,6 +142,9 @@ int pvr2_debugifc_print_info(struct pvr2_hdw *hdw,char *buf,unsigned int acnt)
142{ 142{
143 int bcnt = 0; 143 int bcnt = 0;
144 int ccnt; 144 int ccnt;
145 ccnt = scnprintf(buf, acnt, "Driver hardware description: %s\n",
146 pvr2_hdw_get_desc(hdw));
147 bcnt += ccnt; acnt -= ccnt; buf += ccnt;
145 ccnt = scnprintf(buf,acnt,"Driver state info:\n"); 148 ccnt = scnprintf(buf,acnt,"Driver state info:\n");
146 bcnt += ccnt; acnt -= ccnt; buf += ccnt; 149 bcnt += ccnt; acnt -= ccnt; buf += ccnt;
147 ccnt = pvr2_hdw_state_report(hdw,buf,acnt); 150 ccnt = pvr2_hdw_state_report(hdw,buf,acnt);
@@ -249,11 +252,15 @@ static int pvr2_debugifc_do1cmd(struct pvr2_hdw *hdw,const char *buf,
249 scnt = debugifc_isolate_word(buf,count,&wptr,&wlen); 252 scnt = debugifc_isolate_word(buf,count,&wptr,&wlen);
250 if (scnt && wptr) { 253 if (scnt && wptr) {
251 count -= scnt; buf += scnt; 254 count -= scnt; buf += scnt;
252 if (debugifc_match_keyword(wptr,wlen,"prom")) { 255 if (debugifc_match_keyword(wptr, wlen,
253 pvr2_hdw_cpufw_set_enabled(hdw,!0,!0); 256 "prom")) {
254 } else if (debugifc_match_keyword(wptr,wlen, 257 pvr2_hdw_cpufw_set_enabled(hdw, 2, !0);
255 "ram")) { 258 } else if (debugifc_match_keyword(wptr, wlen,
256 pvr2_hdw_cpufw_set_enabled(hdw,0,!0); 259 "ram8k")) {
260 pvr2_hdw_cpufw_set_enabled(hdw, 0, !0);
261 } else if (debugifc_match_keyword(wptr, wlen,
262 "ram16k")) {
263 pvr2_hdw_cpufw_set_enabled(hdw, 1, !0);
257 } else { 264 } else {
258 return -EINVAL; 265 return -EINVAL;
259 } 266 }
diff --git a/drivers/media/video/pvrusb2/pvrusb2-devattr.c b/drivers/media/video/pvrusb2/pvrusb2-devattr.c
index e4d7c13cab87..6bc16c13ccef 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-devattr.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-devattr.c
@@ -58,7 +58,7 @@ static const char *pvr2_fw1_names_29xxx[] = {
58}; 58};
59 59
60static const struct pvr2_device_desc pvr2_device_29xxx = { 60static const struct pvr2_device_desc pvr2_device_29xxx = {
61 .description = "WinTV PVR USB2 Model Category 29xxx", 61 .description = "WinTV PVR USB2 Model 29xxx",
62 .shortname = "29xxx", 62 .shortname = "29xxx",
63 .client_table.lst = pvr2_cli_29xxx, 63 .client_table.lst = pvr2_cli_29xxx,
64 .client_table.cnt = ARRAY_SIZE(pvr2_cli_29xxx), 64 .client_table.cnt = ARRAY_SIZE(pvr2_cli_29xxx),
@@ -91,7 +91,7 @@ static const char *pvr2_fw1_names_24xxx[] = {
91}; 91};
92 92
93static const struct pvr2_device_desc pvr2_device_24xxx = { 93static const struct pvr2_device_desc pvr2_device_24xxx = {
94 .description = "WinTV PVR USB2 Model Category 24xxx", 94 .description = "WinTV PVR USB2 Model 24xxx",
95 .shortname = "24xxx", 95 .shortname = "24xxx",
96 .client_table.lst = pvr2_cli_24xxx, 96 .client_table.lst = pvr2_cli_24xxx,
97 .client_table.cnt = ARRAY_SIZE(pvr2_cli_24xxx), 97 .client_table.cnt = ARRAY_SIZE(pvr2_cli_24xxx),
@@ -340,7 +340,7 @@ static const char *pvr2_fw1_names_73xxx[] = {
340}; 340};
341 341
342static const struct pvr2_device_desc pvr2_device_73xxx = { 342static const struct pvr2_device_desc pvr2_device_73xxx = {
343 .description = "WinTV HVR-1900 Model Category 73xxx", 343 .description = "WinTV HVR-1900 Model 73xxx",
344 .shortname = "73xxx", 344 .shortname = "73xxx",
345 .client_table.lst = pvr2_cli_73xxx, 345 .client_table.lst = pvr2_cli_73xxx,
346 .client_table.cnt = ARRAY_SIZE(pvr2_cli_73xxx), 346 .client_table.cnt = ARRAY_SIZE(pvr2_cli_73xxx),
@@ -351,6 +351,7 @@ static const struct pvr2_device_desc pvr2_device_73xxx = {
351 .flag_has_analogtuner = !0, 351 .flag_has_analogtuner = !0,
352 .flag_has_composite = !0, 352 .flag_has_composite = !0,
353 .flag_has_svideo = !0, 353 .flag_has_svideo = !0,
354 .flag_fx2_16kb = !0,
354 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE, 355 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
355 .digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE, 356 .digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE,
356 .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE, 357 .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
@@ -445,7 +446,7 @@ static const char *pvr2_fw1_names_75xxx[] = {
445}; 446};
446 447
447static const struct pvr2_device_desc pvr2_device_750xx = { 448static const struct pvr2_device_desc pvr2_device_750xx = {
448 .description = "WinTV HVR-1950 Model Category 750xx", 449 .description = "WinTV HVR-1950 Model 750xx",
449 .shortname = "750xx", 450 .shortname = "750xx",
450 .client_table.lst = pvr2_cli_73xxx, 451 .client_table.lst = pvr2_cli_73xxx,
451 .client_table.cnt = ARRAY_SIZE(pvr2_cli_73xxx), 452 .client_table.cnt = ARRAY_SIZE(pvr2_cli_73xxx),
@@ -456,6 +457,7 @@ static const struct pvr2_device_desc pvr2_device_750xx = {
456 .flag_has_analogtuner = !0, 457 .flag_has_analogtuner = !0,
457 .flag_has_composite = !0, 458 .flag_has_composite = !0,
458 .flag_has_svideo = !0, 459 .flag_has_svideo = !0,
460 .flag_fx2_16kb = !0,
459 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE, 461 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
460 .digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE, 462 .digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE,
461 .default_std_mask = V4L2_STD_NTSC_M, 463 .default_std_mask = V4L2_STD_NTSC_M,
@@ -467,7 +469,7 @@ static const struct pvr2_device_desc pvr2_device_750xx = {
467}; 469};
468 470
469static const struct pvr2_device_desc pvr2_device_751xx = { 471static const struct pvr2_device_desc pvr2_device_751xx = {
470 .description = "WinTV HVR-1950 Model Category 751xx", 472 .description = "WinTV HVR-1950 Model 751xx",
471 .shortname = "751xx", 473 .shortname = "751xx",
472 .client_table.lst = pvr2_cli_73xxx, 474 .client_table.lst = pvr2_cli_73xxx,
473 .client_table.cnt = ARRAY_SIZE(pvr2_cli_73xxx), 475 .client_table.cnt = ARRAY_SIZE(pvr2_cli_73xxx),
@@ -478,6 +480,7 @@ static const struct pvr2_device_desc pvr2_device_751xx = {
478 .flag_has_analogtuner = !0, 480 .flag_has_analogtuner = !0,
479 .flag_has_composite = !0, 481 .flag_has_composite = !0,
480 .flag_has_svideo = !0, 482 .flag_has_svideo = !0,
483 .flag_fx2_16kb = !0,
481 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE, 484 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
482 .digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE, 485 .digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE,
483 .default_std_mask = V4L2_STD_NTSC_M, 486 .default_std_mask = V4L2_STD_NTSC_M,
diff --git a/drivers/media/video/pvrusb2/pvrusb2-devattr.h b/drivers/media/video/pvrusb2/pvrusb2-devattr.h
index ea04ecf8aa39..e5b9594eb5f6 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-devattr.h
+++ b/drivers/media/video/pvrusb2/pvrusb2-devattr.h
@@ -176,6 +176,7 @@ struct pvr2_device_desc {
176 unsigned int flag_has_analogtuner:1; /* Has analog tuner */ 176 unsigned int flag_has_analogtuner:1; /* Has analog tuner */
177 unsigned int flag_has_composite:1; /* Has composite input */ 177 unsigned int flag_has_composite:1; /* Has composite input */
178 unsigned int flag_has_svideo:1; /* Has s-video input */ 178 unsigned int flag_has_svideo:1; /* Has s-video input */
179 unsigned int flag_fx2_16kb:1; /* 16KB FX2 firmware OK here */
179}; 180};
180 181
181extern struct usb_device_id pvr2_device_table[]; 182extern struct usb_device_id pvr2_device_table[];
diff --git a/drivers/media/video/pvrusb2/pvrusb2-encoder.c b/drivers/media/video/pvrusb2/pvrusb2-encoder.c
index 54ac5349dee2..e046fdaec5ae 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-encoder.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-encoder.c
@@ -294,7 +294,10 @@ static int pvr2_encoder_cmd(void *ctxt,
294 pvr2_trace( 294 pvr2_trace(
295 PVR2_TRACE_ERROR_LEGS, 295 PVR2_TRACE_ERROR_LEGS,
296 "Giving up on command." 296 "Giving up on command."
297 " This is normally recovered by the driver."); 297 " This is normally recovered via a firmware"
298 " reload and re-initialization; concern"
299 " is only warranted if this happens repeatedly"
300 " and rapidly.");
298 break; 301 break;
299 } 302 }
300 wrData[0] = 0x7; 303 wrData[0] = 0x7;
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h b/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h
index 5fcad28211d2..de5485f506b1 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h
+++ b/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h
@@ -270,6 +270,7 @@ struct pvr2_hdw {
270 270
271 int force_dirty; /* consider all controls dirty if true */ 271 int force_dirty; /* consider all controls dirty if true */
272 int flag_ok; /* device in known good state */ 272 int flag_ok; /* device in known good state */
273 int flag_modulefail; /* true if at least one module failed to load */
273 int flag_disconnected; /* flag_ok == 0 due to disconnect */ 274 int flag_disconnected; /* flag_ok == 0 due to disconnect */
274 int flag_init_ok; /* true if structure is fully initialized */ 275 int flag_init_ok; /* true if structure is fully initialized */
275 int fw1_state; /* current situation with fw1 */ 276 int fw1_state; /* current situation with fw1 */
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
index 13639b302700..1bbdab08fe0e 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
@@ -1447,6 +1447,7 @@ static int pvr2_upload_firmware1(struct pvr2_hdw *hdw)
1447 const struct firmware *fw_entry = NULL; 1447 const struct firmware *fw_entry = NULL;
1448 void *fw_ptr; 1448 void *fw_ptr;
1449 unsigned int pipe; 1449 unsigned int pipe;
1450 unsigned int fwsize;
1450 int ret; 1451 int ret;
1451 u16 address; 1452 u16 address;
1452 1453
@@ -1473,9 +1474,21 @@ static int pvr2_upload_firmware1(struct pvr2_hdw *hdw)
1473 usb_clear_halt(hdw->usb_dev, usb_sndbulkpipe(hdw->usb_dev, 0 & 0x7f)); 1474 usb_clear_halt(hdw->usb_dev, usb_sndbulkpipe(hdw->usb_dev, 0 & 0x7f));
1474 1475
1475 pipe = usb_sndctrlpipe(hdw->usb_dev, 0); 1476 pipe = usb_sndctrlpipe(hdw->usb_dev, 0);
1477 fwsize = fw_entry->size;
1476 1478
1477 if (fw_entry->size != 0x2000){ 1479 if ((fwsize != 0x2000) &&
1478 pvr2_trace(PVR2_TRACE_ERROR_LEGS,"wrong fx2 firmware size"); 1480 (!(hdw->hdw_desc->flag_fx2_16kb && (fwsize == 0x4000)))) {
1481 if (hdw->hdw_desc->flag_fx2_16kb) {
1482 pvr2_trace(PVR2_TRACE_ERROR_LEGS,
1483 "Wrong fx2 firmware size"
1484 " (expected 8192 or 16384, got %u)",
1485 fwsize);
1486 } else {
1487 pvr2_trace(PVR2_TRACE_ERROR_LEGS,
1488 "Wrong fx2 firmware size"
1489 " (expected 8192, got %u)",
1490 fwsize);
1491 }
1479 release_firmware(fw_entry); 1492 release_firmware(fw_entry);
1480 return -ENOMEM; 1493 return -ENOMEM;
1481 } 1494 }
@@ -1493,7 +1506,7 @@ static int pvr2_upload_firmware1(struct pvr2_hdw *hdw)
1493 chunk. */ 1506 chunk. */
1494 1507
1495 ret = 0; 1508 ret = 0;
1496 for(address = 0; address < fw_entry->size; address += 0x800) { 1509 for (address = 0; address < fwsize; address += 0x800) {
1497 memcpy(fw_ptr, fw_entry->data + address, 0x800); 1510 memcpy(fw_ptr, fw_entry->data + address, 0x800);
1498 ret += usb_control_msg(hdw->usb_dev, pipe, 0xa0, 0x40, address, 1511 ret += usb_control_msg(hdw->usb_dev, pipe, 0xa0, 0x40, address,
1499 0, fw_ptr, 0x800, HZ); 1512 0, fw_ptr, 0x800, HZ);
@@ -1509,8 +1522,8 @@ static int pvr2_upload_firmware1(struct pvr2_hdw *hdw)
1509 1522
1510 trace_firmware("Upload done (%d bytes sent)",ret); 1523 trace_firmware("Upload done (%d bytes sent)",ret);
1511 1524
1512 /* We should have written 8192 bytes */ 1525 /* We should have written fwsize bytes */
1513 if (ret == 8192) { 1526 if (ret == fwsize) {
1514 hdw->fw1_state = FW1_STATE_RELOAD; 1527 hdw->fw1_state = FW1_STATE_RELOAD;
1515 return 0; 1528 return 0;
1516 } 1529 }
@@ -2030,7 +2043,8 @@ static int pvr2_hdw_load_subdev(struct pvr2_hdw *hdw,
2030 fname = (mid < ARRAY_SIZE(module_names)) ? module_names[mid] : NULL; 2043 fname = (mid < ARRAY_SIZE(module_names)) ? module_names[mid] : NULL;
2031 if (!fname) { 2044 if (!fname) {
2032 pvr2_trace(PVR2_TRACE_ERROR_LEGS, 2045 pvr2_trace(PVR2_TRACE_ERROR_LEGS,
2033 "Module ID %u for device %s has no name", 2046 "Module ID %u for device %s has no name?"
2047 " The driver might have a configuration problem.",
2034 mid, 2048 mid,
2035 hdw->hdw_desc->description); 2049 hdw->hdw_desc->description);
2036 return -EINVAL; 2050 return -EINVAL;
@@ -2058,7 +2072,8 @@ static int pvr2_hdw_load_subdev(struct pvr2_hdw *hdw,
2058 if (!i2ccnt) { 2072 if (!i2ccnt) {
2059 pvr2_trace(PVR2_TRACE_ERROR_LEGS, 2073 pvr2_trace(PVR2_TRACE_ERROR_LEGS,
2060 "Module ID %u (%s) for device %s:" 2074 "Module ID %u (%s) for device %s:"
2061 " No i2c addresses", 2075 " No i2c addresses."
2076 " The driver might have a configuration problem.",
2062 mid, fname, hdw->hdw_desc->description); 2077 mid, fname, hdw->hdw_desc->description);
2063 return -EINVAL; 2078 return -EINVAL;
2064 } 2079 }
@@ -2090,7 +2105,9 @@ static int pvr2_hdw_load_subdev(struct pvr2_hdw *hdw,
2090 2105
2091 if (!sd) { 2106 if (!sd) {
2092 pvr2_trace(PVR2_TRACE_ERROR_LEGS, 2107 pvr2_trace(PVR2_TRACE_ERROR_LEGS,
2093 "Module ID %u (%s) for device %s failed to load", 2108 "Module ID %u (%s) for device %s failed to load."
2109 " Possible missing sub-device kernel module or"
2110 " initialization failure within module.",
2094 mid, fname, hdw->hdw_desc->description); 2111 mid, fname, hdw->hdw_desc->description);
2095 return -EIO; 2112 return -EIO;
2096 } 2113 }
@@ -2132,7 +2149,10 @@ static void pvr2_hdw_load_modules(struct pvr2_hdw *hdw)
2132 for (idx = 0; idx < ct->cnt; idx++) { 2149 for (idx = 0; idx < ct->cnt; idx++) {
2133 if (pvr2_hdw_load_subdev(hdw, &ct->lst[idx]) < 0) okFl = 0; 2150 if (pvr2_hdw_load_subdev(hdw, &ct->lst[idx]) < 0) okFl = 0;
2134 } 2151 }
2135 if (!okFl) pvr2_hdw_render_useless(hdw); 2152 if (!okFl) {
2153 hdw->flag_modulefail = !0;
2154 pvr2_hdw_render_useless(hdw);
2155 }
2136} 2156}
2137 2157
2138 2158
@@ -2334,6 +2354,20 @@ static void pvr2_hdw_setup(struct pvr2_hdw *hdw)
2334 break; 2354 break;
2335 } 2355 }
2336 } 2356 }
2357 if (hdw->flag_modulefail) {
2358 pvr2_trace(
2359 PVR2_TRACE_ERROR_LEGS,
2360 "***WARNING*** pvrusb2 driver initialization"
2361 " failed due to the failure of one or more"
2362 " sub-device kernel modules.");
2363 pvr2_trace(
2364 PVR2_TRACE_ERROR_LEGS,
2365 "You need to resolve the failing condition"
2366 " before this driver can function. There"
2367 " should be some earlier messages giving more"
2368 " information about the problem.");
2369 break;
2370 }
2337 if (procreload) { 2371 if (procreload) {
2338 pvr2_trace( 2372 pvr2_trace(
2339 PVR2_TRACE_ERROR_LEGS, 2373 PVR2_TRACE_ERROR_LEGS,
@@ -2419,6 +2453,8 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf,
2419 hdw = kzalloc(sizeof(*hdw),GFP_KERNEL); 2453 hdw = kzalloc(sizeof(*hdw),GFP_KERNEL);
2420 pvr2_trace(PVR2_TRACE_INIT,"pvr2_hdw_create: hdw=%p, type \"%s\"", 2454 pvr2_trace(PVR2_TRACE_INIT,"pvr2_hdw_create: hdw=%p, type \"%s\"",
2421 hdw,hdw_desc->description); 2455 hdw,hdw_desc->description);
2456 pvr2_trace(PVR2_TRACE_INFO, "Hardware description: %s",
2457 hdw_desc->description);
2422 if (!hdw) goto fail; 2458 if (!hdw) goto fail;
2423 2459
2424 init_timer(&hdw->quiescent_timer); 2460 init_timer(&hdw->quiescent_timer);
@@ -3480,7 +3516,7 @@ static u8 *pvr2_full_eeprom_fetch(struct pvr2_hdw *hdw)
3480 3516
3481 3517
3482void pvr2_hdw_cpufw_set_enabled(struct pvr2_hdw *hdw, 3518void pvr2_hdw_cpufw_set_enabled(struct pvr2_hdw *hdw,
3483 int prom_flag, 3519 int mode,
3484 int enable_flag) 3520 int enable_flag)
3485{ 3521{
3486 int ret; 3522 int ret;
@@ -3503,11 +3539,12 @@ void pvr2_hdw_cpufw_set_enabled(struct pvr2_hdw *hdw,
3503 break; 3539 break;
3504 } 3540 }
3505 3541
3506 hdw->fw_cpu_flag = (prom_flag == 0); 3542 hdw->fw_cpu_flag = (mode != 2);
3507 if (hdw->fw_cpu_flag) { 3543 if (hdw->fw_cpu_flag) {
3544 hdw->fw_size = (mode == 1) ? 0x4000 : 0x2000;
3508 pvr2_trace(PVR2_TRACE_FIRMWARE, 3545 pvr2_trace(PVR2_TRACE_FIRMWARE,
3509 "Preparing to suck out CPU firmware"); 3546 "Preparing to suck out CPU firmware"
3510 hdw->fw_size = 0x2000; 3547 " (size=%u)", hdw->fw_size);
3511 hdw->fw_buffer = kzalloc(hdw->fw_size,GFP_KERNEL); 3548 hdw->fw_buffer = kzalloc(hdw->fw_size,GFP_KERNEL);
3512 if (!hdw->fw_buffer) { 3549 if (!hdw->fw_buffer) {
3513 hdw->fw_size = 0; 3550 hdw->fw_size = 0;
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.h b/drivers/media/video/pvrusb2/pvrusb2-hdw.h
index 7b6940554e9a..56e70eae20c1 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-hdw.h
+++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.h
@@ -219,7 +219,7 @@ int pvr2_hdw_get_stdenum_value(struct pvr2_hdw *hdw,struct v4l2_standard *std,
219 this may prevent the device from running (and leaving this mode may 219 this may prevent the device from running (and leaving this mode may
220 imply a device reset). */ 220 imply a device reset). */
221void pvr2_hdw_cpufw_set_enabled(struct pvr2_hdw *, 221void pvr2_hdw_cpufw_set_enabled(struct pvr2_hdw *,
222 int prom_flag, 222 int mode, /* 0=8KB FX2, 1=16KB FX2, 2=PROM */
223 int enable_flag); 223 int enable_flag);
224 224
225/* Return true if we're in a mode for retrieval CPU firmware */ 225/* Return true if we're in a mode for retrieval CPU firmware */
diff --git a/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c b/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c
index a334b1a966a2..7cbe18c4ca95 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c
@@ -50,6 +50,7 @@ MODULE_PARM_DESC(disable_autoload_ir_video,
50 50
51/* Mapping of IR schemes to known I2C addresses - if any */ 51/* Mapping of IR schemes to known I2C addresses - if any */
52static const unsigned char ir_video_addresses[] = { 52static const unsigned char ir_video_addresses[] = {
53 [PVR2_IR_SCHEME_ZILOG] = 0x71,
53 [PVR2_IR_SCHEME_29XXX] = 0x18, 54 [PVR2_IR_SCHEME_29XXX] = 0x18,
54 [PVR2_IR_SCHEME_24XXX] = 0x18, 55 [PVR2_IR_SCHEME_24XXX] = 0x18,
55}; 56};
diff --git a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
index 2d8825e5b1be..6aa48e0ae731 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
@@ -913,6 +913,15 @@ static void pvr2_v4l2_dev_destroy(struct pvr2_v4l2_dev *dip)
913} 913}
914 914
915 915
916static void pvr2_v4l2_dev_disassociate_parent(struct pvr2_v4l2_dev *dip)
917{
918 if (!dip) return;
919 if (!dip->devbase.parent) return;
920 dip->devbase.parent = NULL;
921 device_move(&dip->devbase.dev, NULL, DPM_ORDER_NONE);
922}
923
924
916static void pvr2_v4l2_destroy_no_lock(struct pvr2_v4l2 *vp) 925static void pvr2_v4l2_destroy_no_lock(struct pvr2_v4l2 *vp)
917{ 926{
918 if (vp->dev_video) { 927 if (vp->dev_video) {
@@ -943,6 +952,8 @@ static void pvr2_v4l2_internal_check(struct pvr2_channel *chp)
943 struct pvr2_v4l2 *vp; 952 struct pvr2_v4l2 *vp;
944 vp = container_of(chp,struct pvr2_v4l2,channel); 953 vp = container_of(chp,struct pvr2_v4l2,channel);
945 if (!vp->channel.mc_head->disconnect_flag) return; 954 if (!vp->channel.mc_head->disconnect_flag) return;
955 pvr2_v4l2_dev_disassociate_parent(vp->dev_video);
956 pvr2_v4l2_dev_disassociate_parent(vp->dev_radio);
946 if (vp->vfirst) return; 957 if (vp->vfirst) return;
947 pvr2_v4l2_destroy_no_lock(vp); 958 pvr2_v4l2_destroy_no_lock(vp);
948} 959}
@@ -1250,12 +1261,13 @@ static void pvr2_v4l2_dev_init(struct pvr2_v4l2_dev *dip,
1250 struct pvr2_v4l2 *vp, 1261 struct pvr2_v4l2 *vp,
1251 int v4l_type) 1262 int v4l_type)
1252{ 1263{
1264 struct usb_device *usbdev;
1253 int mindevnum; 1265 int mindevnum;
1254 int unit_number; 1266 int unit_number;
1255 int *nr_ptr = NULL; 1267 int *nr_ptr = NULL;
1256 dip->v4lp = vp; 1268 dip->v4lp = vp;
1257 1269
1258 1270 usbdev = pvr2_hdw_get_dev(vp->channel.mc_head->hdw);
1259 dip->v4l_type = v4l_type; 1271 dip->v4l_type = v4l_type;
1260 switch (v4l_type) { 1272 switch (v4l_type) {
1261 case VFL_TYPE_GRABBER: 1273 case VFL_TYPE_GRABBER:
@@ -1296,6 +1308,7 @@ static void pvr2_v4l2_dev_init(struct pvr2_v4l2_dev *dip,
1296 if (nr_ptr && (unit_number >= 0) && (unit_number < PVR_NUM)) { 1308 if (nr_ptr && (unit_number >= 0) && (unit_number < PVR_NUM)) {
1297 mindevnum = nr_ptr[unit_number]; 1309 mindevnum = nr_ptr[unit_number];
1298 } 1310 }
1311 dip->devbase.parent = &usbdev->dev;
1299 if ((video_register_device(&dip->devbase, 1312 if ((video_register_device(&dip->devbase,
1300 dip->v4l_type, mindevnum) < 0) && 1313 dip->v4l_type, mindevnum) < 0) &&
1301 (video_register_device(&dip->devbase, 1314 (video_register_device(&dip->devbase,