diff options
author | Mike Isely <isely@pobox.com> | 2006-03-25 16:40:16 -0600 |
---|---|---|
committer | Mike Isely <isely@pobox.com> | 2006-03-25 16:40:16 -0600 |
commit | 22184ee779d37f2c64b08ea427d939f0e2d58b37 (patch) | |
tree | adfb0a1119f17af1ea3cd344bbf04a51f128a766 /linux/drivers/media/video | |
parent | acea6b43b12c290328f857fa981b2c8b3d598b45 (diff) | |
download | mediapointer-dvb-s2-22184ee779d37f2c64b08ea427d939f0e2d58b37.tar.gz mediapointer-dvb-s2-22184ee779d37f2c64b08ea427d939f0e2d58b37.tar.bz2 |
Implement method in pvrusb2 to force the decoder to reset
From: Mike Isely <isely@pobox.com>
This change threads logic through the pvrusb2 to make it possible to
command the decoder chip to reset itself. The method is
decoder-agnostic; the part of the pvrusb2 which control's that chip's
module has to provide the final hook. This just lays the foundation.
Signed-off-by: Mike Isely <isely@pobox.com>
Diffstat (limited to 'linux/drivers/media/video')
4 files changed, 27 insertions, 0 deletions
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-debugifc.c b/linux/drivers/media/video/pvrusb2/pvrusb2-debugifc.c index f5c267123..16e6ea317 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-debugifc.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-debugifc.c @@ -367,6 +367,8 @@ int pvr2_debugifc_do1cmd(struct pvr2_hdw *hdw,const char *buf, return pvr2_hdw_cmd_deep_reset(hdw); } else if (debugifc_match_keyword(wptr,wlen,"firmware")) { return pvr2_upload_firmware2(hdw); + } else if (debugifc_match_keyword(wptr,wlen,"decoder")) { + return pvr2_hdw_cmd_decoder_reset(hdw); } return -EINVAL; } else if (debugifc_match_keyword(wptr,wlen,"subsys_flags")) { diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h index 1b161773b..05e44385b 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h @@ -74,6 +74,7 @@ struct pvr2_decoder_ctrl { void (*detach)(void *); void (*enable)(void *,int); int (*tuned)(void *); + void (*force_reset)(void *); }; #define PVR2_I2C_PEND_DETECT 0x01 /* Need to detect a client type */ diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c index 6a729c4c7..16757a8fb 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c @@ -2420,6 +2420,27 @@ int pvr2_hdw_cmd_powerup(struct pvr2_hdw *hdw) } +int pvr2_hdw_cmd_decoder_reset(struct pvr2_hdw *hdw) +{ + if (!hdw->decoder_ctrl) { + pvr2_trace(PVR2_TRACE_INIT, + "Unable to reset decoder: nothing attached"); + return -ENOTTY; + } + + if (!hdw->decoder_ctrl->force_reset) { + pvr2_trace(PVR2_TRACE_INIT, + "Unable to reset decoder: not implemented"); + return -ENOTTY; + } + + pvr2_trace(PVR2_TRACE_INIT, + "Requesting decoder reset"); + hdw->decoder_ctrl->force_reset(hdw->decoder_ctrl->ctxt); + return 0; +} + + int pvr2_hdw_cmd_usbstream(struct pvr2_hdw *hdw,int runFl) { int status; diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h index 69ad5e1b1..cf5231ee9 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h @@ -360,6 +360,9 @@ int pvr2_hdw_cmd_deep_reset(struct pvr2_hdw *); /* Execute simple reset command */ int pvr2_hdw_cmd_powerup(struct pvr2_hdw *); +/* Order decoder to reset */ +int pvr2_hdw_cmd_decoder_reset(struct pvr2_hdw *); + /* Stop / start video stream transport */ int pvr2_hdw_cmd_usbstream(struct pvr2_hdw *hdw,int runFl); |