diff options
author | David Wong <davidtlwong@gmail.com> | 2009-11-28 06:36:31 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-02-26 13:10:25 -0500 |
commit | c245c75c41b9693bcbd6c95e25af324188b4dce1 (patch) | |
tree | 4bd070c650c0b87e3ed90ee23ee7befe625635eb /drivers/media/dvb/frontends/atbm8830.c | |
parent | 8719cfdb4aa5bc7402bef873f607ed406960019f (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/atbm8830.c')
-rw-r--r-- | drivers/media/dvb/frontends/atbm8830.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/media/dvb/frontends/atbm8830.c b/drivers/media/dvb/frontends/atbm8830.c index 59881a5944eb..43aac2f85c2e 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) | |||
170 | return 0; | 170 | return 0; |
171 | } | 171 | } |
172 | 172 | ||
173 | static int set_agc_config(struct atbm_state *priv, | ||
174 | u8 min, u8 max, u8 hold_loop) | ||
175 | { | ||
176 | /* no effect if both min and max are zero */ | ||
177 | if (!min && !max) | ||
178 | return 0; | ||
179 | |||
180 | atbm8830_write_reg(priv, REG_AGC_MIN, min); | ||
181 | atbm8830_write_reg(priv, REG_AGC_MAX, max); | ||
182 | atbm8830_write_reg(priv, REG_AGC_HOLD_LOOP, hold_loop); | ||
183 | |||
184 | return 0; | ||
185 | } | ||
173 | 186 | ||
174 | static int set_static_channel_mode(struct atbm_state *priv) | 187 | static int set_static_channel_mode(struct atbm_state *priv) |
175 | { | 188 | { |
@@ -227,6 +240,9 @@ static int atbm8830_init(struct dvb_frontend *fe) | |||
227 | /*Set IF frequency*/ | 240 | /*Set IF frequency*/ |
228 | set_if_freq(priv, cfg->if_freq); | 241 | set_if_freq(priv, cfg->if_freq); |
229 | 242 | ||
243 | /*Set AGC Config*/ | ||
244 | set_agc_config(priv, cfg->agc_min, cfg->agc_max, | ||
245 | cfg->agc_hold_loop); | ||
230 | 246 | ||
231 | /*Set static channel mode*/ | 247 | /*Set static channel mode*/ |
232 | set_static_channel_mode(priv); | 248 | set_static_channel_mode(priv); |