aboutsummaryrefslogtreecommitdiff
path: root/drivers/media/dvb/frontends
diff options
context:
space:
mode:
authorDavid Wong <davidtlwong@gmail.com>2009-11-28 08:36:31 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-02-26 15:10:25 -0300
commitc245c75c41b9693bcbd6c95e25af324188b4dce1 (patch)
tree4bd070c650c0b87e3ed90ee23ee7befe625635eb /drivers/media/dvb/frontends
parent8719cfdb4aa5bc7402bef873f607ed406960019f (diff)
V4L/DVB (13838): atbm8830: use AGC setting from config
Improves ATBM8830 reception by using per card AGC configuration rather than register default. Signed-off-by: David T. L. Wong <davidtlwong@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/frontends')
-rw-r--r--drivers/media/dvb/frontends/atbm8830.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/media/dvb/frontends/atbm8830.c b/drivers/media/dvb/frontends/atbm8830.c
index 59881a5944e..43aac2f85c2 100644
--- a/drivers/media/dvb/frontends/atbm8830.c
+++ b/drivers/media/dvb/frontends/atbm8830.c
@@ -170,6 +170,19 @@ static int is_locked(struct atbm_state *priv, u8 *locked)
return 0;
}
+static int set_agc_config(struct atbm_state *priv,
+ u8 min, u8 max, u8 hold_loop)
+{
+ /* no effect if both min and max are zero */
+ if (!min && !max)
+ return 0;
+
+ atbm8830_write_reg(priv, REG_AGC_MIN, min);
+ atbm8830_write_reg(priv, REG_AGC_MAX, max);
+ atbm8830_write_reg(priv, REG_AGC_HOLD_LOOP, hold_loop);
+
+ return 0;
+}
static int set_static_channel_mode(struct atbm_state *priv)
{
@@ -227,6 +240,9 @@ static int atbm8830_init(struct dvb_frontend *fe)
/*Set IF frequency*/
set_if_freq(priv, cfg->if_freq);
+ /*Set AGC Config*/
+ set_agc_config(priv, cfg->agc_min, cfg->agc_max,
+ cfg->agc_hold_loop);
/*Set static channel mode*/
set_static_channel_mode(priv);