aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMike Isely <isely@pobox.com>2009-03-06 22:21:30 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-03-30 11:43:34 -0400
commitaf78e16b5d5ba74566814ba0f50ee1d736d933a5 (patch)
treee679949245b8ea7f79125f7140ba2909496a9635 /drivers
parent6907205bcbe7b8bcdc0720bc75e1d2558162d017 (diff)
V4L/DVB (11171): pvrusb2: Tie in sub-device decoder start/stop
Implement code to send appropriate streaming start/stop commands to attached sub-devices Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-hdw.c65
1 files changed, 39 insertions, 26 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
index 65e65a4f2ec0..74b365f1cfd2 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
@@ -1655,19 +1655,29 @@ static const char *pvr2_get_state_name(unsigned int st)
1655 1655
1656static int pvr2_decoder_enable(struct pvr2_hdw *hdw,int enablefl) 1656static int pvr2_decoder_enable(struct pvr2_hdw *hdw,int enablefl)
1657{ 1657{
1658 if (!hdw->decoder_ctrl) { 1658 if (hdw->decoder_ctrl) {
1659 if (!hdw->flag_decoder_missed) { 1659 hdw->decoder_ctrl->enable(hdw->decoder_ctrl->ctxt, enablefl);
1660 pvr2_trace(PVR2_TRACE_ERROR_LEGS, 1660 return 0;
1661 "WARNING: No decoder present");
1662 hdw->flag_decoder_missed = !0;
1663 trace_stbit("flag_decoder_missed",
1664 hdw->flag_decoder_missed);
1665 }
1666 return -EIO;
1667 } 1661 }
1668 hdw->decoder_ctrl->enable(hdw->decoder_ctrl->ctxt,enablefl); 1662 /* Even though we really only care about the video decoder chip at
1669 // ????? 1663 this point, we'll broadcast stream on/off to all sub-devices
1670 return 0; 1664 anyway, just in case somebody else wants to hear the
1665 command... */
1666 v4l2_device_call_all(&hdw->v4l2_dev, 0, video, s_stream, enablefl);
1667 if (hdw->decoder_client_id) {
1668 /* We get here if the encoder has been noticed. Otherwise
1669 we'll issue a warning to the user (which should
1670 normally never happen). */
1671 return 0;
1672 }
1673 if (!hdw->flag_decoder_missed) {
1674 pvr2_trace(PVR2_TRACE_ERROR_LEGS,
1675 "WARNING: No decoder present");
1676 hdw->flag_decoder_missed = !0;
1677 trace_stbit("flag_decoder_missed",
1678 hdw->flag_decoder_missed);
1679 }
1680 return -EIO;
1671} 1681}
1672 1682
1673 1683
@@ -4009,23 +4019,26 @@ int pvr2_hdw_cmd_powerdown(struct pvr2_hdw *hdw)
4009 4019
4010int pvr2_hdw_cmd_decoder_reset(struct pvr2_hdw *hdw) 4020int pvr2_hdw_cmd_decoder_reset(struct pvr2_hdw *hdw)
4011{ 4021{
4012 if (!hdw->decoder_ctrl) { 4022 pvr2_trace(PVR2_TRACE_INIT,
4013 pvr2_trace(PVR2_TRACE_INIT, 4023 "Requesting decoder reset");
4014 "Unable to reset decoder: nothing attached"); 4024 if (hdw->decoder_ctrl) {
4015 return -ENOTTY; 4025 if (!hdw->decoder_ctrl->force_reset) {
4026 pvr2_trace(PVR2_TRACE_INIT,
4027 "Unable to reset decoder: not implemented");
4028 return -ENOTTY;
4029 }
4030 hdw->decoder_ctrl->force_reset(hdw->decoder_ctrl->ctxt);
4031 return 0;
4032 } else {
4016 } 4033 }
4017 4034 if (hdw->decoder_client_id) {
4018 if (!hdw->decoder_ctrl->force_reset) { 4035 v4l2_device_call_all(&hdw->v4l2_dev, hdw->decoder_client_id,
4019 pvr2_trace(PVR2_TRACE_INIT, 4036 core, reset, 0);
4020 "Unable to reset decoder: not implemented"); 4037 return 0;
4021 return -ENOTTY;
4022 } 4038 }
4023
4024 pvr2_trace(PVR2_TRACE_INIT, 4039 pvr2_trace(PVR2_TRACE_INIT,
4025 "Requesting decoder reset"); 4040 "Unable to reset decoder: nothing attached");
4026 hdw->decoder_ctrl->force_reset(hdw->decoder_ctrl->ctxt); 4041 return -ENOTTY;
4027 // ?????
4028 return 0;
4029} 4042}
4030 4043
4031 4044