aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2007-12-02 09:03:57 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-01-25 16:03:13 -0500
commitaaeccba68a60eedee5fe90f9e1478367b1f97345 (patch)
tree02f840507d66d23fa9210eefe3993423b58159bd
parent293da0ec468addf891856e9ffee88af2fd00e25a (diff)
V4L/DVB (6726): tda18271: set image rejection validity
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r--drivers/media/dvb/frontends/tda18271-fe.c11
-rw-r--r--drivers/media/dvb/frontends/tda18271-priv.h1
-rw-r--r--drivers/media/dvb/frontends/tda18271-tables.c8
3 files changed, 19 insertions, 1 deletions
diff --git a/drivers/media/dvb/frontends/tda18271-fe.c b/drivers/media/dvb/frontends/tda18271-fe.c
index 01de75e369e..fee38c1657e 100644
--- a/drivers/media/dvb/frontends/tda18271-fe.c
+++ b/drivers/media/dvb/frontends/tda18271-fe.c
@@ -578,7 +578,16 @@ static int tda18271_tune(struct dvb_frontend *fe,
578 578
579 regs[R_EP4] &= ~0x80; /* turn this bit on only for fm */ 579 regs[R_EP4] &= ~0x80; /* turn this bit on only for fm */
580 580
581 /* FIXME: image rejection validity EP5[2:0] */ 581 /* image rejection validity EP5[2:0] */
582 i = 0;
583 while ((tda18271_ir_measure[i].rfmax * 1000) < freq) {
584 if (tda18271_ir_measure[i].rfmax == 0)
585 break;
586 i++;
587 }
588 dbg_map("ir measure, i = %d\n", i);
589 regs[R_EP5] &= ~0x07;
590 regs[R_EP5] |= tda18271_ir_measure[i].val;
582 591
583 /* calculate MAIN PLL */ 592 /* calculate MAIN PLL */
584 N = freq + ifc; 593 N = freq + ifc;
diff --git a/drivers/media/dvb/frontends/tda18271-priv.h b/drivers/media/dvb/frontends/tda18271-priv.h
index 71b4d796369..a3158eb2559 100644
--- a/drivers/media/dvb/frontends/tda18271-priv.h
+++ b/drivers/media/dvb/frontends/tda18271-priv.h
@@ -84,6 +84,7 @@ extern struct tda18271_map tda18271_km[];
84extern struct tda18271_map tda18271_rf_band[]; 84extern struct tda18271_map tda18271_rf_band[];
85extern struct tda18271_map tda18271_gain_taper[]; 85extern struct tda18271_map tda18271_gain_taper[];
86extern struct tda18271_map tda18271_rf_cal[]; 86extern struct tda18271_map tda18271_rf_cal[];
87extern struct tda18271_map tda18271_ir_measure[];
87 88
88#endif /* __TDA18271_PRIV_H__ */ 89#endif /* __TDA18271_PRIV_H__ */
89 90
diff --git a/drivers/media/dvb/frontends/tda18271-tables.c b/drivers/media/dvb/frontends/tda18271-tables.c
index a018b514087..d65d3411e36 100644
--- a/drivers/media/dvb/frontends/tda18271-tables.c
+++ b/drivers/media/dvb/frontends/tda18271-tables.c
@@ -244,6 +244,14 @@ struct tda18271_map tda18271_rf_cal[] = {
244 { .rfmax = 0, .val = 0x00 }, /* end */ 244 { .rfmax = 0, .val = 0x00 }, /* end */
245}; 245};
246 246
247struct tda18271_map tda18271_ir_measure[] = {
248 { .rfmax = 30000, .val = 4},
249 { .rfmax = 200000, .val = 5},
250 { .rfmax = 600000, .val = 6},
251 { .rfmax = 865000, .val = 7},
252 { .rfmax = 0, .val = 0}, /* end */
253};
254
247/* 255/*
248 * Overrides for Emacs so that we follow Linus's tabbing style. 256 * Overrides for Emacs so that we follow Linus's tabbing style.
249 * --------------------------------------------------------------------------- 257 * ---------------------------------------------------------------------------