]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
V4L/DVB (9774): tda827x: fix returned frequency
authorMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 8 Dec 2008 03:49:33 +0000 (00:49 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 30 Dec 2008 11:38:18 +0000 (09:38 -0200)
Probably due to a removed code, tda827x were doing some wrong calculus at the
returned frequency. I suspect that the original idea were to return the
programmed divisor converted into frequency again.

However, the current code is sometimes multiplying the programmed frequency by
62500, and, on other cases, like radio, it dividing it by 1000.

Instead of doing such math, let's just store the frequency value as requested by
the caller module.

Cc: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/common/tuners/tda827x.c

index f221cee4c6870af218d73578d3dced6c96edb7cb..f4d931f14fad5bae30b8fc73e94aeec3e9891199 100644 (file)
@@ -200,7 +200,7 @@ static int tda827xo_set_params(struct dvb_frontend *fe,
                fe->ops.i2c_gate_ctrl(fe, 1);
        i2c_transfer(priv->i2c_adap, &msg, 1);
 
-       priv->frequency = tuner_freq - if_freq; // FIXME
+       priv->frequency = params->frequency;
        priv->bandwidth = (fe->ops.info.type == FE_OFDM) ? params->u.ofdm.bandwidth : 0;
 
        return 0;
@@ -305,7 +305,7 @@ static int tda827xo_set_analog_params(struct dvb_frontend *fe,
        reg2[1] = 0x08;   /* Vsync en */
        i2c_transfer(priv->i2c_adap, &msg, 1);
 
-       priv->frequency = freq * 62500;
+       priv->frequency = params->frequency;
 
        return 0;
 }
@@ -592,7 +592,7 @@ static int tda827xa_set_params(struct dvb_frontend *fe,
                fe->ops.i2c_gate_ctrl(fe, 1);
        i2c_transfer(priv->i2c_adap, &msg, 1);
 
-       priv->frequency = tuner_freq - if_freq; // FIXME
+       priv->frequency = params->frequency;
        priv->bandwidth = (fe->ops.info.type == FE_OFDM) ? params->u.ofdm.bandwidth : 0;
 
        return 0;
@@ -692,7 +692,7 @@ static int tda827xa_set_analog_params(struct dvb_frontend *fe,
        tuner_reg[1] = 0x19 + (priv->lpsel << 1);
        i2c_transfer(priv->i2c_adap, &msg, 1);
 
-       priv->frequency = freq * 62500;
+       priv->frequency = params->frequency;
 
        return 0;
 }