V4L/DVB (4032): Fix Pinnacle 300i
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / media / dvb / frontends / mt352.c
index ed3bede029eb2e4b78122012127366e2f9c6a222..8601a3f43074833301639f1ed2182eb00ce69d34 100644 (file)
@@ -287,30 +287,22 @@ static int mt352_set_parameters(struct dvb_frontend* fe,
        mt352_calc_nominal_rate(state, op->bandwidth, buf+4);
        mt352_calc_input_freq(state, buf+6);
 
-       // if there is no secondary tuner, call set_params to set up a potential
-       // tuner attached elsewhere
        if (state->config.no_tuner) {
                if (fe->ops->tuner_ops.set_params) {
                        fe->ops->tuner_ops.set_params(fe, param);
-                       if (fe->ops->i2c_gate_ctrl) fe->ops->i2c_gate_ctrl(fe, 0);
+                       if (fe->ops->i2c_gate_ctrl)
+                               fe->ops->i2c_gate_ctrl(fe, 0);
                }
 
-               /* start decoding only */
+               mt352_write(fe, buf, 8);
                mt352_write(fe, fsm_go, 2);
-       }
-
-       // retrieve the pllbuf - we do this even if there is no
-       // secondary tuner simply so we have a record of what was sent for
-       // debugging.
-       if (fe->ops->tuner_ops.calc_regs) {
-               fe->ops->tuner_ops.calc_regs(fe, param, buf+8, 5);
-               buf[8] <<= 1;
-               mt352_write(fe, buf, sizeof(buf));
-       }
-
-       // send PLL and start tuning and then decoding
-       if (!state->config.no_tuner) {
-               mt352_write(fe, tuner_go, 2);
+       } else {
+               if (fe->ops->tuner_ops.calc_regs) {
+                       fe->ops->tuner_ops.calc_regs(fe, param, buf+8, 5);
+                       buf[8] <<= 1;
+                       mt352_write(fe, buf, sizeof(buf));
+                       mt352_write(fe, tuner_go, 2);
+               }
        }
 
        return 0;