]> err.no Git - linux-2.6/commitdiff
V4L/DVB (6963): tda18271: store IF frequency in a u16 instead of u32
authorMichael Krufky <mkrufky@linuxtv.org>
Thu, 3 Jan 2008 04:17:45 +0000 (01:17 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Fri, 25 Jan 2008 21:04:37 +0000 (19:04 -0200)
Store IF Frequency in a u16 instead of a u32.  Multiply by 1000 before use.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/dvb/frontends/tda18271-fe.c
drivers/media/dvb/frontends/tda18271-tables.c
drivers/media/dvb/frontends/tda18271.h
drivers/media/video/cx23885/cx23885-dvb.c

index b17ab4ace08ce76fd2b02fb116d6c036bcda577a..a02d6404f755d401f93b98d149dbc304cd5e11d1 100644 (file)
@@ -770,8 +770,8 @@ static int tda18271_set_params(struct dvb_frontend *fe,
        struct tda18271_priv *priv = fe->tuner_priv;
        struct tda18271_std_map *std_map = &priv->std;
        u8 std;
-       u32 bw, sgIF = 0;
-       u32 freq = params->frequency;
+       u16 sgIF;
+       u32 bw, freq = params->frequency;
 
        BUG_ON(!priv->tune);
 
@@ -825,7 +825,7 @@ static int tda18271_set_params(struct dvb_frontend *fe,
                return -EINVAL;
        }
 
-       return priv->tune(fe, sgIF, freq, bw, std);
+       return priv->tune(fe, sgIF * 1000, freq, bw, std);
 }
 
 static int tda18271_set_analog_params(struct dvb_frontend *fe,
@@ -835,7 +835,8 @@ static int tda18271_set_analog_params(struct dvb_frontend *fe,
        struct tda18271_std_map *std_map = &priv->std;
        char *mode;
        u8 std;
-       u32 sgIF, freq = params->frequency * 62500;
+       u16 sgIF;
+       u32 freq = params->frequency * 62500;
 
        BUG_ON(!priv->tune);
 
@@ -877,7 +878,7 @@ static int tda18271_set_analog_params(struct dvb_frontend *fe,
 
        tda_dbg("setting tda18271 to system %s\n", mode);
 
-       return priv->tune(fe, sgIF, freq, 0, std);
+       return priv->tune(fe, sgIF * 1000, freq, 0, std);
 }
 
 static int tda18271_release(struct dvb_frontend *fe)
index 2f8ea72bcabb5fc59fcc43ec2a942eb7d7937f5f..528a2ec9e967e6714cc1e711d1fd5caefc5a2408 100644 (file)
@@ -1187,35 +1187,35 @@ fail:
 /*---------------------------------------------------------------------*/
 
 static struct tda18271_std_map tda18271c1_std_map = {
-       .atv_b    = { .if_freq = 6750000, .std_bits = 0x0e },
-       .atv_dk   = { .if_freq = 7750000, .std_bits = 0x0f },
-       .atv_gh   = { .if_freq = 7750000, .std_bits = 0x0f },
-       .atv_i    = { .if_freq = 7750000, .std_bits = 0x0f },
-       .atv_l    = { .if_freq = 7750000, .std_bits = 0x0f },
-       .atv_lc   = { .if_freq = 1250000, .std_bits = 0x0f },
-       .atv_mn   = { .if_freq = 5750000, .std_bits = 0x0d },
-       .atsc_6   = { .if_freq = 3250000, .std_bits = 0x1c },
-       .dvbt_6   = { .if_freq = 3300000, .std_bits = 0x1c },
-       .dvbt_7   = { .if_freq = 3800000, .std_bits = 0x1d },
-       .dvbt_8   = { .if_freq = 4300000, .std_bits = 0x1e },
-       .qam_6    = { .if_freq = 4000000, .std_bits = 0x1d },
-       .qam_8    = { .if_freq = 5000000, .std_bits = 0x1f },
+       .atv_b    = { .if_freq = 6750, .std_bits = 0x0e },
+       .atv_dk   = { .if_freq = 7750, .std_bits = 0x0f },
+       .atv_gh   = { .if_freq = 7750, .std_bits = 0x0f },
+       .atv_i    = { .if_freq = 7750, .std_bits = 0x0f },
+       .atv_l    = { .if_freq = 7750, .std_bits = 0x0f },
+       .atv_lc   = { .if_freq = 1250, .std_bits = 0x0f },
+       .atv_mn   = { .if_freq = 5750, .std_bits = 0x0d },
+       .atsc_6   = { .if_freq = 3250, .std_bits = 0x1c },
+       .dvbt_6   = { .if_freq = 3300, .std_bits = 0x1c },
+       .dvbt_7   = { .if_freq = 3800, .std_bits = 0x1d },
+       .dvbt_8   = { .if_freq = 4300, .std_bits = 0x1e },
+       .qam_6    = { .if_freq = 4000, .std_bits = 0x1d },
+       .qam_8    = { .if_freq = 5000, .std_bits = 0x1f },
 };
 
 static struct tda18271_std_map tda18271c2_std_map = {
-       .atv_b    = { .if_freq = 6000000, .std_bits = 0x0d },
-       .atv_dk   = { .if_freq = 6900000, .std_bits = 0x0e },
-       .atv_gh   = { .if_freq = 7100000, .std_bits = 0x0e },
-       .atv_i    = { .if_freq = 7250000, .std_bits = 0x0e },
-       .atv_l    = { .if_freq = 6900000, .std_bits = 0x0e },
-       .atv_lc   = { .if_freq = 1250000, .std_bits = 0x0e },
-       .atv_mn   = { .if_freq = 5400000, .std_bits = 0x0c },
-       .atsc_6   = { .if_freq = 3250000, .std_bits = 0x1c },
-       .dvbt_6   = { .if_freq = 3300000, .std_bits = 0x1c },
-       .dvbt_7   = { .if_freq = 3500000, .std_bits = 0x1c },
-       .dvbt_8   = { .if_freq = 4000000, .std_bits = 0x1d },
-       .qam_6    = { .if_freq = 4000000, .std_bits = 0x1d },
-       .qam_8    = { .if_freq = 5000000, .std_bits = 0x1f },
+       .atv_b    = { .if_freq = 6000, .std_bits = 0x0d },
+       .atv_dk   = { .if_freq = 6900, .std_bits = 0x0e },
+       .atv_gh   = { .if_freq = 7100, .std_bits = 0x0e },
+       .atv_i    = { .if_freq = 7250, .std_bits = 0x0e },
+       .atv_l    = { .if_freq = 6900, .std_bits = 0x0e },
+       .atv_lc   = { .if_freq = 1250, .std_bits = 0x0e },
+       .atv_mn   = { .if_freq = 5400, .std_bits = 0x0c },
+       .atsc_6   = { .if_freq = 3250, .std_bits = 0x1c },
+       .dvbt_6   = { .if_freq = 3300, .std_bits = 0x1c },
+       .dvbt_7   = { .if_freq = 3500, .std_bits = 0x1c },
+       .dvbt_8   = { .if_freq = 4000, .std_bits = 0x1d },
+       .qam_6    = { .if_freq = 4000, .std_bits = 0x1d },
+       .qam_8    = { .if_freq = 5000, .std_bits = 0x1f },
 };
 
 /*---------------------------------------------------------------------*/
index 36a3a548a6f563109c2f30b37963090ba8684918..4fa3d6ab621682e0473b9addc0409a1d5aa96d20 100644 (file)
@@ -25,7 +25,7 @@
 #include "dvb_frontend.h"
 
 struct tda18271_std_map_item {
-       u32 if_freq;
+       u16 if_freq;
        u8 std_bits;
 };
 
index 948a7fb7ed06bff92ff76240eacff66adf7739a2..1b669ee962d005d64a9de6396ecc76a5ee58de02 100644 (file)
@@ -184,8 +184,8 @@ static struct tda829x_config tda829x_no_probe = {
 };
 
 static struct tda18271_std_map hauppauge_tda18271_std_map = {
-       .atsc_6   = { .if_freq = 5380000, .std_bits = 0x1b },
-       .qam_6    = { .if_freq = 4000000, .std_bits = 0x18 },
+       .atsc_6   = { .if_freq = 5380, .std_bits = 0x1b },
+       .qam_6    = { .if_freq = 4000, .std_bits = 0x18 },
 };
 
 static struct tda18271_config hauppauge_tda18271_config = {