aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2011-12-21 05:39:33 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-12-31 05:26:35 -0500
commit8b80ff3ad52690d37e9617335ce9d66e6d4a92e5 (patch)
tree1b350f5ad8e8f1c64a421033f87ee002f3b1750e
parent0607d077809014082965061e9e88f38459c070ac (diff)
[media] qt1010: remove fake implementaion of get_bandwidth()
This driver implements a fake get_bandwidth() callback. In reallity, the tuner driver won't adjust its low-pass filter based on a bandwidth, and were just providing a fake method for demods to read whatever was "set". This code is useless, as none of the drivers that use this tuner seems to require a get_bandwidth() callback. While here, convert set_params to use the DVBv5 way to pass parameters to tuners. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/common/tuners/qt1010.c16
-rw-r--r--drivers/media/common/tuners/qt1010_priv.h1
2 files changed, 4 insertions, 13 deletions
diff --git a/drivers/media/common/tuners/qt1010.c b/drivers/media/common/tuners/qt1010.c
index cd461c2a4c38..bd433adc492e 100644
--- a/drivers/media/common/tuners/qt1010.c
+++ b/drivers/media/common/tuners/qt1010.c
@@ -85,6 +85,7 @@ static void qt1010_dump_regs(struct qt1010_priv *priv)
85static int qt1010_set_params(struct dvb_frontend *fe, 85static int qt1010_set_params(struct dvb_frontend *fe,
86 struct dvb_frontend_parameters *params) 86 struct dvb_frontend_parameters *params)
87{ 87{
88 struct dtv_frontend_properties *c = &fe->dtv_property_cache;
88 struct qt1010_priv *priv; 89 struct qt1010_priv *priv;
89 int err; 90 int err;
90 u32 freq, div, mod1, mod2; 91 u32 freq, div, mod1, mod2;
@@ -144,13 +145,11 @@ static int qt1010_set_params(struct dvb_frontend *fe,
144#define FREQ2 4000000 /* 4 MHz Quartz oscillator in the stick? */ 145#define FREQ2 4000000 /* 4 MHz Quartz oscillator in the stick? */
145 146
146 priv = fe->tuner_priv; 147 priv = fe->tuner_priv;
147 freq = params->frequency; 148 freq = c->frequency;
148 div = (freq + QT1010_OFFSET) / QT1010_STEP; 149 div = (freq + QT1010_OFFSET) / QT1010_STEP;
149 freq = (div * QT1010_STEP) - QT1010_OFFSET; 150 freq = (div * QT1010_STEP) - QT1010_OFFSET;
150 mod1 = (freq + QT1010_OFFSET) % FREQ1; 151 mod1 = (freq + QT1010_OFFSET) % FREQ1;
151 mod2 = (freq + QT1010_OFFSET) % FREQ2; 152 mod2 = (freq + QT1010_OFFSET) % FREQ2;
152 priv->bandwidth =
153 (fe->ops.info.type == FE_OFDM) ? params->u.ofdm.bandwidth : 0;
154 priv->frequency = freq; 153 priv->frequency = freq;
155 154
156 if (fe->ops.i2c_gate_ctrl) 155 if (fe->ops.i2c_gate_ctrl)
@@ -321,6 +320,7 @@ static int qt1010_init(struct dvb_frontend *fe)
321{ 320{
322 struct qt1010_priv *priv = fe->tuner_priv; 321 struct qt1010_priv *priv = fe->tuner_priv;
323 struct dvb_frontend_parameters params; 322 struct dvb_frontend_parameters params;
323 struct dtv_frontend_properties *c = &fe->dtv_property_cache;
324 int err = 0; 324 int err = 0;
325 u8 i, tmpval, *valptr = NULL; 325 u8 i, tmpval, *valptr = NULL;
326 326
@@ -397,7 +397,7 @@ static int qt1010_init(struct dvb_frontend *fe)
397 if ((err = qt1010_init_meas2(priv, i, &tmpval))) 397 if ((err = qt1010_init_meas2(priv, i, &tmpval)))
398 return err; 398 return err;
399 399
400 params.frequency = 545000000; /* Sigmatek DVB-110 545000000 */ 400 c->frequency = 545000000; /* Sigmatek DVB-110 545000000 */
401 /* MSI Megasky 580 GL861 533000000 */ 401 /* MSI Megasky 580 GL861 533000000 */
402 return qt1010_set_params(fe, &params); 402 return qt1010_set_params(fe, &params);
403} 403}
@@ -416,13 +416,6 @@ static int qt1010_get_frequency(struct dvb_frontend *fe, u32 *frequency)
416 return 0; 416 return 0;
417} 417}
418 418
419static int qt1010_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth)
420{
421 struct qt1010_priv *priv = fe->tuner_priv;
422 *bandwidth = priv->bandwidth;
423 return 0;
424}
425
426static int qt1010_get_if_frequency(struct dvb_frontend *fe, u32 *frequency) 419static int qt1010_get_if_frequency(struct dvb_frontend *fe, u32 *frequency)
427{ 420{
428 *frequency = 36125000; 421 *frequency = 36125000;
@@ -443,7 +436,6 @@ static const struct dvb_tuner_ops qt1010_tuner_ops = {
443 436
444 .set_params = qt1010_set_params, 437 .set_params = qt1010_set_params,
445 .get_frequency = qt1010_get_frequency, 438 .get_frequency = qt1010_get_frequency,
446 .get_bandwidth = qt1010_get_bandwidth,
447 .get_if_frequency = qt1010_get_if_frequency, 439 .get_if_frequency = qt1010_get_if_frequency,
448}; 440};
449 441
diff --git a/drivers/media/common/tuners/qt1010_priv.h b/drivers/media/common/tuners/qt1010_priv.h
index 090cf475f099..2c42d3f01636 100644
--- a/drivers/media/common/tuners/qt1010_priv.h
+++ b/drivers/media/common/tuners/qt1010_priv.h
@@ -99,7 +99,6 @@ struct qt1010_priv {
99 u8 reg25_init_val; 99 u8 reg25_init_val;
100 100
101 u32 frequency; 101 u32 frequency;
102 u32 bandwidth;
103}; 102};
104 103
105#endif 104#endif