aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/dvb/frontends/stv6110.c13
-rw-r--r--drivers/media/dvb/frontends/stv6110.h1
-rw-r--r--drivers/media/video/cx23885/cx23885-dvb.c2
3 files changed, 7 insertions, 9 deletions
diff --git a/drivers/media/dvb/frontends/stv6110.c b/drivers/media/dvb/frontends/stv6110.c
index dcf1b21ea974..bef0cc838471 100644
--- a/drivers/media/dvb/frontends/stv6110.c
+++ b/drivers/media/dvb/frontends/stv6110.c
@@ -37,6 +37,7 @@ struct stv6110_priv {
37 37
38 u32 mclk; 38 u32 mclk;
39 u8 clk_div; 39 u8 clk_div;
40 u8 gain;
40 u8 regs[8]; 41 u8 regs[8];
41}; 42};
42 43
@@ -255,7 +256,7 @@ static int stv6110_set_frequency(struct dvb_frontend *fe, u32 frequency)
255 u8 ret = 0x04; 256 u8 ret = 0x04;
256 u32 divider, ref, p, presc, i, result_freq, vco_freq; 257 u32 divider, ref, p, presc, i, result_freq, vco_freq;
257 s32 p_calc, p_calc_opt = 1000, r_div, r_div_opt = 0, p_val; 258 s32 p_calc, p_calc_opt = 1000, r_div, r_div_opt = 0, p_val;
258 s32 srate; u8 gain; 259 s32 srate;
259 260
260 dprintk("%s, freq=%d kHz, mclk=%d Hz\n", __func__, 261 dprintk("%s, freq=%d kHz, mclk=%d Hz\n", __func__,
261 frequency, priv->mclk); 262 frequency, priv->mclk);
@@ -273,15 +274,8 @@ static int stv6110_set_frequency(struct dvb_frontend *fe, u32 frequency)
273 } else 274 } else
274 srate = 15000000; 275 srate = 15000000;
275 276
276 if (srate >= 15000000)
277 gain = 3; /* +6 dB */
278 else if (srate >= 5000000)
279 gain = 3; /* +6 dB */
280 else
281 gain = 3; /* +6 dB */
282
283 priv->regs[RSTV6110_CTRL2] &= ~0x0f; 277 priv->regs[RSTV6110_CTRL2] &= ~0x0f;
284 priv->regs[RSTV6110_CTRL2] |= (gain & 0x0f); 278 priv->regs[RSTV6110_CTRL2] |= (priv->gain & 0x0f);
285 279
286 if (frequency <= 1023000) { 280 if (frequency <= 1023000) {
287 p = 1; 281 p = 1;
@@ -436,6 +430,7 @@ struct dvb_frontend *stv6110_attach(struct dvb_frontend *fe,
436 priv->i2c = i2c; 430 priv->i2c = i2c;
437 priv->mclk = config->mclk; 431 priv->mclk = config->mclk;
438 priv->clk_div = config->clk_div; 432 priv->clk_div = config->clk_div;
433 priv->gain = config->gain;
439 434
440 memcpy(&priv->regs, &reg0[1], 8); 435 memcpy(&priv->regs, &reg0[1], 8);
441 436
diff --git a/drivers/media/dvb/frontends/stv6110.h b/drivers/media/dvb/frontends/stv6110.h
index 9db2402410f6..fe71bba6a26e 100644
--- a/drivers/media/dvb/frontends/stv6110.h
+++ b/drivers/media/dvb/frontends/stv6110.h
@@ -41,6 +41,7 @@
41struct stv6110_config { 41struct stv6110_config {
42 u8 i2c_address; 42 u8 i2c_address;
43 u32 mclk; 43 u32 mclk;
44 u8 gain;
44 u8 clk_div; /* divisor value for the output clock */ 45 u8 clk_div; /* divisor value for the output clock */
45}; 46};
46 47
diff --git a/drivers/media/video/cx23885/cx23885-dvb.c b/drivers/media/video/cx23885/cx23885-dvb.c
index f4f046cd81a5..0180b75d1f3d 100644
--- a/drivers/media/video/cx23885/cx23885-dvb.c
+++ b/drivers/media/video/cx23885/cx23885-dvb.c
@@ -414,12 +414,14 @@ static struct stv6110_config netup_stv6110_tunerconfig_a = {
414 .i2c_address = 0x60, 414 .i2c_address = 0x60,
415 .mclk = 16000000, 415 .mclk = 16000000,
416 .clk_div = 1, 416 .clk_div = 1,
417 .gain = 8, /* +16 dB - maximum gain */
417}; 418};
418 419
419static struct stv6110_config netup_stv6110_tunerconfig_b = { 420static struct stv6110_config netup_stv6110_tunerconfig_b = {
420 .i2c_address = 0x63, 421 .i2c_address = 0x63,
421 .mclk = 16000000, 422 .mclk = 16000000,
422 .clk_div = 1, 423 .clk_div = 1,
424 .gain = 8, /* +16 dB - maximum gain */
423}; 425};
424 426
425static int tbs_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage) 427static int tbs_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage)