[media] ds3000: fill in demod init function
authorIgor M. Liplianin <liplianin@me.by>
Tue, 1 Feb 2011 22:40:03 +0000 (19:40 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 21 Mar 2011 23:32:19 +0000 (20:32 -0300)
Make some initializations in init, not in tune function

Signed-off-by: Igor M. Liplianin <liplianin@me.by>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb/frontends/ds3000.c

index fc61d9230db8bd1d0eb9541e8698da647f0a5367..655f182e7ff4aa94f796e48bb814d622edcd34c3 100644 (file)
@@ -1065,10 +1065,6 @@ static int ds3000_tune(struct dvb_frontend *fe,
                /* Reset status register */
                status = 0;
                /* Tune */
-               /* TS2020 init */
-               ds3000_tuner_writereg(state, 0x42, 0x73);
-               ds3000_tuner_writereg(state, 0x05, 0x01);
-               ds3000_tuner_writereg(state, 0x62, 0xf5);
                /* unknown */
                ds3000_tuner_writereg(state, 0x07, 0x02);
                ds3000_tuner_writereg(state, 0x10, 0x00);
@@ -1306,7 +1302,19 @@ static enum dvbfe_algo ds3000_get_algo(struct dvb_frontend *fe)
  */
 static int ds3000_initfe(struct dvb_frontend *fe)
 {
+       struct ds3000_state *state = fe->demodulator_priv;
+       int ret;
+
        dprintk("%s()\n", __func__);
+       /* hard reset */
+       ds3000_writereg(state, 0x08, 0x01 | ds3000_readreg(state, 0x08));
+       msleep(1);
+
+       /* TS2020 init */
+       ds3000_tuner_writereg(state, 0x42, 0x73);
+       ds3000_tuner_writereg(state, 0x05, 0x01);
+       ds3000_tuner_writereg(state, 0x62, 0xf5);
+
        return 0;
 }