From: Devin Heitmueller <[email protected]>

Address a problem found in MythTV where if we are in digital mode, switch to
analog mode, and the switch back to digital mode, the first tuning request
after switching back to digital mode gets dropped.  This is because the au8522
maintains internal state, and would think the demod was already tuned to the
target frequency.

Thanks to Zaphod Beeblebrox for reporting this issue.

Signed-off-by: Devin Heitmueller <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>

 drivers/media/dvb/frontends/au8522_decoder.c |    5 +++++
 drivers/media/dvb/frontends/au8522_dig.c     |    5 +++++
 2 files changed, 10 insertions(+), 0 deletions(-)

---

http://git.linuxtv.org/v4l-dvb.git?a=commitdiff;h=72df8f0739aa204c5b8b20942dc0e4c8b14a480e

diff --git a/drivers/media/dvb/frontends/au8522_decoder.c 
b/drivers/media/dvb/frontends/au8522_decoder.c
index ef5fd49..68dba3a 100644
--- a/drivers/media/dvb/frontends/au8522_decoder.c
+++ b/drivers/media/dvb/frontends/au8522_decoder.c
@@ -666,6 +666,11 @@ static int au8522_reset(struct v4l2_subdev *sd, u32 val)
 
        state->operational_mode = AU8522_ANALOG_MODE;
 
+       /* Clear out any state associated with the digital side of the
+          chip, so that when it gets powered back up it won't think
+          that it is already tuned */
+       state->current_frequency = 0;
+
        au8522_writereg(state, 0xa4, 1 << 5);
 
        return 0;
diff --git a/drivers/media/dvb/frontends/au8522_dig.c 
b/drivers/media/dvb/frontends/au8522_dig.c
index 532c572..44390e2 100644
--- a/drivers/media/dvb/frontends/au8522_dig.c
+++ b/drivers/media/dvb/frontends/au8522_dig.c
@@ -619,6 +619,11 @@ int au8522_init(struct dvb_frontend *fe)
 
        state->operational_mode = AU8522_DIGITAL_MODE;
 
+       /* Clear out any state associated with the digital side of the
+          chip, so that when it gets powered back up it won't think
+          that it is already tuned */
+       state->current_frequency = 0;
+
        au8522_writereg(state, 0xa4, 1 << 5);
 
        au8522_i2c_gate_ctrl(fe, 1);

_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to