Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9a607f01 authored by Mike Isely's avatar Mike Isely Committed by Mauro Carvalho Chehab
Browse files

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: default avatarMike Isely <isely@pobox.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent a39a8ed7
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -209,6 +209,11 @@ static int pvr2_encoder_cmd(void *ctxt,


	LOCK_TAKE(hdw->ctl_lock); do {
	LOCK_TAKE(hdw->ctl_lock); do {


		if (!hdw->flag_encoder_ok) {
			ret = -EIO;
			break;
		}

		retry_flag = 0;
		retry_flag = 0;
		try_count++;
		try_count++;
		ret = 0;
		ret = 0;
@@ -273,6 +278,7 @@ static int pvr2_encoder_cmd(void *ctxt,
			ret = -EBUSY;
			ret = -EBUSY;
		}
		}
		if (ret) {
		if (ret) {
			hdw->flag_encoder_ok = 0;
			pvr2_trace(
			pvr2_trace(
				PVR2_TRACE_ERROR_LEGS,
				PVR2_TRACE_ERROR_LEGS,
				"Giving up on command."
				"Giving up on command."
+6 −5
Original line number Original line Diff line number Diff line
@@ -225,11 +225,12 @@ struct pvr2_hdw {
	unsigned int cmd_debug_write_len;  //
	unsigned int cmd_debug_write_len;  //
	unsigned int cmd_debug_read_len;   //
	unsigned int cmd_debug_read_len;   //


	int flag_ok;            // device in known good state
	int flag_ok;            /* device in known good state */
	int flag_disconnected;  // flag_ok == 0 due to disconnect
	int flag_disconnected;  /* flag_ok == 0 due to disconnect */
	int flag_init_ok;       // true if structure is fully initialized
	int flag_init_ok;       /* true if structure is fully initialized */
	int flag_streaming_enabled; // true if streaming should be on
	int flag_streaming_enabled; /* true if streaming should be on */
	int fw1_state;          // current situation with fw1
	int fw1_state;          /* current situation with fw1 */
	int flag_encoder_ok;    /* True if encoder is healthy */


	int flag_decoder_is_tuned;
	int flag_decoder_is_tuned;


+3 −0
Original line number Original line Diff line number Diff line
@@ -1248,6 +1248,8 @@ int pvr2_upload_firmware2(struct pvr2_hdw *hdw)
	   time we configure the encoder, then we'll fully configure it. */
	   time we configure the encoder, then we'll fully configure it. */
	hdw->enc_cur_valid = 0;
	hdw->enc_cur_valid = 0;


	hdw->flag_encoder_ok = 0;

	/* First prepare firmware loading */
	/* First prepare firmware loading */
	ret |= pvr2_write_register(hdw, 0x0048, 0xffffffff); /*interrupt mask*/
	ret |= pvr2_write_register(hdw, 0x0048, 0xffffffff); /*interrupt mask*/
	ret |= pvr2_hdw_gpio_chg_dir(hdw,0xffffffff,0x00000088); /*gpio dir*/
	ret |= pvr2_hdw_gpio_chg_dir(hdw,0xffffffff,0x00000088); /*gpio dir*/
@@ -1346,6 +1348,7 @@ int pvr2_upload_firmware2(struct pvr2_hdw *hdw)
		pvr2_trace(PVR2_TRACE_ERROR_LEGS,
		pvr2_trace(PVR2_TRACE_ERROR_LEGS,
			   "firmware2 upload post-proc failure");
			   "firmware2 upload post-proc failure");
	} else {
	} else {
		hdw->flag_encoder_ok = !0;
		hdw->subsys_enabled_mask |= (1<<PVR2_SUBSYS_B_ENC_FIRMWARE);
		hdw->subsys_enabled_mask |= (1<<PVR2_SUBSYS_B_ENC_FIRMWARE);
	}
	}
	return ret;
	return ret;