]> err.no Git - linux-2.6/commitdiff
V4L/DVB (6726): tda18271: set image rejection validity
authorMichael Krufky <mkrufky@linuxtv.org>
Sun, 2 Dec 2007 14:03:57 +0000 (11:03 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Fri, 25 Jan 2008 21:03:13 +0000 (19:03 -0200)
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-priv.h
drivers/media/dvb/frontends/tda18271-tables.c

index 01de75e369eddd00b264a224639b3e295b61fcce..fee38c1657e1bdbc968c0ddc661c9210ed9ebfdf 100644 (file)
@@ -578,7 +578,16 @@ static int tda18271_tune(struct dvb_frontend *fe,
 
        regs[R_EP4]  &= ~0x80; /* turn this bit on only for fm */
 
-       /* FIXME: image rejection validity EP5[2:0] */
+       /* image rejection validity EP5[2:0] */
+       i = 0;
+       while ((tda18271_ir_measure[i].rfmax * 1000) < freq) {
+               if (tda18271_ir_measure[i].rfmax == 0)
+                       break;
+               i++;
+       }
+       dbg_map("ir measure, i = %d\n", i);
+       regs[R_EP5] &= ~0x07;
+       regs[R_EP5] |= tda18271_ir_measure[i].val;
 
        /* calculate MAIN PLL */
        N = freq + ifc;
index 71b4d7963699054e11f680b8dd708f8828e4a01e..a3158eb25594e22c24503433c6f048a2d1882782 100644 (file)
@@ -84,6 +84,7 @@ extern struct tda18271_map tda18271_km[];
 extern struct tda18271_map tda18271_rf_band[];
 extern struct tda18271_map tda18271_gain_taper[];
 extern struct tda18271_map tda18271_rf_cal[];
+extern struct tda18271_map tda18271_ir_measure[];
 
 #endif /* __TDA18271_PRIV_H__ */
 
index a018b5140873f512575590d9d108b2f4dd99d56e..d65d3411e3629eb2f43cae5d0a2abf8c8d3ffd0f 100644 (file)
@@ -244,6 +244,14 @@ struct tda18271_map tda18271_rf_cal[] = {
        { .rfmax =     0, .val = 0x00 }, /* end */
 };
 
+struct tda18271_map tda18271_ir_measure[] = {
+       { .rfmax =  30000, .val = 4},
+       { .rfmax = 200000, .val = 5},
+       { .rfmax = 600000, .val = 6},
+       { .rfmax = 865000, .val = 7},
+       { .rfmax =      0, .val = 0}, /* end */
+};
+
 /*
  * Overrides for Emacs so that we follow Linus's tabbing style.
  * ---------------------------------------------------------------------------