summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2008-04-22 14:46:22 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-24 14:07:55 -0300
commitc0dc0c1122b585193dd6650c749e919542dd3e23 (patch)
treede308e67ef9e2ea58ae9bba0fae1cd4292cf4855
parent14c74b23b6b5a8259c25c8f825e3036f595518d0 (diff)
V4L/DVB (7432): tda18271: allow device-specific configuration of rf agc top
allow device-specific configuration of rf agc rf top and if top 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.c12
-rw-r--r--drivers/media/dvb/frontends/tda18271-tables.c112
-rw-r--r--drivers/media/dvb/frontends/tda18271.h2
-rw-r--r--drivers/media/video/cx23885/cx23885-dvb.c6
4 files changed, 65 insertions, 67 deletions
diff --git a/drivers/media/dvb/frontends/tda18271-fe.c b/drivers/media/dvb/frontends/tda18271-fe.c
index b5a422ef4ff6..3c455795d1ac 100644
--- a/drivers/media/dvb/frontends/tda18271-fe.c
+++ b/drivers/media/dvb/frontends/tda18271-fe.c
@@ -70,15 +70,9 @@ static int tda18271_channel_configuration(struct dvb_frontend *fe,
regs[R_EP4] &= ~0x80;
regs[R_EP4] |= map->fm_rfn << 7;
- /* update RF_TOP / IF_TOP */
- switch (priv->mode) {
- case TDA18271_ANALOG:
- regs[R_EB22] = 0x2c;
- break;
- case TDA18271_DIGITAL:
- regs[R_EB22] = 0x37;
- break;
- }
+ /* update rf top / if top */
+ regs[R_EB22] = 0x00;
+ regs[R_EB22] |= map->rfagc_top;
tda18271_write_regs(fe, R_EB22, 1);
/* --------------------------------------------------------------- */
diff --git a/drivers/media/dvb/frontends/tda18271-tables.c b/drivers/media/dvb/frontends/tda18271-tables.c
index 342fb31b64c4..83e7561960c1 100644
--- a/drivers/media/dvb/frontends/tda18271-tables.c
+++ b/drivers/media/dvb/frontends/tda18271-tables.c
@@ -1187,65 +1187,65 @@ fail:
/*---------------------------------------------------------------------*/
static struct tda18271_std_map tda18271c1_std_map = {
- .fm_radio = { .if_freq = 1250, .fm_rfn = 1, .if_lvl = 0,
- .agc_mode = 3, .std = 0 }, /* EP3[4:0] 0x18 */
- .atv_b = { .if_freq = 6750, .fm_rfn = 0, .if_lvl = 0,
- .agc_mode = 1, .std = 6 }, /* EP3[4:0] 0x0e */
- .atv_dk = { .if_freq = 7750, .fm_rfn = 0, .if_lvl = 0,
- .agc_mode = 1, .std = 7 }, /* EP3[4:0] 0x0f */
- .atv_gh = { .if_freq = 7750, .fm_rfn = 0, .if_lvl = 0,
- .agc_mode = 1, .std = 7 }, /* EP3[4:0] 0x0f */
- .atv_i = { .if_freq = 7750, .fm_rfn = 0, .if_lvl = 0,
- .agc_mode = 1, .std = 7 }, /* EP3[4:0] 0x0f */
- .atv_l = { .if_freq = 7750, .fm_rfn = 0, .if_lvl = 0,
- .agc_mode = 1, .std = 7 }, /* EP3[4:0] 0x0f */
- .atv_lc = { .if_freq = 1250, .fm_rfn = 0, .if_lvl = 0,
- .agc_mode = 1, .std = 7 }, /* EP3[4:0] 0x0f */
- .atv_mn = { .if_freq = 5750, .fm_rfn = 0, .if_lvl = 0,
- .agc_mode = 1, .std = 5 }, /* EP3[4:0] 0x0d */
- .atsc_6 = { .if_freq = 3250, .fm_rfn = 0, .if_lvl = 1,
- .agc_mode = 3, .std = 4 }, /* EP3[4:0] 0x1c */
- .dvbt_6 = { .if_freq = 3300, .fm_rfn = 0, .if_lvl = 1,
- .agc_mode = 3, .std = 4 }, /* EP3[4:0] 0x1c */
- .dvbt_7 = { .if_freq = 3800, .fm_rfn = 0, .if_lvl = 1,
- .agc_mode = 3, .std = 5 }, /* EP3[4:0] 0x1d */
- .dvbt_8 = { .if_freq = 4300, .fm_rfn = 0, .if_lvl = 1,
- .agc_mode = 3, .std = 6 }, /* EP3[4:0] 0x1e */
- .qam_6 = { .if_freq = 4000, .fm_rfn = 0, .if_lvl = 1,
- .agc_mode = 3, .std = 5 }, /* EP3[4:0] 0x1d */
- .qam_8 = { .if_freq = 5000, .fm_rfn = 0, .if_lvl = 1,
- .agc_mode = 3, .std = 7 }, /* EP3[4:0] 0x1f */
+ .fm_radio = { .if_freq = 1250, .fm_rfn = 1, .agc_mode = 3, .std = 0,
+ .if_lvl = 0, .rfagc_top = 0x2c, }, /* EP3[4:0] 0x18 */
+ .atv_b = { .if_freq = 6750, .fm_rfn = 0, .agc_mode = 1, .std = 6,
+ .if_lvl = 0, .rfagc_top = 0x2c, }, /* EP3[4:0] 0x0e */
+ .atv_dk = { .if_freq = 7750, .fm_rfn = 0, .agc_mode = 1, .std = 7,
+ .if_lvl = 0, .rfagc_top = 0x2c, }, /* EP3[4:0] 0x0f */
+ .atv_gh = { .if_freq = 7750, .fm_rfn = 0, .agc_mode = 1, .std = 7,
+ .if_lvl = 0, .rfagc_top = 0x2c, }, /* EP3[4:0] 0x0f */
+ .atv_i = { .if_freq = 7750, .fm_rfn = 0, .agc_mode = 1, .std = 7,
+ .if_lvl = 0, .rfagc_top = 0x2c, }, /* EP3[4:0] 0x0f */
+ .atv_l = { .if_freq = 7750, .fm_rfn = 0, .agc_mode = 1, .std = 7,
+ .if_lvl = 0, .rfagc_top = 0x2c, }, /* EP3[4:0] 0x0f */
+ .atv_lc = { .if_freq = 1250, .fm_rfn = 0, .agc_mode = 1, .std = 7,
+ .if_lvl = 0, .rfagc_top = 0x2c, }, /* EP3[4:0] 0x0f */
+ .atv_mn = { .if_freq = 5750, .fm_rfn = 0, .agc_mode = 1, .std = 5,
+ .if_lvl = 0, .rfagc_top = 0x2c, }, /* EP3[4:0] 0x0d */
+ .atsc_6 = { .if_freq = 3250, .fm_rfn = 0, .agc_mode = 3, .std = 4,
+ .if_lvl = 1, .rfagc_top = 0x37, }, /* EP3[4:0] 0x1c */
+ .dvbt_6 = { .if_freq = 3300, .fm_rfn = 0, .agc_mode = 3, .std = 4,
+ .if_lvl = 1, .rfagc_top = 0x37, }, /* EP3[4:0] 0x1c */
+ .dvbt_7 = { .if_freq = 3800, .fm_rfn = 0, .agc_mode = 3, .std = 5,
+ .if_lvl = 1, .rfagc_top = 0x37, }, /* EP3[4:0] 0x1d */
+ .dvbt_8 = { .if_freq = 4300, .fm_rfn = 0, .agc_mode = 3, .std = 6,
+ .if_lvl = 1, .rfagc_top = 0x37, }, /* EP3[4:0] 0x1e */
+ .qam_6 = { .if_freq = 4000, .fm_rfn = 0, .agc_mode = 3, .std = 5,
+ .if_lvl = 1, .rfagc_top = 0x37, }, /* EP3[4:0] 0x1d */
+ .qam_8 = { .if_freq = 5000, .fm_rfn = 0, .agc_mode = 3, .std = 7,
+ .if_lvl = 1, .rfagc_top = 0x37, }, /* EP3[4:0] 0x1f */
};
static struct tda18271_std_map tda18271c2_std_map = {
- .fm_radio = { .if_freq = 1250, .fm_rfn = 1, .if_lvl = 0,
- .agc_mode = 3, .std = 0 }, /* EP3[4:0] 0x18 */
- .atv_b = { .if_freq = 6000, .fm_rfn = 0, .if_lvl = 0,
- .agc_mode = 1, .std = 5 }, /* EP3[4:0] 0x0d */
- .atv_dk = { .if_freq = 6900, .fm_rfn = 0, .if_lvl = 0,
- .agc_mode = 1, .std = 6 }, /* EP3[4:0] 0x0e */
- .atv_gh = { .if_freq = 7100, .fm_rfn = 0, .if_lvl = 0,
- .agc_mode = 1, .std = 6 }, /* EP3[4:0] 0x0e */
- .atv_i = { .if_freq = 7250, .fm_rfn = 0, .if_lvl = 0,
- .agc_mode = 1, .std = 6 }, /* EP3[4:0] 0x0e */
- .atv_l = { .if_freq = 6900, .fm_rfn = 0, .if_lvl = 0,
- .agc_mode = 1, .std = 6 }, /* EP3[4:0] 0x0e */
- .atv_lc = { .if_freq = 1250, .fm_rfn = 0, .if_lvl = 0,
- .agc_mode = 1, .std = 6 }, /* EP3[4:0] 0x0e */
- .atv_mn = { .if_freq = 5400, .fm_rfn = 0, .if_lvl = 0,
- .agc_mode = 1, .std = 4 }, /* EP3[4:0] 0x0c */
- .atsc_6 = { .if_freq = 3250, .fm_rfn = 0, .if_lvl = 1,
- .agc_mode = 3, .std = 4 }, /* EP3[4:0] 0x1c */
- .dvbt_6 = { .if_freq = 3300, .fm_rfn = 0, .if_lvl = 1,
- .agc_mode = 3, .std = 4 }, /* EP3[4:0] 0x1c */
- .dvbt_7 = { .if_freq = 3500, .fm_rfn = 0, .if_lvl = 1,
- .agc_mode = 3, .std = 4 }, /* EP3[4:0] 0x1c */
- .dvbt_8 = { .if_freq = 4000, .fm_rfn = 0, .if_lvl = 1,
- .agc_mode = 3, .std = 5 }, /* EP3[4:0] 0x1d */
- .qam_6 = { .if_freq = 4000, .fm_rfn = 0, .if_lvl = 1,
- .agc_mode = 3, .std = 5 }, /* EP3[4:0] 0x1d */
- .qam_8 = { .if_freq = 5000, .fm_rfn = 0, .if_lvl = 1,
- .agc_mode = 3, .std = 7 }, /* EP3[4:0] 0x1f */
+ .fm_radio = { .if_freq = 1250, .fm_rfn = 1, .agc_mode = 3, .std = 0,
+ .if_lvl = 0, .rfagc_top = 0x2c, }, /* EP3[4:0] 0x18 */
+ .atv_b = { .if_freq = 6000, .fm_rfn = 0, .agc_mode = 1, .std = 5,
+ .if_lvl = 0, .rfagc_top = 0x2c, }, /* EP3[4:0] 0x0d */
+ .atv_dk = { .if_freq = 6900, .fm_rfn = 0, .agc_mode = 1, .std = 6,
+ .if_lvl = 0, .rfagc_top = 0x2c, }, /* EP3[4:0] 0x0e */
+ .atv_gh = { .if_freq = 7100, .fm_rfn = 0, .agc_mode = 1, .std = 6,
+ .if_lvl = 0, .rfagc_top = 0x2c, }, /* EP3[4:0] 0x0e */
+ .atv_i = { .if_freq = 7250, .fm_rfn = 0, .agc_mode = 1, .std = 6,
+ .if_lvl = 0, .rfagc_top = 0x2c, }, /* EP3[4:0] 0x0e */
+ .atv_l = { .if_freq = 6900, .fm_rfn = 0, .agc_mode = 1, .std = 6,
+ .if_lvl = 0, .rfagc_top = 0x2c, }, /* EP3[4:0] 0x0e */
+ .atv_lc = { .if_freq = 1250, .fm_rfn = 0, .agc_mode = 1, .std = 6,
+ .if_lvl = 0, .rfagc_top = 0x2c, }, /* EP3[4:0] 0x0e */
+ .atv_mn = { .if_freq = 5400, .fm_rfn = 0, .agc_mode = 1, .std = 4,
+ .if_lvl = 0, .rfagc_top = 0x2c, }, /* EP3[4:0] 0x0c */
+ .atsc_6 = { .if_freq = 3250, .fm_rfn = 0, .agc_mode = 3, .std = 4,
+ .if_lvl = 1, .rfagc_top = 0x37, }, /* EP3[4:0] 0x1c */
+ .dvbt_6 = { .if_freq = 3300, .fm_rfn = 0, .agc_mode = 3, .std = 4,
+ .if_lvl = 1, .rfagc_top = 0x37, }, /* EP3[4:0] 0x1c */
+ .dvbt_7 = { .if_freq = 3500, .fm_rfn = 0, .agc_mode = 3, .std = 4,
+ .if_lvl = 1, .rfagc_top = 0x37, }, /* EP3[4:0] 0x1c */
+ .dvbt_8 = { .if_freq = 4000, .fm_rfn = 0, .agc_mode = 3, .std = 5,
+ .if_lvl = 1, .rfagc_top = 0x37, }, /* EP3[4:0] 0x1d */
+ .qam_6 = { .if_freq = 4000, .fm_rfn = 0, .agc_mode = 3, .std = 5,
+ .if_lvl = 1, .rfagc_top = 0x37, }, /* EP3[4:0] 0x1d */
+ .qam_8 = { .if_freq = 5000, .fm_rfn = 0, .agc_mode = 3, .std = 7,
+ .if_lvl = 1, .rfagc_top = 0x37, }, /* EP3[4:0] 0x1f */
};
/*---------------------------------------------------------------------*/
diff --git a/drivers/media/dvb/frontends/tda18271.h b/drivers/media/dvb/frontends/tda18271.h
index 60d63ba285f8..44d41dce9e10 100644
--- a/drivers/media/dvb/frontends/tda18271.h
+++ b/drivers/media/dvb/frontends/tda18271.h
@@ -35,6 +35,8 @@ struct tda18271_std_map_item {
unsigned int fm_rfn:1;
/* EP4[4:2] */
unsigned int if_lvl:3;
+ /* EB22[6:0] */
+ unsigned int rfagc_top:7;
};
struct tda18271_std_map {
diff --git a/drivers/media/video/cx23885/cx23885-dvb.c b/drivers/media/video/cx23885/cx23885-dvb.c
index 417a30c7a04d..7bcd37aa8c90 100644
--- a/drivers/media/video/cx23885/cx23885-dvb.c
+++ b/drivers/media/video/cx23885/cx23885-dvb.c
@@ -165,8 +165,10 @@ static struct tda829x_config tda829x_no_probe = {
};
static struct tda18271_std_map hauppauge_tda18271_std_map = {
- .atsc_6 = { .if_freq = 5380, .if_lvl = 6, .agc_mode = 3, .std = 3 },
- .qam_6 = { .if_freq = 4000, .if_lvl = 6, .agc_mode = 3, .std = 0 },
+ .atsc_6 = { .if_freq = 5380, .agc_mode = 3, .std = 3,
+ .if_lvl = 6, .rfagc_top = 0x37 },
+ .qam_6 = { .if_freq = 4000, .agc_mode = 3, .std = 0,
+ .if_lvl = 6, .rfagc_top = 0x37 },
};
static struct tda18271_config hauppauge_tda18271_config = {