[PATCH] af9013 Extended monitoring in set_frontend.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Try this patch, it should stop start up corruption on the same frontend.

It is a missing section of code that checks the frontend is ready to go.

However, it will not stop corruptions on frontend A.

af9013 Extended monitoring in set_front.

---
 drivers/media/dvb/frontends/af9013.c |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/drivers/media/dvb/frontends/af9013.c b/drivers/media/dvb/frontends/af9013.c
index b220a87..347c187 100644
--- a/drivers/media/dvb/frontends/af9013.c
+++ b/drivers/media/dvb/frontends/af9013.c
@@ -622,8 +622,9 @@ static int af9013_set_frontend(struct dvb_frontend *fe,
 	struct dvb_frontend_parameters *params)
 {
 	struct af9013_state *state = fe->demodulator_priv;
-	int ret;
+	int ret, i;
 	u8 auto_mode; /* auto set TPS */
+	u8 v1, v2;
 
 	deb_info("%s: freq:%d bw:%d\n", __func__, params->frequency,
 		params->u.ofdm.bandwidth);
@@ -694,6 +695,19 @@ static int af9013_set_frontend(struct dvb_frontend *fe,
 	if (ret)
 		goto error;
 
+	for (i = 0; i < 27; ++i) {
+		ret = af9013_read_reg(state, 0x9bc2, &v1);
+		if (ret)
+			break;
+		ret = af9013_read_reg(state, 0xd330, &v2);
+		if (ret)
+			break;
+		if (v1 == 0 && v2 > 0)
+				break;
+		msleep(40);
+	}
+
+
 error:
 	return ret;
 }
-- 
1.7.5.4


--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux