[media] drx-j: be sure to use tuner's IF
authorMauro Carvalho Chehab <m.chehab@samsung.com>
Sun, 26 Jan 2014 18:02:25 +0000 (15:02 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Tue, 4 Mar 2014 17:36:48 +0000 (14:36 -0300)
Instead of just hardcoding an IF value of 5MHz, use the one
provided by the tuner, with can be different for QAM and
VSB.

Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/dvb-frontends/drx39xyj/drxj.c

index c9608e627ccaf33292bb798d36e5b94b18bd35c0..ccd847e10797d4080133a0e9c97f9fdba27a3c62 100644 (file)
@@ -20171,11 +20171,21 @@ static int drx39xxj_set_frontend(struct dvb_frontend *fe)
        /* Bring the demod out of sleep */
        drx39xxj_set_powerstate(fe, 1);
 
-       /* Now make the tuner do it's thing... */
        if (fe->ops.tuner_ops.set_params) {
+               u32 int_freq;
+
                if (fe->ops.i2c_gate_ctrl)
                        fe->ops.i2c_gate_ctrl(fe, 1);
+
+               /* Set tuner to desired frequency and standard */
                fe->ops.tuner_ops.set_params(fe);
+
+               /* Use the tuner's IF */
+               if (fe->ops.tuner_ops.get_if_frequency) {
+                       fe->ops.tuner_ops.get_if_frequency(fe, &int_freq);
+                       demod->my_common_attr->intermediate_freq = int_freq / 1000;
+               }
+
                if (fe->ops.i2c_gate_ctrl)
                        fe->ops.i2c_gate_ctrl(fe, 0);
        }