提交 bb0c2fe0 编写于 作者: M Mike Isely 提交者: Mauro Carvalho Chehab

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: NMike Isely <isely@pobox.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@infradead.org>
上级 1c9d10d4
...@@ -3377,9 +3377,7 @@ static void pvr2_hdw_cmd_modeswitch(struct pvr2_hdw *hdw,int digitalFl) ...@@ -3377,9 +3377,7 @@ static void pvr2_hdw_cmd_modeswitch(struct pvr2_hdw *hdw,int digitalFl)
/* Supposedly we should always have the power on whether in /* Supposedly we should always have the power on whether in
digital or analog mode. But for now do what appears to digital or analog mode. But for now do what appears to
work... */ work... */
if (digitalFl) pvr2_hdw_cmd_onair_fe_power_ctrl(hdw,!0); pvr2_hdw_cmd_onair_fe_power_ctrl(hdw,digitalFl);
pvr2_hdw_cmd_onair_digital_path_ctrl(hdw,digitalFl);
if (!digitalFl) pvr2_hdw_cmd_onair_fe_power_ctrl(hdw,0);
break; break;
default: break; default: break;
} }
...@@ -3437,19 +3435,43 @@ static void pvr2_led_ctrl(struct pvr2_hdw *hdw,int onoff) ...@@ -3437,19 +3435,43 @@ static void pvr2_led_ctrl(struct pvr2_hdw *hdw,int onoff)
/* Stop / start video stream transport */ /* Stop / start video stream transport */
static int pvr2_hdw_cmd_usbstream(struct pvr2_hdw *hdw,int runFl) static int pvr2_hdw_cmd_usbstream(struct pvr2_hdw *hdw,int runFl)
{ {
int cc; int ret;
if ((hdw->pathway_state == PVR2_PATHWAY_DIGITAL) &&
(hdw->hdw_desc->digital_control_scheme == /* If we're in analog mode, then just issue the usual analog
PVR2_DIGITAL_SCHEME_HAUPPAUGE)) { command. */
cc = (runFl ? if (hdw->pathway_state == PVR2_PATHWAY_ANALOG) {
FX2CMD_HCW_DTV_STREAMING_ON : return pvr2_issue_simple_cmd(hdw,
FX2CMD_HCW_DTV_STREAMING_OFF); (runFl ?
} else { FX2CMD_STREAMING_ON :
cc = (runFl ? FX2CMD_STREAMING_OFF));
FX2CMD_STREAMING_ON : /*Note: Not reached */
FX2CMD_STREAMING_OFF); }
if (hdw->pathway_state != PVR2_PATHWAY_DIGITAL) {
/* Whoops, we don't know what mode we're in... */
return -EINVAL;
}
/* To get here we have to be in digital mode. The mechanism here
is unfortunately different for different vendors. So we switch
on the device's digital scheme attribute in order to figure out
what to do. */
switch (hdw->hdw_desc->digital_control_scheme) {
case PVR2_DIGITAL_SCHEME_HAUPPAUGE:
return pvr2_issue_simple_cmd(hdw,
(runFl ?
FX2CMD_HCW_DTV_STREAMING_ON :
FX2CMD_HCW_DTV_STREAMING_OFF));
case PVR2_DIGITAL_SCHEME_ONAIR:
ret = pvr2_issue_simple_cmd(hdw,
(runFl ?
FX2CMD_STREAMING_ON :
FX2CMD_STREAMING_OFF));
if (ret) return ret;
return pvr2_hdw_cmd_onair_digital_path_ctrl(hdw,runFl);
default:
return -EINVAL;
} }
return pvr2_issue_simple_cmd(hdw,cc);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册