aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/pvrusb2
diff options
context:
space:
mode:
authorMike Isely <isely@pobox.com>2007-10-14 17:18:12 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-10-22 10:01:51 -0400
commit9a607f01b044dd83aa6daf6edad1e98cfc8c33ba (patch)
treeca3e95fbf3753785800b514692d1a58870943039 /drivers/media/video/pvrusb2
parenta39a8ed7beaafe02ce154dfd227f7d734a9f34dc (diff)
V4L/DVB (6357): pvrusb2: Improve encoder chip health tracking
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> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/pvrusb2')
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-encoder.c6
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h11
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-hdw.c3
3 files changed, 15 insertions, 5 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-encoder.c b/drivers/media/video/pvrusb2/pvrusb2-encoder.c
index 20b614436d2c..205087a3e136 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-encoder.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-encoder.c
@@ -209,6 +209,11 @@ static int pvr2_encoder_cmd(void *ctxt,
209 209
210 LOCK_TAKE(hdw->ctl_lock); do { 210 LOCK_TAKE(hdw->ctl_lock); do {
211 211
212 if (!hdw->flag_encoder_ok) {
213 ret = -EIO;
214 break;
215 }
216
212 retry_flag = 0; 217 retry_flag = 0;
213 try_count++; 218 try_count++;
214 ret = 0; 219 ret = 0;
@@ -273,6 +278,7 @@ static int pvr2_encoder_cmd(void *ctxt,
273 ret = -EBUSY; 278 ret = -EBUSY;
274 } 279 }
275 if (ret) { 280 if (ret) {
281 hdw->flag_encoder_ok = 0;
276 pvr2_trace( 282 pvr2_trace(
277 PVR2_TRACE_ERROR_LEGS, 283 PVR2_TRACE_ERROR_LEGS,
278 "Giving up on command." 284 "Giving up on command."
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h b/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h
index 985d9ae7f5ee..f873994b088c 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h
+++ b/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h
@@ -225,11 +225,12 @@ struct pvr2_hdw {
225 unsigned int cmd_debug_write_len; // 225 unsigned int cmd_debug_write_len; //
226 unsigned int cmd_debug_read_len; // 226 unsigned int cmd_debug_read_len; //
227 227
228 int flag_ok; // device in known good state 228 int flag_ok; /* device in known good state */
229 int flag_disconnected; // flag_ok == 0 due to disconnect 229 int flag_disconnected; /* flag_ok == 0 due to disconnect */
230 int flag_init_ok; // true if structure is fully initialized 230 int flag_init_ok; /* true if structure is fully initialized */
231 int flag_streaming_enabled; // true if streaming should be on 231 int flag_streaming_enabled; /* true if streaming should be on */
232 int fw1_state; // current situation with fw1 232 int fw1_state; /* current situation with fw1 */
233 int flag_encoder_ok; /* True if encoder is healthy */
233 234
234 int flag_decoder_is_tuned; 235 int flag_decoder_is_tuned;
235 236
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
index 27b12b4b5c88..402c59488253 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
@@ -1248,6 +1248,8 @@ int pvr2_upload_firmware2(struct pvr2_hdw *hdw)
1248 time we configure the encoder, then we'll fully configure it. */ 1248 time we configure the encoder, then we'll fully configure it. */
1249 hdw->enc_cur_valid = 0; 1249 hdw->enc_cur_valid = 0;
1250 1250
1251 hdw->flag_encoder_ok = 0;
1252
1251 /* First prepare firmware loading */ 1253 /* First prepare firmware loading */
1252 ret |= pvr2_write_register(hdw, 0x0048, 0xffffffff); /*interrupt mask*/ 1254 ret |= pvr2_write_register(hdw, 0x0048, 0xffffffff); /*interrupt mask*/
1253 ret |= pvr2_hdw_gpio_chg_dir(hdw,0xffffffff,0x00000088); /*gpio dir*/ 1255 ret |= pvr2_hdw_gpio_chg_dir(hdw,0xffffffff,0x00000088); /*gpio dir*/
@@ -1346,6 +1348,7 @@ int pvr2_upload_firmware2(struct pvr2_hdw *hdw)
1346 pvr2_trace(PVR2_TRACE_ERROR_LEGS, 1348 pvr2_trace(PVR2_TRACE_ERROR_LEGS,
1347 "firmware2 upload post-proc failure"); 1349 "firmware2 upload post-proc failure");
1348 } else { 1350 } else {
1351 hdw->flag_encoder_ok = !0;
1349 hdw->subsys_enabled_mask |= (1<<PVR2_SUBSYS_B_ENC_FIRMWARE); 1352 hdw->subsys_enabled_mask |= (1<<PVR2_SUBSYS_B_ENC_FIRMWARE);
1350 } 1353 }
1351 return ret; 1354 return ret;