aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorMike Isely <isely@pobox.com>2008-03-28 04:41:19 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-24 13:09:47 -0400
commitbb0c2fe0c423d6501395e626501dd8747823cafb (patch)
tree4e1c70a49d20782e9d406cf31f84c387e022d417 /drivers/media
parent1c9d10d4d2e791a9eacd9f919dec78c5bc6737e8 (diff)
V4L/DVB (7702): pvrusb2: Rework USB streaming start/stop execution
The commands to start / stop USB streaming for an analog device are fairly standard, owing to the fact that all supported devices apparently started from the same common reference design. However with digital mode, the commands seem to vary by vendor. This change makes that variance more explicit. It also cleans up a related problem for OnAir devices which prevented digital mode from working at all. Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-hdw.c52
1 files changed, 37 insertions, 15 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
index 063aed0067cd..b711328400e1 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
@@ -3377,9 +3377,7 @@ static void pvr2_hdw_cmd_modeswitch(struct pvr2_hdw *hdw,int digitalFl)
3377 /* Supposedly we should always have the power on whether in 3377 /* Supposedly we should always have the power on whether in
3378 digital or analog mode. But for now do what appears to 3378 digital or analog mode. But for now do what appears to
3379 work... */ 3379 work... */
3380 if (digitalFl) pvr2_hdw_cmd_onair_fe_power_ctrl(hdw,!0); 3380 pvr2_hdw_cmd_onair_fe_power_ctrl(hdw,digitalFl);
3381 pvr2_hdw_cmd_onair_digital_path_ctrl(hdw,digitalFl);
3382 if (!digitalFl) pvr2_hdw_cmd_onair_fe_power_ctrl(hdw,0);
3383 break; 3381 break;
3384 default: break; 3382 default: break;
3385 } 3383 }
@@ -3437,19 +3435,43 @@ static void pvr2_led_ctrl(struct pvr2_hdw *hdw,int onoff)
3437/* Stop / start video stream transport */ 3435/* Stop / start video stream transport */
3438static int pvr2_hdw_cmd_usbstream(struct pvr2_hdw *hdw,int runFl) 3436static int pvr2_hdw_cmd_usbstream(struct pvr2_hdw *hdw,int runFl)
3439{ 3437{
3440 int cc; 3438 int ret;
3441 if ((hdw->pathway_state == PVR2_PATHWAY_DIGITAL) && 3439
3442 (hdw->hdw_desc->digital_control_scheme == 3440 /* If we're in analog mode, then just issue the usual analog
3443 PVR2_DIGITAL_SCHEME_HAUPPAUGE)) { 3441 command. */
3444 cc = (runFl ? 3442 if (hdw->pathway_state == PVR2_PATHWAY_ANALOG) {
3445 FX2CMD_HCW_DTV_STREAMING_ON : 3443 return pvr2_issue_simple_cmd(hdw,
3446 FX2CMD_HCW_DTV_STREAMING_OFF); 3444 (runFl ?
3447 } else { 3445 FX2CMD_STREAMING_ON :
3448 cc = (runFl ? 3446 FX2CMD_STREAMING_OFF));
3449 FX2CMD_STREAMING_ON : 3447 /*Note: Not reached */
3450 FX2CMD_STREAMING_OFF); 3448 }
3449
3450 if (hdw->pathway_state != PVR2_PATHWAY_DIGITAL) {
3451 /* Whoops, we don't know what mode we're in... */
3452 return -EINVAL;
3453 }
3454
3455 /* To get here we have to be in digital mode. The mechanism here
3456 is unfortunately different for different vendors. So we switch
3457 on the device's digital scheme attribute in order to figure out
3458 what to do. */
3459 switch (hdw->hdw_desc->digital_control_scheme) {
3460 case PVR2_DIGITAL_SCHEME_HAUPPAUGE:
3461 return pvr2_issue_simple_cmd(hdw,
3462 (runFl ?
3463 FX2CMD_HCW_DTV_STREAMING_ON :
3464 FX2CMD_HCW_DTV_STREAMING_OFF));
3465 case PVR2_DIGITAL_SCHEME_ONAIR:
3466 ret = pvr2_issue_simple_cmd(hdw,
3467 (runFl ?
3468 FX2CMD_STREAMING_ON :
3469 FX2CMD_STREAMING_OFF));
3470 if (ret) return ret;
3471 return pvr2_hdw_cmd_onair_digital_path_ctrl(hdw,runFl);
3472 default:
3473 return -EINVAL;
3451 } 3474 }
3452 return pvr2_issue_simple_cmd(hdw,cc);
3453} 3475}
3454 3476
3455 3477