summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2008-04-22 14:46:06 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-24 14:07:52 -0300
commit7f7203df3f7d056e5f3c4419c6ab3835f44b288c (patch)
tree56716e59f395057cdffb80769ff3f28f19a4a842 /drivers
parentc293d0a72ecb9dd09037cdf4a9089e455404cf4a (diff)
V4L/DVB (7385): tda18271: store agc_mode configuration independently of std_bits
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/dvb/frontends/tda18271-fe.c14
-rw-r--r--drivers/media/dvb/frontends/tda18271-tables.c84
-rw-r--r--drivers/media/dvb/frontends/tda18271.h7
-rw-r--r--drivers/media/video/cx23885/cx23885-dvb.c4
4 files changed, 72 insertions, 37 deletions
diff --git a/drivers/media/dvb/frontends/tda18271-fe.c b/drivers/media/dvb/frontends/tda18271-fe.c
index fef225abee96..eb44ab71ff74 100644
--- a/drivers/media/dvb/frontends/tda18271-fe.c
+++ b/drivers/media/dvb/frontends/tda18271-fe.c
@@ -48,7 +48,7 @@ static int tda18271_channel_configuration(struct dvb_frontend *fe,
/* set standard */
regs[R_EP3] &= ~0x1f; /* clear std bits */
- regs[R_EP3] |= map->std_bits;
+ regs[R_EP3] |= (map->agc_mode << 3) | map->std;
/* set cal mode to normal */
regs[R_EP4] &= ~0x03;
@@ -731,8 +731,8 @@ static int tda18271_tune(struct dvb_frontend *fe,
{
struct tda18271_priv *priv = fe->tuner_priv;
- tda_dbg("freq = %d, ifc = %d, bw = %d, std = 0x%02x\n",
- freq, map->if_freq, bw, map->std_bits);
+ tda_dbg("freq = %d, ifc = %d, bw = %d, agc_mode = %d, std = %d\n",
+ freq, map->if_freq, bw, map->agc_mode, map->std);
tda18271_init(fe);
@@ -927,15 +927,17 @@ static int tda18271_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth)
/* ------------------------------------------------------------------ */
#define tda18271_update_std(std_cfg, name) do { \
- if (map->std_cfg.if_freq + map->std_cfg.std_bits > 0) { \
+ if (map->std_cfg.if_freq + \
+ map->std_cfg.agc_mode + map->std_cfg.std > 0) { \
tda_dbg("Using custom std config for %s\n", name); \
memcpy(&std->std_cfg, &map->std_cfg, \
sizeof(struct tda18271_std_map_item)); \
} } while (0)
#define tda18271_dump_std_item(std_cfg, name) do { \
- tda_dbg("(%s) if freq = %d, std bits = 0x%02x\n", \
- name, std->std_cfg.if_freq, std->std_cfg.std_bits); \
+ tda_dbg("(%s) if freq = %d, agc_mode = %d, std = %d\n", \
+ name, std->std_cfg.if_freq, \
+ std->std_cfg.agc_mode, std->std_cfg.std); \
} while (0)
static int tda18271_dump_std_map(struct dvb_frontend *fe)
diff --git a/drivers/media/dvb/frontends/tda18271-tables.c b/drivers/media/dvb/frontends/tda18271-tables.c
index 462f20b41728..b402abd15bb2 100644
--- a/drivers/media/dvb/frontends/tda18271-tables.c
+++ b/drivers/media/dvb/frontends/tda18271-tables.c
@@ -1187,37 +1187,65 @@ fail:
/*---------------------------------------------------------------------*/
static struct tda18271_std_map tda18271c1_std_map = {
- .fm_radio = { .if_freq = 1250, .std_bits = 0x18, .fm_rfn = 1 },
- .atv_b = { .if_freq = 6750, .std_bits = 0x0e, .fm_rfn = 0 },
- .atv_dk = { .if_freq = 7750, .std_bits = 0x0f, .fm_rfn = 0 },
- .atv_gh = { .if_freq = 7750, .std_bits = 0x0f, .fm_rfn = 0 },
- .atv_i = { .if_freq = 7750, .std_bits = 0x0f, .fm_rfn = 0 },
- .atv_l = { .if_freq = 7750, .std_bits = 0x0f, .fm_rfn = 0 },
- .atv_lc = { .if_freq = 1250, .std_bits = 0x0f, .fm_rfn = 0 },
- .atv_mn = { .if_freq = 5750, .std_bits = 0x0d, .fm_rfn = 0 },
- .atsc_6 = { .if_freq = 3250, .std_bits = 0x1c, .fm_rfn = 0 },
- .dvbt_6 = { .if_freq = 3300, .std_bits = 0x1c, .fm_rfn = 0 },
- .dvbt_7 = { .if_freq = 3800, .std_bits = 0x1d, .fm_rfn = 0 },
- .dvbt_8 = { .if_freq = 4300, .std_bits = 0x1e, .fm_rfn = 0 },
- .qam_6 = { .if_freq = 4000, .std_bits = 0x1d, .fm_rfn = 0 },
- .qam_8 = { .if_freq = 5000, .std_bits = 0x1f, .fm_rfn = 0 },
+ .fm_radio = { .if_freq = 1250, .fm_rfn = 1, .agc_mode = 3, .std = 0 },
+ /* EP3[4:0] 0x18 */
+ .atv_b = { .if_freq = 6750, .fm_rfn = 0, .agc_mode = 1, .std = 6 },
+ /* EP3[4:0] 0x0e */
+ .atv_dk = { .if_freq = 7750, .fm_rfn = 0, .agc_mode = 1, .std = 7 },
+ /* EP3[4:0] 0x0f */
+ .atv_gh = { .if_freq = 7750, .fm_rfn = 0, .agc_mode = 1, .std = 7 },
+ /* EP3[4:0] 0x0f */
+ .atv_i = { .if_freq = 7750, .fm_rfn = 0, .agc_mode = 1, .std = 7 },
+ /* EP3[4:0] 0x0f */
+ .atv_l = { .if_freq = 7750, .fm_rfn = 0, .agc_mode = 1, .std = 7 },
+ /* EP3[4:0] 0x0f */
+ .atv_lc = { .if_freq = 1250, .fm_rfn = 0, .agc_mode = 1, .std = 7 },
+ /* EP3[4:0] 0x0f */
+ .atv_mn = { .if_freq = 5750, .fm_rfn = 0, .agc_mode = 1, .std = 5 },
+ /* EP3[4:0] 0x0d */
+ .atsc_6 = { .if_freq = 3250, .fm_rfn = 0, .agc_mode = 3, .std = 4 },
+ /* EP3[4:0] 0x1c */
+ .dvbt_6 = { .if_freq = 3300, .fm_rfn = 0, .agc_mode = 3, .std = 4 },
+ /* EP3[4:0] 0x1c */
+ .dvbt_7 = { .if_freq = 3800, .fm_rfn = 0, .agc_mode = 3, .std = 5 },
+ /* EP3[4:0] 0x1d */
+ .dvbt_8 = { .if_freq = 4300, .fm_rfn = 0, .agc_mode = 3, .std = 6 },
+ /* EP3[4:0] 0x1e */
+ .qam_6 = { .if_freq = 4000, .fm_rfn = 0, .agc_mode = 3, .std = 5 },
+ /* EP3[4:0] 0x1d */
+ .qam_8 = { .if_freq = 5000, .fm_rfn = 0, .agc_mode = 3, .std = 7 },
+ /* EP3[4:0] 0x1f */
};
static struct tda18271_std_map tda18271c2_std_map = {
- .fm_radio = { .if_freq = 1250, .std_bits = 0x18, .fm_rfn = 1 },
- .atv_b = { .if_freq = 6000, .std_bits = 0x0d, .fm_rfn = 0 },
- .atv_dk = { .if_freq = 6900, .std_bits = 0x0e, .fm_rfn = 0 },
- .atv_gh = { .if_freq = 7100, .std_bits = 0x0e, .fm_rfn = 0 },
- .atv_i = { .if_freq = 7250, .std_bits = 0x0e, .fm_rfn = 0 },
- .atv_l = { .if_freq = 6900, .std_bits = 0x0e, .fm_rfn = 0 },
- .atv_lc = { .if_freq = 1250, .std_bits = 0x0e, .fm_rfn = 0 },
- .atv_mn = { .if_freq = 5400, .std_bits = 0x0c, .fm_rfn = 0 },
- .atsc_6 = { .if_freq = 3250, .std_bits = 0x1c, .fm_rfn = 0 },
- .dvbt_6 = { .if_freq = 3300, .std_bits = 0x1c, .fm_rfn = 0 },
- .dvbt_7 = { .if_freq = 3500, .std_bits = 0x1c, .fm_rfn = 0 },
- .dvbt_8 = { .if_freq = 4000, .std_bits = 0x1d, .fm_rfn = 0 },
- .qam_6 = { .if_freq = 4000, .std_bits = 0x1d, .fm_rfn = 0 },
- .qam_8 = { .if_freq = 5000, .std_bits = 0x1f, .fm_rfn = 0 },
+ .fm_radio = { .if_freq = 1250, .fm_rfn = 1, .agc_mode = 3, .std = 0 },
+ /* EP3[4:0] 0x18 */
+ .atv_b = { .if_freq = 6000, .fm_rfn = 0, .agc_mode = 1, .std = 5 },
+ /* EP3[4:0] 0x0d */
+ .atv_dk = { .if_freq = 6900, .fm_rfn = 0, .agc_mode = 1, .std = 6 },
+ /* EP3[4:0] 0x0e */
+ .atv_gh = { .if_freq = 7100, .fm_rfn = 0, .agc_mode = 1, .std = 6 },
+ /* EP3[4:0] 0x0e */
+ .atv_i = { .if_freq = 7250, .fm_rfn = 0, .agc_mode = 1, .std = 6 },
+ /* EP3[4:0] 0x0e */
+ .atv_l = { .if_freq = 6900, .fm_rfn = 0, .agc_mode = 1, .std = 6 },
+ /* EP3[4:0] 0x0e */
+ .atv_lc = { .if_freq = 1250, .fm_rfn = 0, .agc_mode = 1, .std = 6 },
+ /* EP3[4:0] 0x0e */
+ .atv_mn = { .if_freq = 5400, .fm_rfn = 0, .agc_mode = 1, .std = 4 },
+ /* EP3[4:0] 0x0c */
+ .atsc_6 = { .if_freq = 3250, .fm_rfn = 0, .agc_mode = 3, .std = 4 },
+ /* EP3[4:0] 0x1c */
+ .dvbt_6 = { .if_freq = 3300, .fm_rfn = 0, .agc_mode = 3, .std = 4 },
+ /* EP3[4:0] 0x1c */
+ .dvbt_7 = { .if_freq = 3500, .fm_rfn = 0, .agc_mode = 3, .std = 4 },
+ /* EP3[4:0] 0x1c */
+ .dvbt_8 = { .if_freq = 4000, .fm_rfn = 0, .agc_mode = 3, .std = 5 },
+ /* EP3[4:0] 0x1d */
+ .qam_6 = { .if_freq = 4000, .fm_rfn = 0, .agc_mode = 3, .std = 5 },
+ /* EP3[4:0] 0x1d */
+ .qam_8 = { .if_freq = 5000, .fm_rfn = 0, .agc_mode = 3, .std = 7 },
+ /* EP3[4:0] 0x1f */
};
/*---------------------------------------------------------------------*/
diff --git a/drivers/media/dvb/frontends/tda18271.h b/drivers/media/dvb/frontends/tda18271.h
index a33095757ea8..3a743b0f0e8b 100644
--- a/drivers/media/dvb/frontends/tda18271.h
+++ b/drivers/media/dvb/frontends/tda18271.h
@@ -26,7 +26,12 @@
struct tda18271_std_map_item {
u16 if_freq;
- u8 std_bits;
+
+ /* EP3[4:3] */
+ unsigned int agc_mode:2;
+ /* EP3[2:0] */
+ unsigned int std:3;
+ /* EP4[7] */
unsigned int fm_rfn:1;
};
diff --git a/drivers/media/video/cx23885/cx23885-dvb.c b/drivers/media/video/cx23885/cx23885-dvb.c
index 6c21779852fb..22381de7359e 100644
--- a/drivers/media/video/cx23885/cx23885-dvb.c
+++ b/drivers/media/video/cx23885/cx23885-dvb.c
@@ -164,8 +164,8 @@ static struct tda829x_config tda829x_no_probe = {
};
static struct tda18271_std_map hauppauge_tda18271_std_map = {
- .atsc_6 = { .if_freq = 5380, .std_bits = 0x1b },
- .qam_6 = { .if_freq = 4000, .std_bits = 0x18 },
+ .atsc_6 = { .if_freq = 5380, .agc_mode = 3, .std = 3 },
+ .qam_6 = { .if_freq = 4000, .agc_mode = 3, .std = 0 },
};
static struct tda18271_config hauppauge_tda18271_config = {