diff options
author | Mike Isely <isely@pobox.com> | 2007-10-14 16:18:12 -0500 |
---|---|---|
committer | Mike Isely <isely@pobox.com> | 2007-10-14 16:18:12 -0500 |
commit | bb67e760e1e642830860904df5bcedac3d1195b3 (patch) | |
tree | caaa0d7e259fde821fa3fbe5063abfd3efb3c24a /linux/drivers/media/video | |
parent | b0810ae831bd969b353b8eacf0547c554a40eb88 (diff) | |
download | mediapointer-dvb-s2-bb67e760e1e642830860904df5bcedac3d1195b3.tar.gz mediapointer-dvb-s2-bb67e760e1e642830860904df5bcedac3d1195b3.tar.bz2 |
pvrusb2: Improve encoder chip health tracking
From: Mike Isely <isely@pobox.com>
This is a minor change to help with tracking the viability of the
encoder chip within the PVR USB2 device.
Signed-off-by: Mike Isely <isely@pobox.com>
Diffstat (limited to 'linux/drivers/media/video')
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-encoder.c | 6 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h | 11 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c | 3 |
3 files changed, 15 insertions, 5 deletions
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-encoder.c b/linux/drivers/media/video/pvrusb2/pvrusb2-encoder.c index 4abee970c..7a27dece2 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-encoder.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-encoder.c @@ -231,6 +231,11 @@ static int pvr2_encoder_cmd(void *ctxt, LOCK_TAKE(hdw->ctl_lock); do { + if (!hdw->flag_encoder_ok) { + ret = -EIO; + break; + } + retry_flag = 0; try_count++; ret = 0; @@ -295,6 +300,7 @@ static int pvr2_encoder_cmd(void *ctxt, ret = -EBUSY; } if (ret) { + hdw->flag_encoder_ok = 0; pvr2_trace( PVR2_TRACE_ERROR_LEGS, "Giving up on command." diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h index d8ac8e783..fbe5d46d6 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h @@ -241,11 +241,12 @@ struct pvr2_hdw { unsigned int cmd_debug_write_len; // unsigned int cmd_debug_read_len; // - int flag_ok; // device in known good state - int flag_disconnected; // flag_ok == 0 due to disconnect - int flag_init_ok; // true if structure is fully initialized - int flag_streaming_enabled; // true if streaming should be on - int fw1_state; // current situation with fw1 + int flag_ok; /* device in known good state */ + int flag_disconnected; /* flag_ok == 0 due to disconnect */ + int flag_init_ok; /* true if structure is fully initialized */ + int flag_streaming_enabled; /* true if streaming should be on */ + int fw1_state; /* current situation with fw1 */ + int flag_encoder_ok; /* True if encoder is healthy */ int flag_decoder_is_tuned; diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c index 91f27facb..328bd1ba6 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c @@ -1258,6 +1258,8 @@ int pvr2_upload_firmware2(struct pvr2_hdw *hdw) time we configure the encoder, then we'll fully configure it. */ hdw->enc_cur_valid = 0; + hdw->flag_encoder_ok = 0; + /* First prepare firmware loading */ ret |= pvr2_write_register(hdw, 0x0048, 0xffffffff); /*interrupt mask*/ ret |= pvr2_hdw_gpio_chg_dir(hdw,0xffffffff,0x00000088); /*gpio dir*/ @@ -1356,6 +1358,7 @@ int pvr2_upload_firmware2(struct pvr2_hdw *hdw) pvr2_trace(PVR2_TRACE_ERROR_LEGS, "firmware2 upload post-proc failure"); } else { + hdw->flag_encoder_ok = !0; hdw->subsys_enabled_mask |= (1<<PVR2_SUBSYS_B_ENC_FIRMWARE); } return ret; |