aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2008-04-22 13:46:22 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-24 13:07:55 -0400
commitc0dc0c1122b585193dd6650c749e919542dd3e23 (patch)
treede308e67ef9e2ea58ae9bba0fae1cd4292cf4855 /drivers/media/dvb
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>
Diffstat (limited to 'drivers/media/dvb')
-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
3 files changed, 61 insertions, 65 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,
70 regs[R_EP4] &= ~0x80; 70 regs[R_EP4] &= ~0x80;
71 regs[R_EP4] |= map->fm_rfn << 7; 71 regs[R_EP4] |= map->fm_rfn << 7;
72 72
73 /* update RF_TOP / IF_TOP */ 73 /* update rf top / if top */
74 switch (priv->mode) { 74 regs[R_EB22] = 0x00;
75 case TDA18271_ANALOG: 75 regs[R_EB22] |= map->rfagc_top;
76 regs[R_EB22] = 0x2c;
77 break;
78 case TDA18271_DIGITAL:
79 regs[R_EB22] = 0x37;
80 break;
81 }
82 tda18271_write_regs(fe, R_EB22, 1); 76 tda18271_write_regs(fe, R_EB22, 1);
83 77
84 /* --------------------------------------------------------------- */ 78 /* --------------------------------------------------------------- */
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:
1187/*---------------------------------------------------------------------*/ 1187/*---------------------------------------------------------------------*/
1188 1188
1189static struct tda18271_std_map tda18271c1_std_map = { 1189static struct tda18271_std_map tda18271c1_std_map = {
1190 .fm_radio = { .if_freq = 1250, .fm_rfn = 1, .if_lvl = 0, 1190 .fm_radio = { .if_freq = 1250, .fm_rfn = 1, .agc_mode = 3, .std = 0,
1191 .agc_mode = 3, .std = 0 }, /* EP3[4:0] 0x18 */ 1191 .if_lvl = 0, .rfagc_top = 0x2c, }, /* EP3[4:0] 0x18 */
1192 .atv_b = { .if_freq = 6750, .fm_rfn = 0, .if_lvl = 0, 1192 .atv_b = { .if_freq = 6750, .fm_rfn = 0, .agc_mode = 1, .std = 6,
1193 .agc_mode = 1, .std = 6 }, /* EP3[4:0] 0x0e */ 1193 .if_lvl = 0, .rfagc_top = 0x2c, }, /* EP3[4:0] 0x0e */
1194 .atv_dk = { .if_freq = 7750, .fm_rfn = 0, .if_lvl = 0, 1194 .atv_dk = { .if_freq = 7750, .fm_rfn = 0, .agc_mode = 1, .std = 7,
1195 .agc_mode = 1, .std = 7 }, /* EP3[4:0] 0x0f */ 1195 .if_lvl = 0, .rfagc_top = 0x2c, }, /* EP3[4:0] 0x0f */
1196 .atv_gh = { .if_freq = 7750, .fm_rfn = 0, .if_lvl = 0, 1196 .atv_gh = { .if_freq = 7750, .fm_rfn = 0, .agc_mode = 1, .std = 7,
1197 .agc_mode = 1, .std = 7 }, /* EP3[4:0] 0x0f */ 1197 .if_lvl = 0, .rfagc_top = 0x2c, }, /* EP3[4:0] 0x0f */
1198 .atv_i = { .if_freq = 7750, .fm_rfn = 0, .if_lvl = 0, 1198 .atv_i = { .if_freq = 7750, .fm_rfn = 0, .agc_mode = 1, .std = 7,
1199 .agc_mode = 1, .std = 7 }, /* EP3[4:0] 0x0f */ 1199 .if_lvl = 0, .rfagc_top = 0x2c, }, /* EP3[4:0] 0x0f */
1200 .atv_l = { .if_freq = 7750, .fm_rfn = 0, .if_lvl = 0, 1200 .atv_l = { .if_freq = 7750, .fm_rfn = 0, .agc_mode = 1, .std = 7,
1201 .agc_mode = 1, .std = 7 }, /* EP3[4:0] 0x0f */ 1201 .if_lvl = 0, .rfagc_top = 0x2c, }, /* EP3[4:0] 0x0f */
1202 .atv_lc = { .if_freq = 1250, .fm_rfn = 0, .if_lvl = 0, 1202 .atv_lc = { .if_freq = 1250, .fm_rfn = 0, .agc_mode = 1, .std = 7,
1203 .agc_mode = 1, .std = 7 }, /* EP3[4:0] 0x0f */ 1203 .if_lvl = 0, .rfagc_top = 0x2c, }, /* EP3[4:0] 0x0f */
1204 .atv_mn = { .if_freq = 5750, .fm_rfn = 0, .if_lvl = 0, 1204 .atv_mn = { .if_freq = 5750, .fm_rfn = 0, .agc_mode = 1, .std = 5,
1205 .agc_mode = 1, .std = 5 }, /* EP3[4:0] 0x0d */ 1205 .if_lvl = 0, .rfagc_top = 0x2c, }, /* EP3[4:0] 0x0d */
1206 .atsc_6 = { .if_freq = 3250, .fm_rfn = 0, .if_lvl = 1, 1206 .atsc_6 = { .if_freq = 3250, .fm_rfn = 0, .agc_mode = 3, .std = 4,
1207 .agc_mode = 3, .std = 4 }, /* EP3[4:0] 0x1c */ 1207 .if_lvl = 1, .rfagc_top = 0x37, }, /* EP3[4:0] 0x1c */
1208 .dvbt_6 = { .if_freq = 3300, .fm_rfn = 0, .if_lvl = 1, 1208 .dvbt_6 = { .if_freq = 3300, .fm_rfn = 0, .agc_mode = 3, .std = 4,
1209 .agc_mode = 3, .std = 4 }, /* EP3[4:0] 0x1c */ 1209 .if_lvl = 1, .rfagc_top = 0x37, }, /* EP3[4:0] 0x1c */
1210 .dvbt_7 = { .if_freq = 3800, .fm_rfn = 0, .if_lvl = 1, 1210 .dvbt_7 = { .if_freq = 3800, .fm_rfn = 0, .agc_mode = 3, .std = 5,
1211 .agc_mode = 3, .std = 5 }, /* EP3[4:0] 0x1d */ 1211 .if_lvl = 1, .rfagc_top = 0x37, }, /* EP3[4:0] 0x1d */
1212 .dvbt_8 = { .if_freq = 4300, .fm_rfn = 0, .if_lvl = 1, 1212 .dvbt_8 = { .if_freq = 4300, .fm_rfn = 0, .agc_mode = 3, .std = 6,
1213 .agc_mode = 3, .std = 6 }, /* EP3[4:0] 0x1e */ 1213 .if_lvl = 1, .rfagc_top = 0x37, }, /* EP3[4:0] 0x1e */
1214 .qam_6 = { .if_freq = 4000, .fm_rfn = 0, .if_lvl = 1, 1214 .qam_6 = { .if_freq = 4000, .fm_rfn = 0, .agc_mode = 3, .std = 5,
1215 .agc_mode = 3, .std = 5 }, /* EP3[4:0] 0x1d */ 1215 .if_lvl = 1, .rfagc_top = 0x37, }, /* EP3[4:0] 0x1d */
1216 .qam_8 = { .if_freq = 5000, .fm_rfn = 0, .if_lvl = 1, 1216 .qam_8 = { .if_freq = 5000, .fm_rfn = 0, .agc_mode = 3, .std = 7,
1217 .agc_mode = 3, .std = 7 }, /* EP3[4:0] 0x1f */ 1217 .if_lvl = 1, .rfagc_top = 0x37, }, /* EP3[4:0] 0x1f */
1218}; 1218};
1219 1219
1220static struct tda18271_std_map tda18271c2_std_map = { 1220static struct tda18271_std_map tda18271c2_std_map = {
1221 .fm_radio = { .if_freq = 1250, .fm_rfn = 1, .if_lvl = 0, 1221 .fm_radio = { .if_freq = 1250, .fm_rfn = 1, .agc_mode = 3, .std = 0,
1222 .agc_mode = 3, .std = 0 }, /* EP3[4:0] 0x18 */ 1222 .if_lvl = 0, .rfagc_top = 0x2c, }, /* EP3[4:0] 0x18 */
1223 .atv_b = { .if_freq = 6000, .fm_rfn = 0, .if_lvl = 0, 1223 .atv_b = { .if_freq = 6000, .fm_rfn = 0, .agc_mode = 1, .std = 5,
1224 .agc_mode = 1, .std = 5 }, /* EP3[4:0] 0x0d */ 1224 .if_lvl = 0, .rfagc_top = 0x2c, }, /* EP3[4:0] 0x0d */
1225 .atv_dk = { .if_freq = 6900, .fm_rfn = 0, .if_lvl = 0, 1225 .atv_dk = { .if_freq = 6900, .fm_rfn = 0, .agc_mode = 1, .std = 6,
1226 .agc_mode = 1, .std = 6 }, /* EP3[4:0] 0x0e */ 1226 .if_lvl = 0, .rfagc_top = 0x2c, }, /* EP3[4:0] 0x0e */
1227 .atv_gh = { .if_freq = 7100, .fm_rfn = 0, .if_lvl = 0, 1227 .atv_gh = { .if_freq = 7100, .fm_rfn = 0, .agc_mode = 1, .std = 6,
1228 .agc_mode = 1, .std = 6 }, /* EP3[4:0] 0x0e */ 1228 .if_lvl = 0, .rfagc_top = 0x2c, }, /* EP3[4:0] 0x0e */
1229 .atv_i = { .if_freq = 7250, .fm_rfn = 0, .if_lvl = 0, 1229 .atv_i = { .if_freq = 7250, .fm_rfn = 0, .agc_mode = 1, .std = 6,
1230 .agc_mode = 1, .std = 6 }, /* EP3[4:0] 0x0e */ 1230 .if_lvl = 0, .rfagc_top = 0x2c, }, /* EP3[4:0] 0x0e */
1231 .atv_l = { .if_freq = 6900, .fm_rfn = 0, .if_lvl = 0, 1231 .atv_l = { .if_freq = 6900, .fm_rfn = 0, .agc_mode = 1, .std = 6,
1232 .agc_mode = 1, .std = 6 }, /* EP3[4:0] 0x0e */ 1232 .if_lvl = 0, .rfagc_top = 0x2c, }, /* EP3[4:0] 0x0e */
1233 .atv_lc = { .if_freq = 1250, .fm_rfn = 0, .if_lvl = 0, 1233 .atv_lc = { .if_freq = 1250, .fm_rfn = 0, .agc_mode = 1, .std = 6,
1234 .agc_mode = 1, .std = 6 }, /* EP3[4:0] 0x0e */ 1234 .if_lvl = 0, .rfagc_top = 0x2c, }, /* EP3[4:0] 0x0e */
1235 .atv_mn = { .if_freq = 5400, .fm_rfn = 0, .if_lvl = 0, 1235 .atv_mn = { .if_freq = 5400, .fm_rfn = 0, .agc_mode = 1, .std = 4,
1236 .agc_mode = 1, .std = 4 }, /* EP3[4:0] 0x0c */ 1236 .if_lvl = 0, .rfagc_top = 0x2c, }, /* EP3[4:0] 0x0c */
1237 .atsc_6 = { .if_freq = 3250, .fm_rfn = 0, .if_lvl = 1, 1237 .atsc_6 = { .if_freq = 3250, .fm_rfn = 0, .agc_mode = 3, .std = 4,
1238 .agc_mode = 3, .std = 4 }, /* EP3[4:0] 0x1c */ 1238 .if_lvl = 1, .rfagc_top = 0x37, }, /* EP3[4:0] 0x1c */
1239 .dvbt_6 = { .if_freq = 3300, .fm_rfn = 0, .if_lvl = 1, 1239 .dvbt_6 = { .if_freq = 3300, .fm_rfn = 0, .agc_mode = 3, .std = 4,
1240 .agc_mode = 3, .std = 4 }, /* EP3[4:0] 0x1c */ 1240 .if_lvl = 1, .rfagc_top = 0x37, }, /* EP3[4:0] 0x1c */
1241 .dvbt_7 = { .if_freq = 3500, .fm_rfn = 0, .if_lvl = 1, 1241 .dvbt_7 = { .if_freq = 3500, .fm_rfn = 0, .agc_mode = 3, .std = 4,
1242 .agc_mode = 3, .std = 4 }, /* EP3[4:0] 0x1c */ 1242 .if_lvl = 1, .rfagc_top = 0x37, }, /* EP3[4:0] 0x1c */
1243 .dvbt_8 = { .if_freq = 4000, .fm_rfn = 0, .if_lvl = 1, 1243 .dvbt_8 = { .if_freq = 4000, .fm_rfn = 0, .agc_mode = 3, .std = 5,
1244 .agc_mode = 3, .std = 5 }, /* EP3[4:0] 0x1d */ 1244 .if_lvl = 1, .rfagc_top = 0x37, }, /* EP3[4:0] 0x1d */
1245 .qam_6 = { .if_freq = 4000, .fm_rfn = 0, .if_lvl = 1, 1245 .qam_6 = { .if_freq = 4000, .fm_rfn = 0, .agc_mode = 3, .std = 5,
1246 .agc_mode = 3, .std = 5 }, /* EP3[4:0] 0x1d */ 1246 .if_lvl = 1, .rfagc_top = 0x37, }, /* EP3[4:0] 0x1d */
1247 .qam_8 = { .if_freq = 5000, .fm_rfn = 0, .if_lvl = 1, 1247 .qam_8 = { .if_freq = 5000, .fm_rfn = 0, .agc_mode = 3, .std = 7,
1248 .agc_mode = 3, .std = 7 }, /* EP3[4:0] 0x1f */ 1248 .if_lvl = 1, .rfagc_top = 0x37, }, /* EP3[4:0] 0x1f */
1249}; 1249};
1250 1250
1251/*---------------------------------------------------------------------*/ 1251/*---------------------------------------------------------------------*/
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 {
35 unsigned int fm_rfn:1; 35 unsigned int fm_rfn:1;
36 /* EP4[4:2] */ 36 /* EP4[4:2] */
37 unsigned int if_lvl:3; 37 unsigned int if_lvl:3;
38 /* EB22[6:0] */
39 unsigned int rfagc_top:7;
38}; 40};
39 41
40struct tda18271_std_map { 42struct tda18271_std_map {