* [PATCH v4 00/47] DVB tuners: remove dvb_frontend_parameters from set_params()
@ 2011-12-24 15:50 Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 01/47] [media] dvb: replace SYS_DVBC_ANNEX_AC by the right delsys Mauro Carvalho Chehab
0 siblings, 1 reply; 51+ messages in thread
From: Mauro Carvalho Chehab @ 2011-12-24 15:50 UTC (permalink / raw)
Cc: Mauro Carvalho Chehab, Linux Media Mailing List
This is a big series of patches, but most stuff are trivial:
instead of using the DVBv3 way (explicitly passing a
struct dvb_frontend_parameters to set_parms), use the DVBv5
way (e. g. fe->dtv_property_cache). This makes the drivers more
consistent, as newer drivers (DVB-T2/S2, ISDB-T, DMTB, DVB turbo,
etc) can't use the DVBv3 parameters, as they don't have the
parameters needed by those systems.
I'm working on a further patch series that will do the same thing
for the DVB demods.
After having both applied, the DVB core functions can be
simplified, as they won't need to sync with DVBv3 parameters
for DVBv5 calls. This will help to solve a series of bugs
with newer delivery systems due to the sync issues.
Mauro Carvalho Chehab (47):
[media] dvb: replace SYS_DVBC_ANNEX_AC by the right delsys
[media] dvb_core: estimate bw for all non-terrestial systems
[media] qt1010: remove fake implementaion of get_bandwidth()
[media] mt2060: remove fake implementaion of get_bandwidth()
[media] mt2031: remove fake implementaion of get_bandwidth()
[media] mc44s803: use DVBv5 parameters on set_params()
[media] max2165: use DVBv5 parameters on set_params()
[media] mt2266: use DVBv5 parameters for set_params()
[media] mxl5005s: use DVBv5 parameters on set_params()
[media] mxl5005s: fix: don't discard bandwidth changes
[media] mxl5007t: use DVBv5 parameters on set_params()
[media] tda18218: use DVBv5 parameters on set_params()
[media] tda18271: add support for QAM 7 MHz map
[media] tda18271-fe: use DVBv5 parameters on set_params()
[media] tda827x: use DVBv5 parameters on set_params()
[media] tuner-xc2028: use DVBv5 parameters on set_params()
[media] xc4000: use DVBv5 parameters on set_params()
[media] cx24113: use DVBv5 parameters on set_params()
[media] zl10039: use DVBv5 parameters on set_params()
[media] av7110: use DVBv5 parameters on set_params()
[media] budget-ci: use DVBv5 parameters on set_params()
[media] budget-patch: use DVBv5 parameters on set_params()
[media] saa7134: use DVBv5 parameters on set_params()
[media] cx88: use DVBv5 parameters on set_params()
[media] tua6100: use DVBv5 parameters on set_params()
[media] itd1000: use DVBv5 parameters on set_params()
[media] bsbe1, bsru6, tdh1: use DVBv5 parameters on set_params()
[media] ix2505v: use DVBv5 parameters on set_params()
[media] stb6000: use DVBv5 parameters on set_params()
[media] tda826x: use DVBv5 parameters on set_params()
[media] mxl111sf-tuner: use DVBv5 parameters on set_params()
[media] mantis_vp1033: use DVBv5 parameters on set_params()
[media] mantis_vp2033: use DVBv5 parameters on set_params()
[media] mantis_vp2040: use DVBv5 parameters on set_params()
[media] pluto2: use DVBv5 parameters on set_params()
[media] dvb-ttusb-budget: use DVBv5 parameters on set_params()
[media] tuner-simple: use DVBv5 parameters on set_params()
[media] dvb-bt8xx: use DVBv5 parameters on set_params()
[media] dvb-pll: use DVBv5 parameters on set_params()
[media] zl10036: use DVBv5 parameters on set_params()
[media] dib0070: Remove unused dvb_frontend_parameters
[media] cxusb: use DVBv5 parameters on set_params()
[media] dib0700_devices: use DVBv5 parameters on set_params()
[media] budget-av: use DVBv5 parameters on set_params()
[media] budget: use DVBv5 parameters on set_params()
[media] dvb: remove dvb_frontend_parameters from calc_regs()
[media] tuners: remove dvb_frontend_parameters from set_params()
drivers/media/common/tuners/max2165.c | 39 +++-----
drivers/media/common/tuners/mc44s803.c | 10 +-
drivers/media/common/tuners/mt2060.c | 14 +---
drivers/media/common/tuners/mt2060_priv.h | 1 -
drivers/media/common/tuners/mt2131.c | 20 +----
drivers/media/common/tuners/mt2131_priv.h | 1 -
drivers/media/common/tuners/mt2266.c | 27 +++---
drivers/media/common/tuners/mxl5005s.c | 69 +++++++--------
drivers/media/common/tuners/mxl5007t.c | 54 +++++------
drivers/media/common/tuners/qt1010.c | 22 ++----
drivers/media/common/tuners/qt1010_priv.h | 1 -
drivers/media/common/tuners/tda18212.c | 6 +-
drivers/media/common/tuners/tda18218.c | 18 ++---
drivers/media/common/tuners/tda18271-fe.c | 77 +++++++---------
drivers/media/common/tuners/tda18271-maps.c | 4 +
drivers/media/common/tuners/tda18271.h | 1 +
drivers/media/common/tuners/tda827x.c | 55 ++++++-----
drivers/media/common/tuners/tuner-simple.c | 69 ++++++++++-----
drivers/media/common/tuners/tuner-xc2028.c | 86 ++++++++----------
drivers/media/common/tuners/xc4000.c | 100 +++++++++------------
drivers/media/common/tuners/xc5000.c | 3 +-
drivers/media/dvb/bt8xx/dvb-bt8xx.c | 101 +++++++++++----------
drivers/media/dvb/dvb-core/dvb_frontend.c | 37 ++++++--
drivers/media/dvb/dvb-core/dvb_frontend.h | 4 +-
drivers/media/dvb/dvb-usb/af9005-fe.c | 2 +-
drivers/media/dvb/dvb-usb/cxusb.c | 11 +--
drivers/media/dvb/dvb-usb/dib0700_devices.c | 49 +++++-----
drivers/media/dvb/dvb-usb/digitv.c | 4 +-
drivers/media/dvb/dvb-usb/mxl111sf-demod.c | 2 +-
drivers/media/dvb/dvb-usb/mxl111sf-tuner.c | 49 +++++------
drivers/media/dvb/frontends/af9013.c | 2 +-
drivers/media/dvb/frontends/atbm8830.c | 2 +-
drivers/media/dvb/frontends/au8522_dig.c | 2 +-
drivers/media/dvb/frontends/bsbe1.h | 7 +-
drivers/media/dvb/frontends/bsru6.h | 9 +-
drivers/media/dvb/frontends/cx22700.c | 2 +-
drivers/media/dvb/frontends/cx22702.c | 2 +-
drivers/media/dvb/frontends/cx24110.c | 2 +-
drivers/media/dvb/frontends/cx24113.c | 8 +-
drivers/media/dvb/frontends/cx24123.c | 2 +-
drivers/media/dvb/frontends/cxd2820r_c.c | 6 +-
drivers/media/dvb/frontends/cxd2820r_t.c | 2 +-
drivers/media/dvb/frontends/cxd2820r_t2.c | 2 +-
drivers/media/dvb/frontends/dib0070.c | 10 +-
drivers/media/dvb/frontends/dib0090.c | 2 +-
drivers/media/dvb/frontends/dib3000mb.c | 2 +-
drivers/media/dvb/frontends/dib3000mc.c | 2 +-
drivers/media/dvb/frontends/dib7000m.c | 2 +-
drivers/media/dvb/frontends/dib7000p.c | 2 +-
drivers/media/dvb/frontends/dib8000.c | 2 +-
drivers/media/dvb/frontends/drxd_hard.c | 2 +-
drivers/media/dvb/frontends/drxk_hard.c | 2 +-
drivers/media/dvb/frontends/dvb-pll.c | 68 +++++++-------
drivers/media/dvb/frontends/dvb_dummy_fe.c | 2 +-
drivers/media/dvb/frontends/ec100.c | 2 +-
drivers/media/dvb/frontends/it913x-fe.c | 2 +-
drivers/media/dvb/frontends/itd1000.c | 7 +-
drivers/media/dvb/frontends/ix2505v.c | 8 +-
drivers/media/dvb/frontends/l64781.c | 2 +-
drivers/media/dvb/frontends/lgdt3305.c | 4 +-
drivers/media/dvb/frontends/lgdt330x.c | 2 +-
drivers/media/dvb/frontends/lgs8gl5.c | 2 +-
drivers/media/dvb/frontends/lgs8gxx.c | 2 +-
drivers/media/dvb/frontends/mb86a20s.c | 2 +-
drivers/media/dvb/frontends/mt312.c | 2 +-
drivers/media/dvb/frontends/mt352.c | 4 +-
drivers/media/dvb/frontends/nxt200x.c | 2 +-
drivers/media/dvb/frontends/nxt6000.c | 2 +-
drivers/media/dvb/frontends/or51132.c | 2 +-
drivers/media/dvb/frontends/or51211.c | 2 +-
drivers/media/dvb/frontends/s5h1409.c | 2 +-
drivers/media/dvb/frontends/s5h1411.c | 2 +-
drivers/media/dvb/frontends/s5h1420.c | 4 +-
drivers/media/dvb/frontends/s5h1432.c | 6 +-
drivers/media/dvb/frontends/sp8870.c | 2 +-
drivers/media/dvb/frontends/sp887x.c | 2 +-
drivers/media/dvb/frontends/stb6000.c | 8 +-
drivers/media/dvb/frontends/stv0288.c | 2 +-
drivers/media/dvb/frontends/stv0297.c | 2 +-
drivers/media/dvb/frontends/stv0299.c | 2 +-
drivers/media/dvb/frontends/stv0367.c | 4 +-
drivers/media/dvb/frontends/stv6110.c | 3 +-
drivers/media/dvb/frontends/tda10021.c | 2 +-
drivers/media/dvb/frontends/tda10023.c | 2 +-
drivers/media/dvb/frontends/tda10048.c | 2 +-
drivers/media/dvb/frontends/tda1004x.c | 2 +-
drivers/media/dvb/frontends/tda10086.c | 2 +-
drivers/media/dvb/frontends/tda18271c2dd.c | 3 +-
drivers/media/dvb/frontends/tda8083.c | 2 +-
drivers/media/dvb/frontends/tda826x.c | 7 +-
drivers/media/dvb/frontends/tdhd1.h | 11 ++-
drivers/media/dvb/frontends/tua6100.c | 18 ++--
drivers/media/dvb/frontends/ves1820.c | 2 +-
drivers/media/dvb/frontends/ves1x93.c | 2 +-
drivers/media/dvb/frontends/zl10036.c | 10 +-
drivers/media/dvb/frontends/zl10039.c | 10 +-
drivers/media/dvb/frontends/zl10353.c | 4 +-
drivers/media/dvb/mantis/mantis_vp1033.c | 8 +-
drivers/media/dvb/mantis/mantis_vp2033.c | 9 +-
drivers/media/dvb/mantis/mantis_vp2040.c | 9 +-
drivers/media/dvb/pluto2/pluto2.c | 6 +-
drivers/media/dvb/ttpci/av7110.c | 69 ++++++++-------
drivers/media/dvb/ttpci/budget-av.c | 50 ++++++-----
drivers/media/dvb/ttpci/budget-ci.c | 48 +++++-----
drivers/media/dvb/ttpci/budget-patch.c | 20 +++--
drivers/media/dvb/ttpci/budget.c | 49 ++++++-----
drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c | 62 ++++++++------
drivers/media/video/cx88/cx88-dvb.c | 8 +-
drivers/media/video/saa7134/saa7134-dvb.c | 33 ++++----
109 files changed, 806 insertions(+), 810 deletions(-)
--
1.7.8.352.g876a6
^ permalink raw reply [flat|nested] 51+ messages in thread
* [PATCH v4 01/47] [media] dvb: replace SYS_DVBC_ANNEX_AC by the right delsys
2011-12-24 15:50 [PATCH v4 00/47] DVB tuners: remove dvb_frontend_parameters from set_params() Mauro Carvalho Chehab
@ 2011-12-24 15:50 ` Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 02/47] [media] dvb_core: estimate bw for all non-terrestial systems Mauro Carvalho Chehab
0 siblings, 1 reply; 51+ messages in thread
From: Mauro Carvalho Chehab @ 2011-12-24 15:50 UTC (permalink / raw)
Cc: Mauro Carvalho Chehab, Linux Media Mailing List
SYS_DVBC_ANNEX_AC is an alias for SYS_DVBC_ANNEX_A. However,
the first one is incorrect, as not all devices support both.
So, replace its occurrences by the proper value (either
SYS_DVBC_ANNEX_A or both SYS_DVBC_ANNEX_A and SYS_DVBC_ANNEX_C).
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
drivers/media/common/tuners/tda18212.c | 3 ++-
drivers/media/dvb/dvb-core/dvb_frontend.c | 2 +-
drivers/media/dvb/frontends/cxd2820r_c.c | 4 ++--
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/media/common/tuners/tda18212.c b/drivers/media/common/tuners/tda18212.c
index f52282e..a58c74f 100644
--- a/drivers/media/common/tuners/tda18212.c
+++ b/drivers/media/common/tuners/tda18212.c
@@ -203,7 +203,8 @@ static int tda18212_set_params(struct dvb_frontend *fe,
goto error;
}
break;
- case SYS_DVBC_ANNEX_AC:
+ case SYS_DVBC_ANNEX_A:
+ case SYS_DVBC_ANNEX_C:
if_khz = priv->cfg->if_dvbc;
i = DVBC_8;
break;
diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c
index 66537b1..a25ba3a 100644
--- a/drivers/media/dvb/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb/dvb-core/dvb_frontend.c
@@ -1242,7 +1242,7 @@ static void dtv_set_default_delivery_caps(const struct dvb_frontend *fe, struct
p->u.buffer.data[ncaps++] = SYS_TURBO;
break;
case FE_QAM:
- p->u.buffer.data[ncaps++] = SYS_DVBC_ANNEX_AC;
+ p->u.buffer.data[ncaps++] = SYS_DVBC_ANNEX_A;
break;
case FE_OFDM:
p->u.buffer.data[ncaps++] = SYS_DVBT;
diff --git a/drivers/media/dvb/frontends/cxd2820r_c.c b/drivers/media/dvb/frontends/cxd2820r_c.c
index c412877..7016e27 100644
--- a/drivers/media/dvb/frontends/cxd2820r_c.c
+++ b/drivers/media/dvb/frontends/cxd2820r_c.c
@@ -59,7 +59,7 @@ int cxd2820r_set_frontend_c(struct dvb_frontend *fe,
if (fe->ops.tuner_ops.set_params)
fe->ops.tuner_ops.set_params(fe, params);
- if (priv->delivery_system != SYS_DVBC_ANNEX_AC) {
+ if (priv->delivery_system != SYS_DVBC_ANNEX_A) {
for (i = 0; i < ARRAY_SIZE(tab); i++) {
ret = cxd2820r_wr_reg_mask(priv, tab[i].reg,
tab[i].val, tab[i].mask);
@@ -68,7 +68,7 @@ int cxd2820r_set_frontend_c(struct dvb_frontend *fe,
}
}
- priv->delivery_system = SYS_DVBC_ANNEX_AC;
+ priv->delivery_system = SYS_DVBC_ANNEX_A;
priv->ber_running = 0; /* tune stops BER counter */
/* program IF frequency */
--
1.7.8.352.g876a6
^ permalink raw reply related [flat|nested] 51+ messages in thread
* [PATCH v4 02/47] [media] dvb_core: estimate bw for all non-terrestial systems
2011-12-24 15:50 ` [PATCH v4 01/47] [media] dvb: replace SYS_DVBC_ANNEX_AC by the right delsys Mauro Carvalho Chehab
@ 2011-12-24 15:50 ` Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 03/47] [media] qt1010: remove fake implementaion of get_bandwidth() Mauro Carvalho Chehab
0 siblings, 1 reply; 51+ messages in thread
From: Mauro Carvalho Chehab @ 2011-12-24 15:50 UTC (permalink / raw)
Cc: Mauro Carvalho Chehab, Linux Media Mailing List
Instead of just estimating the bandwidth for DVB-C annex A/C,
also fill it at the core for ATSC and DVB-C annex B. This
simplifies the logic inside the tuners, as all non-satellite
tuners can just use c->bandwidth_hz for all supported
delivery systems.
It could make sense to latter use it also for satellite
systems, as several DVB-S drivers have their own calculus.
However, on DVB-S2 the bw estimation is a little more complex,
and the existing drivers have some optimized calculus for
bandwidth. So, let's not touch on it for now.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
drivers/media/dvb/dvb-core/dvb_frontend.c | 35 ++++++++++++++++++++++------
1 files changed, 27 insertions(+), 8 deletions(-)
diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c
index a25ba3a..8dedff4 100644
--- a/drivers/media/dvb/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb/dvb-core/dvb_frontend.c
@@ -1180,19 +1180,38 @@ static void dtv_property_adv_params_sync(struct dvb_frontend *fe)
}
/*
- * On DVB-C, the bandwidth is a function of roll-off and symbol rate.
- * The bandwidth is required for DVB-C tuners, in order to avoid
- * inter-channel noise. Instead of estimating the minimal required
- * bandwidth on every single driver, calculates it here and fills
- * it at the cache bandwidth parameter.
+ * Be sure that the bandwidth will be filled for all
+ * non-satellite systems, as tuners need to know what
+ * low pass/Nyquist half filter should be applied, in
+ * order to avoid inter-channel noise.
+ *
+ * ISDB-T and DVB-T/T2 already sets bandwidth.
+ * ATSC and DVB-C don't set, so, the core should fill it.
+ *
+ * On DVB-C Annex A and C, the bandwidth is a function of
+ * the roll-off and symbol rate. Annex B defines different
+ * roll-off factors depending on the modulation. Fortunately,
+ * Annex B is only used with 6MHz, so there's no need to
+ * calculate it.
+ *
* While not officially supported, a side effect of handling it at
* the cache level is that a program could retrieve the bandwidth
- * via DTV_BANDWIDTH_HZ, wich may be useful for test programs.
+ * via DTV_BANDWIDTH_HZ, which may be useful for test programs.
*/
- if (c->delivery_system == SYS_DVBC_ANNEX_A)
+ switch (c->delivery_system) {
+ case SYS_ATSC:
+ case SYS_DVBC_ANNEX_B:
+ c->bandwidth_hz = 6000000;
+ break;
+ case SYS_DVBC_ANNEX_A:
rolloff = 115;
- if (c->delivery_system == SYS_DVBC_ANNEX_C)
+ break;
+ case SYS_DVBC_ANNEX_C:
rolloff = 113;
+ break;
+ default:
+ break;
+ }
if (rolloff)
c->bandwidth_hz = (c->symbol_rate * rolloff) / 100;
}
--
1.7.8.352.g876a6
^ permalink raw reply related [flat|nested] 51+ messages in thread
* [PATCH v4 03/47] [media] qt1010: remove fake implementaion of get_bandwidth()
2011-12-24 15:50 ` [PATCH v4 02/47] [media] dvb_core: estimate bw for all non-terrestial systems Mauro Carvalho Chehab
@ 2011-12-24 15:50 ` Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 04/47] [media] mt2060: " Mauro Carvalho Chehab
0 siblings, 1 reply; 51+ messages in thread
From: Mauro Carvalho Chehab @ 2011-12-24 15:50 UTC (permalink / raw)
Cc: Mauro Carvalho Chehab, Linux Media Mailing List
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>
---
drivers/media/common/tuners/qt1010.c | 16 ++++------------
drivers/media/common/tuners/qt1010_priv.h | 1 -
2 files changed, 4 insertions(+), 13 deletions(-)
diff --git a/drivers/media/common/tuners/qt1010.c b/drivers/media/common/tuners/qt1010.c
index cd461c2..bd433ad 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)
static int qt1010_set_params(struct dvb_frontend *fe,
struct dvb_frontend_parameters *params)
{
+ struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct qt1010_priv *priv;
int err;
u32 freq, div, mod1, mod2;
@@ -144,13 +145,11 @@ static int qt1010_set_params(struct dvb_frontend *fe,
#define FREQ2 4000000 /* 4 MHz Quartz oscillator in the stick? */
priv = fe->tuner_priv;
- freq = params->frequency;
+ freq = c->frequency;
div = (freq + QT1010_OFFSET) / QT1010_STEP;
freq = (div * QT1010_STEP) - QT1010_OFFSET;
mod1 = (freq + QT1010_OFFSET) % FREQ1;
mod2 = (freq + QT1010_OFFSET) % FREQ2;
- priv->bandwidth =
- (fe->ops.info.type == FE_OFDM) ? params->u.ofdm.bandwidth : 0;
priv->frequency = freq;
if (fe->ops.i2c_gate_ctrl)
@@ -321,6 +320,7 @@ static int qt1010_init(struct dvb_frontend *fe)
{
struct qt1010_priv *priv = fe->tuner_priv;
struct dvb_frontend_parameters params;
+ struct dtv_frontend_properties *c = &fe->dtv_property_cache;
int err = 0;
u8 i, tmpval, *valptr = NULL;
@@ -397,7 +397,7 @@ static int qt1010_init(struct dvb_frontend *fe)
if ((err = qt1010_init_meas2(priv, i, &tmpval)))
return err;
- params.frequency = 545000000; /* Sigmatek DVB-110 545000000 */
+ c->frequency = 545000000; /* Sigmatek DVB-110 545000000 */
/* MSI Megasky 580 GL861 533000000 */
return qt1010_set_params(fe, ¶ms);
}
@@ -416,13 +416,6 @@ static int qt1010_get_frequency(struct dvb_frontend *fe, u32 *frequency)
return 0;
}
-static int qt1010_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth)
-{
- struct qt1010_priv *priv = fe->tuner_priv;
- *bandwidth = priv->bandwidth;
- return 0;
-}
-
static int qt1010_get_if_frequency(struct dvb_frontend *fe, u32 *frequency)
{
*frequency = 36125000;
@@ -443,7 +436,6 @@ static const struct dvb_tuner_ops qt1010_tuner_ops = {
.set_params = qt1010_set_params,
.get_frequency = qt1010_get_frequency,
- .get_bandwidth = qt1010_get_bandwidth,
.get_if_frequency = qt1010_get_if_frequency,
};
diff --git a/drivers/media/common/tuners/qt1010_priv.h b/drivers/media/common/tuners/qt1010_priv.h
index 090cf47..2c42d3f 100644
--- a/drivers/media/common/tuners/qt1010_priv.h
+++ b/drivers/media/common/tuners/qt1010_priv.h
@@ -99,7 +99,6 @@ struct qt1010_priv {
u8 reg25_init_val;
u32 frequency;
- u32 bandwidth;
};
#endif
--
1.7.8.352.g876a6
^ permalink raw reply related [flat|nested] 51+ messages in thread
* [PATCH v4 04/47] [media] mt2060: remove fake implementaion of get_bandwidth()
2011-12-24 15:50 ` [PATCH v4 03/47] [media] qt1010: remove fake implementaion of get_bandwidth() Mauro Carvalho Chehab
@ 2011-12-24 15:50 ` Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 05/47] [media] mt2031: " Mauro Carvalho Chehab
0 siblings, 1 reply; 51+ messages in thread
From: Mauro Carvalho Chehab @ 2011-12-24 15:50 UTC (permalink / raw)
Cc: Mauro Carvalho Chehab, Linux Media Mailing List
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>
---
drivers/media/common/tuners/mt2060.c | 12 ++----------
drivers/media/common/tuners/mt2060_priv.h | 1 -
2 files changed, 2 insertions(+), 11 deletions(-)
diff --git a/drivers/media/common/tuners/mt2060.c b/drivers/media/common/tuners/mt2060.c
index 2ecaa53..6fe2ef9 100644
--- a/drivers/media/common/tuners/mt2060.c
+++ b/drivers/media/common/tuners/mt2060.c
@@ -155,6 +155,7 @@ static int mt2060_spurcheck(u32 lo1,u32 lo2,u32 if2)
static int mt2060_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
{
+ struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct mt2060_priv *priv;
int ret=0;
int i=0;
@@ -176,8 +177,7 @@ static int mt2060_set_params(struct dvb_frontend *fe, struct dvb_frontend_parame
mt2060_writeregs(priv,b,2);
- freq = params->frequency / 1000; // Hz -> kHz
- priv->bandwidth = (fe->ops.info.type == FE_OFDM) ? params->u.ofdm.bandwidth : 0;
+ freq = c->frequency / 1000; /* Hz -> kHz */
f_lo1 = freq + if1 * 1000;
f_lo1 = (f_lo1 / 250) * 250;
@@ -293,13 +293,6 @@ static int mt2060_get_frequency(struct dvb_frontend *fe, u32 *frequency)
return 0;
}
-static int mt2060_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth)
-{
- struct mt2060_priv *priv = fe->tuner_priv;
- *bandwidth = priv->bandwidth;
- return 0;
-}
-
static int mt2060_get_if_frequency(struct dvb_frontend *fe, u32 *frequency)
{
*frequency = IF2 * 1000;
@@ -362,7 +355,6 @@ static const struct dvb_tuner_ops mt2060_tuner_ops = {
.set_params = mt2060_set_params,
.get_frequency = mt2060_get_frequency,
- .get_bandwidth = mt2060_get_bandwidth,
.get_if_frequency = mt2060_get_if_frequency,
};
diff --git a/drivers/media/common/tuners/mt2060_priv.h b/drivers/media/common/tuners/mt2060_priv.h
index 5eaccde..2b60de6 100644
--- a/drivers/media/common/tuners/mt2060_priv.h
+++ b/drivers/media/common/tuners/mt2060_priv.h
@@ -97,7 +97,6 @@ struct mt2060_priv {
struct i2c_adapter *i2c;
u32 frequency;
- u32 bandwidth;
u16 if1_freq;
u8 fmfreq;
};
--
1.7.8.352.g876a6
^ permalink raw reply related [flat|nested] 51+ messages in thread
* [PATCH v4 05/47] [media] mt2031: remove fake implementaion of get_bandwidth()
2011-12-24 15:50 ` [PATCH v4 04/47] [media] mt2060: " Mauro Carvalho Chehab
@ 2011-12-24 15:50 ` Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 06/47] [media] mc44s803: use DVBv5 parameters on set_params() Mauro Carvalho Chehab
0 siblings, 1 reply; 51+ messages in thread
From: Mauro Carvalho Chehab @ 2011-12-24 15:50 UTC (permalink / raw)
Cc: Mauro Carvalho Chehab, Linux Media Mailing List
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>
---
drivers/media/common/tuners/mt2131.c | 17 ++---------------
drivers/media/common/tuners/mt2131_priv.h | 1 -
2 files changed, 2 insertions(+), 16 deletions(-)
diff --git a/drivers/media/common/tuners/mt2131.c b/drivers/media/common/tuners/mt2131.c
index a4f830b..d9cab1f 100644
--- a/drivers/media/common/tuners/mt2131.c
+++ b/drivers/media/common/tuners/mt2131.c
@@ -95,6 +95,7 @@ static int mt2131_writeregs(struct mt2131_priv *priv,u8 *buf, u8 len)
static int mt2131_set_params(struct dvb_frontend *fe,
struct dvb_frontend_parameters *params)
{
+ struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct mt2131_priv *priv;
int ret=0, i;
u32 freq;
@@ -105,12 +106,8 @@ static int mt2131_set_params(struct dvb_frontend *fe,
u8 lockval = 0;
priv = fe->tuner_priv;
- if (fe->ops.info.type == FE_OFDM)
- priv->bandwidth = params->u.ofdm.bandwidth;
- else
- priv->bandwidth = 0;
- freq = params->frequency / 1000; // Hz -> kHz
+ freq = c->frequency / 1000; /* Hz -> kHz */
dprintk(1, "%s() freq=%d\n", __func__, freq);
f_lo1 = freq + MT2131_IF1 * 1000;
@@ -193,14 +190,6 @@ static int mt2131_get_frequency(struct dvb_frontend *fe, u32 *frequency)
return 0;
}
-static int mt2131_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth)
-{
- struct mt2131_priv *priv = fe->tuner_priv;
- dprintk(1, "%s()\n", __func__);
- *bandwidth = priv->bandwidth;
- return 0;
-}
-
static int mt2131_get_status(struct dvb_frontend *fe, u32 *status)
{
struct mt2131_priv *priv = fe->tuner_priv;
@@ -263,7 +252,6 @@ static const struct dvb_tuner_ops mt2131_tuner_ops = {
.set_params = mt2131_set_params,
.get_frequency = mt2131_get_frequency,
- .get_bandwidth = mt2131_get_bandwidth,
.get_status = mt2131_get_status
};
@@ -281,7 +269,6 @@ struct dvb_frontend * mt2131_attach(struct dvb_frontend *fe,
return NULL;
priv->cfg = cfg;
- priv->bandwidth = 6000000; /* 6MHz */
priv->i2c = i2c;
if (mt2131_readreg(priv, 0, &id) != 0) {
diff --git a/drivers/media/common/tuners/mt2131_priv.h b/drivers/media/common/tuners/mt2131_priv.h
index 4e05a67..62aeedf 100644
--- a/drivers/media/common/tuners/mt2131_priv.h
+++ b/drivers/media/common/tuners/mt2131_priv.h
@@ -38,7 +38,6 @@ struct mt2131_priv {
struct i2c_adapter *i2c;
u32 frequency;
- u32 bandwidth;
};
#endif /* __MT2131_PRIV_H__ */
--
1.7.8.352.g876a6
^ permalink raw reply related [flat|nested] 51+ messages in thread
* [PATCH v4 06/47] [media] mc44s803: use DVBv5 parameters on set_params()
2011-12-24 15:50 ` [PATCH v4 05/47] [media] mt2031: " Mauro Carvalho Chehab
@ 2011-12-24 15:50 ` Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 07/47] [media] max2165: " Mauro Carvalho Chehab
0 siblings, 1 reply; 51+ messages in thread
From: Mauro Carvalho Chehab @ 2011-12-24 15:50 UTC (permalink / raw)
Cc: Mauro Carvalho Chehab, Linux Media Mailing List
Instead of using DVBv3 parameters, rely on DVBv5 parameters to
set the tuner.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
drivers/media/common/tuners/mc44s803.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/media/common/tuners/mc44s803.c b/drivers/media/common/tuners/mc44s803.c
index fe5c4b8..5a8758c 100644
--- a/drivers/media/common/tuners/mc44s803.c
+++ b/drivers/media/common/tuners/mc44s803.c
@@ -218,18 +218,19 @@ static int mc44s803_set_params(struct dvb_frontend *fe,
struct dvb_frontend_parameters *params)
{
struct mc44s803_priv *priv = fe->tuner_priv;
+ struct dtv_frontend_properties *c = &fe->dtv_property_cache;
u32 r1, r2, n1, n2, lo1, lo2, freq, val;
int err;
- priv->frequency = params->frequency;
+ priv->frequency = c->frequency;
r1 = MC44S803_OSC / 1000000;
r2 = MC44S803_OSC / 100000;
- n1 = (params->frequency + MC44S803_IF1 + 500000) / 1000000;
+ n1 = (c->frequency + MC44S803_IF1 + 500000) / 1000000;
freq = MC44S803_OSC / r1 * n1;
lo1 = ((60 * n1) + (r1 / 2)) / r1;
- freq = freq - params->frequency;
+ freq = freq - c->frequency;
n2 = (freq - MC44S803_IF2 + 50000) / 100000;
lo2 = ((60 * n2) + (r2 / 2)) / r2;
--
1.7.8.352.g876a6
^ permalink raw reply related [flat|nested] 51+ messages in thread
* [PATCH v4 07/47] [media] max2165: use DVBv5 parameters on set_params()
2011-12-24 15:50 ` [PATCH v4 06/47] [media] mc44s803: use DVBv5 parameters on set_params() Mauro Carvalho Chehab
@ 2011-12-24 15:50 ` Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 08/47] [media] mt2266: use DVBv5 parameters for set_params() Mauro Carvalho Chehab
0 siblings, 1 reply; 51+ messages in thread
From: Mauro Carvalho Chehab @ 2011-12-24 15:50 UTC (permalink / raw)
Cc: Mauro Carvalho Chehab, Linux Media Mailing List
Instead of using DVBv3 parameters, rely on DVBv5 parameters to
set the tuner.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
drivers/media/common/tuners/max2165.c | 36 +++++++++++---------------------
1 files changed, 13 insertions(+), 23 deletions(-)
diff --git a/drivers/media/common/tuners/max2165.c b/drivers/media/common/tuners/max2165.c
index 9883617..0343449 100644
--- a/drivers/media/common/tuners/max2165.c
+++ b/drivers/media/common/tuners/max2165.c
@@ -151,7 +151,7 @@ static int max2165_set_bandwidth(struct max2165_priv *priv, u32 bw)
{
u8 val;
- if (bw == BANDWIDTH_8_MHZ)
+ if (bw == 8000000)
val = priv->bb_filter_8mhz_cfg;
else
val = priv->bb_filter_7mhz_cfg;
@@ -261,35 +261,25 @@ static int max2165_set_params(struct dvb_frontend *fe,
struct dvb_frontend_parameters *params)
{
struct max2165_priv *priv = fe->tuner_priv;
+ struct dtv_frontend_properties *c = &fe->dtv_property_cache;
int ret;
- dprintk("%s() frequency=%d (Hz)\n", __func__, params->frequency);
- if (fe->ops.info.type == FE_ATSC) {
- return -EINVAL;
- } else if (fe->ops.info.type == FE_OFDM) {
- dprintk("%s() OFDM\n", __func__);
- switch (params->u.ofdm.bandwidth) {
- case BANDWIDTH_6_MHZ:
- return -EINVAL;
- case BANDWIDTH_7_MHZ:
- case BANDWIDTH_8_MHZ:
- priv->frequency = params->frequency;
- priv->bandwidth = params->u.ofdm.bandwidth;
- break;
- default:
- printk(KERN_ERR "MAX2165 bandwidth not set!\n");
- return -EINVAL;
- }
- } else {
- printk(KERN_ERR "MAX2165 modulation type not supported!\n");
+ switch (c->bandwidth_hz) {
+ case 7000000:
+ case 8000000:
+ priv->frequency = c->frequency;
+ break;
+ default:
+ printk(KERN_INFO "MAX2165: bandwidth %d Hz not supported.\n",
+ c->bandwidth_hz);
return -EINVAL;
}
- dprintk("%s() frequency=%d\n", __func__, priv->frequency);
+ dprintk("%s() frequency=%d\n", __func__, c->frequency);
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1);
- max2165_set_bandwidth(priv, priv->bandwidth);
+ max2165_set_bandwidth(priv, c->bandwidth_hz);
ret = max2165_set_rf(priv, priv->frequency);
mdelay(50);
max2165_debug_status(priv);
@@ -370,7 +360,7 @@ static int max2165_init(struct dvb_frontend *fe)
max2165_read_rom_table(priv);
- max2165_set_bandwidth(priv, BANDWIDTH_8_MHZ);
+ max2165_set_bandwidth(priv, 8000000);
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0);
--
1.7.8.352.g876a6
^ permalink raw reply related [flat|nested] 51+ messages in thread
* [PATCH v4 08/47] [media] mt2266: use DVBv5 parameters for set_params()
2011-12-24 15:50 ` [PATCH v4 07/47] [media] max2165: " Mauro Carvalho Chehab
@ 2011-12-24 15:50 ` Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 09/47] [media] mxl5005s: use DVBv5 parameters on set_params() Mauro Carvalho Chehab
0 siblings, 1 reply; 51+ messages in thread
From: Mauro Carvalho Chehab @ 2011-12-24 15:50 UTC (permalink / raw)
Cc: Mauro Carvalho Chehab, Linux Media Mailing List
Instead of using DVBv3 parameters, rely on DVBv5 parameters to
set the tuner.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
drivers/media/common/tuners/mt2266.c | 25 ++++++++++++++-----------
1 files changed, 14 insertions(+), 11 deletions(-)
diff --git a/drivers/media/common/tuners/mt2266.c b/drivers/media/common/tuners/mt2266.c
index 25a8ea3..dd883d7 100644
--- a/drivers/media/common/tuners/mt2266.c
+++ b/drivers/media/common/tuners/mt2266.c
@@ -124,6 +124,7 @@ static u8 mt2266_vhf[] = { 0x1d, 0xfe, 0x00, 0x00, 0xb4, 0x03, 0xa5, 0xa5,
static int mt2266_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
{
+ struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct mt2266_priv *priv;
int ret=0;
u32 freq;
@@ -135,30 +136,32 @@ static int mt2266_set_params(struct dvb_frontend *fe, struct dvb_frontend_parame
priv = fe->tuner_priv;
- freq = params->frequency / 1000; // Hz -> kHz
+ freq = priv->frequency / 1000; /* Hz -> kHz */
if (freq < 470000 && freq > 230000)
return -EINVAL; /* Gap between VHF and UHF bands */
- priv->bandwidth = (fe->ops.info.type == FE_OFDM) ? params->u.ofdm.bandwidth : 0;
- priv->frequency = freq * 1000;
+ priv->frequency = c->frequency;
tune = 2 * freq * (8192/16) / (FREF/16);
band = (freq < 300000) ? MT2266_VHF : MT2266_UHF;
if (band == MT2266_VHF)
tune *= 2;
- switch (params->u.ofdm.bandwidth) {
- case BANDWIDTH_6_MHZ:
+ switch (c->bandwidth_hz) {
+ case 6000000:
mt2266_writeregs(priv, mt2266_init_6mhz,
sizeof(mt2266_init_6mhz));
+ priv->bandwidth = BANDWIDTH_6_MHZ;
break;
- case BANDWIDTH_7_MHZ:
- mt2266_writeregs(priv, mt2266_init_7mhz,
- sizeof(mt2266_init_7mhz));
- break;
- case BANDWIDTH_8_MHZ:
- default:
+ case 8000000:
mt2266_writeregs(priv, mt2266_init_8mhz,
sizeof(mt2266_init_8mhz));
+ priv->bandwidth = BANDWIDTH_8_MHZ;
+ break;
+ case 7000000:
+ default:
+ mt2266_writeregs(priv, mt2266_init_7mhz,
+ sizeof(mt2266_init_7mhz));
+ priv->bandwidth = BANDWIDTH_7_MHZ;
break;
}
--
1.7.8.352.g876a6
^ permalink raw reply related [flat|nested] 51+ messages in thread
* [PATCH v4 09/47] [media] mxl5005s: use DVBv5 parameters on set_params()
2011-12-24 15:50 ` [PATCH v4 08/47] [media] mt2266: use DVBv5 parameters for set_params() Mauro Carvalho Chehab
@ 2011-12-24 15:50 ` Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 10/47] [media] mxl5005s: fix: don't discard bandwidth changes Mauro Carvalho Chehab
0 siblings, 1 reply; 51+ messages in thread
From: Mauro Carvalho Chehab @ 2011-12-24 15:50 UTC (permalink / raw)
Cc: Mauro Carvalho Chehab, Linux Media Mailing List
Instead of using DVBv3 parameters, rely on DVBv5 parameters to
set the tuner.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
drivers/media/common/tuners/mxl5005s.c | 65 ++++++++++++++-----------------
1 files changed, 29 insertions(+), 36 deletions(-)
diff --git a/drivers/media/common/tuners/mxl5005s.c b/drivers/media/common/tuners/mxl5005s.c
index 54be9e6..c63f767 100644
--- a/drivers/media/common/tuners/mxl5005s.c
+++ b/drivers/media/common/tuners/mxl5005s.c
@@ -3983,50 +3983,43 @@ static int mxl5005s_set_params(struct dvb_frontend *fe,
struct dvb_frontend_parameters *params)
{
struct mxl5005s_state *state = fe->tuner_priv;
+ struct dtv_frontend_properties *c = &fe->dtv_property_cache;
+ u32 delsys = c->delivery_system;
+ u32 bw = c->bandwidth_hz;
u32 req_mode, req_bw = 0;
int ret;
dprintk(1, "%s()\n", __func__);
- if (fe->ops.info.type == FE_ATSC) {
- switch (params->u.vsb.modulation) {
- case VSB_8:
- req_mode = MXL_ATSC; break;
- default:
- case QAM_64:
- case QAM_256:
- case QAM_AUTO:
- req_mode = MXL_QAM; break;
- }
- } else
+ switch (delsys) {
+ case SYS_ATSC:
+ req_mode = MXL_ATSC;
+ req_bw = MXL5005S_BANDWIDTH_6MHZ;
+ break;
+ case SYS_DVBC_ANNEX_B:
+ req_mode = MXL_QAM;
+ req_bw = MXL5005S_BANDWIDTH_6MHZ;
+ break;
+ default: /* Assume DVB-T */
req_mode = MXL_DVBT;
-
- /* Change tuner for new modulation type if reqd */
- if (req_mode != state->current_mode) {
- switch (req_mode) {
- case MXL_ATSC:
- case MXL_QAM:
- req_bw = MXL5005S_BANDWIDTH_6MHZ;
+ switch (bw) {
+ case 6000000:
+ req_bw = MXL5005S_BANDWIDTH_6MHZ;
+ break;
+ case 7000000:
+ req_bw = MXL5005S_BANDWIDTH_7MHZ;
+ break;
+ case 8000000:
+ case 0:
+ req_bw = MXL5005S_BANDWIDTH_8MHZ;
break;
- case MXL_DVBT:
default:
- /* Assume DVB-T */
- switch (params->u.ofdm.bandwidth) {
- case BANDWIDTH_6_MHZ:
- req_bw = MXL5005S_BANDWIDTH_6MHZ;
- break;
- case BANDWIDTH_7_MHZ:
- req_bw = MXL5005S_BANDWIDTH_7MHZ;
- break;
- case BANDWIDTH_AUTO:
- case BANDWIDTH_8_MHZ:
- req_bw = MXL5005S_BANDWIDTH_8MHZ;
- break;
- default:
- return -EINVAL;
- }
+ return -EINVAL;
}
+ }
+ /* Change tuner for new modulation type if reqd */
+ if (req_mode != state->current_mode) {
state->current_mode = req_mode;
ret = mxl5005s_reconfigure(fe, req_mode, req_bw);
@@ -4034,8 +4027,8 @@ static int mxl5005s_set_params(struct dvb_frontend *fe,
ret = 0;
if (ret == 0) {
- dprintk(1, "%s() freq=%d\n", __func__, params->frequency);
- ret = mxl5005s_SetRfFreqHz(fe, params->frequency);
+ dprintk(1, "%s() freq=%d\n", __func__, c->frequency);
+ ret = mxl5005s_SetRfFreqHz(fe, c->frequency);
}
return ret;
--
1.7.8.352.g876a6
^ permalink raw reply related [flat|nested] 51+ messages in thread
* [PATCH v4 10/47] [media] mxl5005s: fix: don't discard bandwidth changes
2011-12-24 15:50 ` [PATCH v4 09/47] [media] mxl5005s: use DVBv5 parameters on set_params() Mauro Carvalho Chehab
@ 2011-12-24 15:50 ` Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 11/47] [media] mxl5007t: use DVBv5 parameters on set_params() Mauro Carvalho Chehab
0 siblings, 1 reply; 51+ messages in thread
From: Mauro Carvalho Chehab @ 2011-12-24 15:50 UTC (permalink / raw)
Cc: Mauro Carvalho Chehab, Linux Media Mailing List
There is a bug on mxl5005s logic: when the bandwidth changes, but using
the same delivery system, the code discard the set_params()
reconfiguration request.
This was happening because, in the previous coding, the bandwidth
calculus were after the check for delivery system changes.
The previous patch changed the logic to estimate the bandwidth to
happend together with the changes at the delivery system.
So, with a one-statement change, it is possible to make the tuner to
reconfigure, in order to adjust to bandwidth changes. this will
likely fix issues on countries that use 7MHz/8MHz DVB-T channels.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
drivers/media/common/tuners/mxl5005s.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/media/common/tuners/mxl5005s.c b/drivers/media/common/tuners/mxl5005s.c
index c63f767..c35d355 100644
--- a/drivers/media/common/tuners/mxl5005s.c
+++ b/drivers/media/common/tuners/mxl5005s.c
@@ -4019,7 +4019,8 @@ static int mxl5005s_set_params(struct dvb_frontend *fe,
}
/* Change tuner for new modulation type if reqd */
- if (req_mode != state->current_mode) {
+ if (req_mode != state->current_mode ||
+ req_bw != state->Chan_Bandwidth) {
state->current_mode = req_mode;
ret = mxl5005s_reconfigure(fe, req_mode, req_bw);
--
1.7.8.352.g876a6
^ permalink raw reply related [flat|nested] 51+ messages in thread
* [PATCH v4 11/47] [media] mxl5007t: use DVBv5 parameters on set_params()
2011-12-24 15:50 ` [PATCH v4 10/47] [media] mxl5005s: fix: don't discard bandwidth changes Mauro Carvalho Chehab
@ 2011-12-24 15:50 ` Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 12/47] [media] tda18218: " Mauro Carvalho Chehab
0 siblings, 1 reply; 51+ messages in thread
From: Mauro Carvalho Chehab @ 2011-12-24 15:50 UTC (permalink / raw)
Cc: Mauro Carvalho Chehab, Linux Media Mailing List
Instead of using DVBv3 parameters, rely on DVBv5 parameters to
set the tuner.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
drivers/media/common/tuners/mxl5007t.c | 51 +++++++++++++++-----------------
1 files changed, 24 insertions(+), 27 deletions(-)
diff --git a/drivers/media/common/tuners/mxl5007t.c b/drivers/media/common/tuners/mxl5007t.c
index 2f0e550..6c45993 100644
--- a/drivers/media/common/tuners/mxl5007t.c
+++ b/drivers/media/common/tuners/mxl5007t.c
@@ -618,44 +618,42 @@ fail:
static int mxl5007t_set_params(struct dvb_frontend *fe,
struct dvb_frontend_parameters *params)
{
+ struct dtv_frontend_properties *c = &fe->dtv_property_cache;
+ u32 delsys = c->delivery_system;
struct mxl5007t_state *state = fe->tuner_priv;
enum mxl5007t_bw_mhz bw;
enum mxl5007t_mode mode;
int ret;
- u32 freq = params->frequency;
+ u32 freq = c->frequency;
+ u32 band = BANDWIDTH_6_MHZ;
- if (fe->ops.info.type == FE_ATSC) {
- switch (params->u.vsb.modulation) {
- case VSB_8:
- case VSB_16:
- mode = MxL_MODE_ATSC;
- break;
- case QAM_64:
- case QAM_256:
- mode = MxL_MODE_CABLE;
- break;
- default:
- mxl_err("modulation not set!");
- return -EINVAL;
- }
+ switch (delsys) {
+ case SYS_ATSC:
+ mode = MxL_MODE_ATSC;
+ bw = MxL_BW_6MHz;
+ break;
+ case SYS_DVBC_ANNEX_B:
+ mode = MxL_MODE_CABLE;
bw = MxL_BW_6MHz;
- } else if (fe->ops.info.type == FE_OFDM) {
- switch (params->u.ofdm.bandwidth) {
- case BANDWIDTH_6_MHZ:
+ break;
+ case SYS_DVBT:
+ case SYS_DVBT2:
+ mode = MxL_MODE_DVBT;
+ switch (c->bandwidth_hz) {
+ case 6000000:
bw = MxL_BW_6MHz;
break;
- case BANDWIDTH_7_MHZ:
+ case 7000000:
bw = MxL_BW_7MHz;
- break;
- case BANDWIDTH_8_MHZ:
+ band = BANDWIDTH_7_MHZ;
+ case 8000000:
bw = MxL_BW_8MHz;
- break;
+ band = BANDWIDTH_8_MHZ;
default:
- mxl_err("bandwidth not set!");
return -EINVAL;
}
- mode = MxL_MODE_DVBT;
- } else {
+ break;
+ default:
mxl_err("modulation type not supported!");
return -EINVAL;
}
@@ -674,8 +672,7 @@ static int mxl5007t_set_params(struct dvb_frontend *fe,
goto fail;
state->frequency = freq;
- state->bandwidth = (fe->ops.info.type == FE_OFDM) ?
- params->u.ofdm.bandwidth : 0;
+ state->bandwidth = band;
fail:
mutex_unlock(&state->lock);
--
1.7.8.352.g876a6
^ permalink raw reply related [flat|nested] 51+ messages in thread
* [PATCH v4 12/47] [media] tda18218: use DVBv5 parameters on set_params()
2011-12-24 15:50 ` [PATCH v4 11/47] [media] mxl5007t: use DVBv5 parameters on set_params() Mauro Carvalho Chehab
@ 2011-12-24 15:50 ` Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 13/47] [media] tda18271: add support for QAM 7 MHz map Mauro Carvalho Chehab
0 siblings, 1 reply; 51+ messages in thread
From: Mauro Carvalho Chehab @ 2011-12-24 15:50 UTC (permalink / raw)
Cc: Mauro Carvalho Chehab, Linux Media Mailing List
Instead of using DVBv3 parameters, rely on DVBv5 parameters to
set the tuner.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
drivers/media/common/tuners/tda18218.c | 15 ++++++---------
1 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/drivers/media/common/tuners/tda18218.c b/drivers/media/common/tuners/tda18218.c
index 1c86595..bbed0cf 100644
--- a/drivers/media/common/tuners/tda18218.c
+++ b/drivers/media/common/tuners/tda18218.c
@@ -113,6 +113,8 @@ static int tda18218_set_params(struct dvb_frontend *fe,
struct dvb_frontend_parameters *params)
{
struct tda18218_priv *priv = fe->tuner_priv;
+ struct dtv_frontend_properties *c = &fe->dtv_property_cache;
+ u32 bw = c->bandwidth_hz;
int ret;
u8 buf[3], i, BP_Filter, LP_Fc;
u32 LO_Frac;
@@ -138,23 +140,18 @@ static int tda18218_set_params(struct dvb_frontend *fe,
fe->ops.i2c_gate_ctrl(fe, 1); /* open I2C-gate */
/* low-pass filter cut-off frequency */
- switch (params->u.ofdm.bandwidth) {
- case BANDWIDTH_6_MHZ:
+ if (bw <= 6000000) {
LP_Fc = 0;
priv->if_frequency = 4000000;
- break;
- case BANDWIDTH_7_MHZ:
+ } else if (bw <= 7000000) {
LP_Fc = 1;
priv->if_frequency = 3500000;
- break;
- case BANDWIDTH_8_MHZ:
- default:
+ } else {
LP_Fc = 2;
priv->if_frequency = 4000000;
- break;
}
- LO_Frac = params->frequency + priv->if_frequency;
+ LO_Frac = c->frequency + priv->if_frequency;
/* band-pass filter */
if (LO_Frac < 188000000)
--
1.7.8.352.g876a6
^ permalink raw reply related [flat|nested] 51+ messages in thread
* [PATCH v4 13/47] [media] tda18271: add support for QAM 7 MHz map
2011-12-24 15:50 ` [PATCH v4 12/47] [media] tda18218: " Mauro Carvalho Chehab
@ 2011-12-24 15:50 ` Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 14/47] [media] tda18271-fe: use DVBv5 parameters on set_params() Mauro Carvalho Chehab
0 siblings, 1 reply; 51+ messages in thread
From: Mauro Carvalho Chehab @ 2011-12-24 15:50 UTC (permalink / raw)
Cc: Mauro Carvalho Chehab, Linux Media Mailing List
This standard is not properly documented, but its settings are at
the tda18271dd driver, and are somewhat obvious, as they follow
the same logic as DVB-T 7MHz.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
drivers/media/common/tuners/tda18271-maps.c | 4 ++++
drivers/media/common/tuners/tda18271.h | 1 +
2 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/drivers/media/common/tuners/tda18271-maps.c b/drivers/media/common/tuners/tda18271-maps.c
index 3d5b6ab..fb881c6 100644
--- a/drivers/media/common/tuners/tda18271-maps.c
+++ b/drivers/media/common/tuners/tda18271-maps.c
@@ -1213,6 +1213,8 @@ static struct tda18271_std_map tda18271c1_std_map = {
.if_lvl = 1, .rfagc_top = 0x37, }, /* EP3[4:0] 0x1e */
.qam_6 = { .if_freq = 4000, .fm_rfn = 0, .agc_mode = 3, .std = 5,
.if_lvl = 1, .rfagc_top = 0x37, }, /* EP3[4:0] 0x1d */
+ .qam_7 = { .if_freq = 4500, .fm_rfn = 0, .agc_mode = 3, .std = 6,
+ .if_lvl = 1, .rfagc_top = 0x37, }, /* EP3[4:0] 0x1e */
.qam_8 = { .if_freq = 5000, .fm_rfn = 0, .agc_mode = 3, .std = 7,
.if_lvl = 1, .rfagc_top = 0x37, }, /* EP3[4:0] 0x1f */
};
@@ -1244,6 +1246,8 @@ static struct tda18271_std_map tda18271c2_std_map = {
.if_lvl = 1, .rfagc_top = 0x37, }, /* EP3[4:0] 0x1d */
.qam_6 = { .if_freq = 4000, .fm_rfn = 0, .agc_mode = 3, .std = 5,
.if_lvl = 1, .rfagc_top = 0x37, }, /* EP3[4:0] 0x1d */
+ .qam_7 = { .if_freq = 4500, .fm_rfn = 0, .agc_mode = 3, .std = 6,
+ .if_lvl = 1, .rfagc_top = 0x37, }, /* EP3[4:0] 0x1e */
.qam_8 = { .if_freq = 5000, .fm_rfn = 0, .agc_mode = 3, .std = 7,
.if_lvl = 1, .rfagc_top = 0x37, }, /* EP3[4:0] 0x1f */
};
diff --git a/drivers/media/common/tuners/tda18271.h b/drivers/media/common/tuners/tda18271.h
index 50cfa8c..640bae4 100644
--- a/drivers/media/common/tuners/tda18271.h
+++ b/drivers/media/common/tuners/tda18271.h
@@ -53,6 +53,7 @@ struct tda18271_std_map {
struct tda18271_std_map_item dvbt_7;
struct tda18271_std_map_item dvbt_8;
struct tda18271_std_map_item qam_6;
+ struct tda18271_std_map_item qam_7;
struct tda18271_std_map_item qam_8;
};
--
1.7.8.352.g876a6
^ permalink raw reply related [flat|nested] 51+ messages in thread
* [PATCH v4 14/47] [media] tda18271-fe: use DVBv5 parameters on set_params()
2011-12-24 15:50 ` [PATCH v4 13/47] [media] tda18271: add support for QAM 7 MHz map Mauro Carvalho Chehab
@ 2011-12-24 15:50 ` Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 15/47] [media] tda827x: " Mauro Carvalho Chehab
0 siblings, 1 reply; 51+ messages in thread
From: Mauro Carvalho Chehab @ 2011-12-24 15:50 UTC (permalink / raw)
Cc: Mauro Carvalho Chehab, Linux Media Mailing List
Instead of using DVBv3 parameters, rely on DVBv5 parameters to
set the tuner.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
drivers/media/common/tuners/tda18271-fe.c | 74 +++++++++++++---------------
1 files changed, 34 insertions(+), 40 deletions(-)
diff --git a/drivers/media/common/tuners/tda18271-fe.c b/drivers/media/common/tuners/tda18271-fe.c
index 3347c5b..6348bb3 100644
--- a/drivers/media/common/tuners/tda18271-fe.c
+++ b/drivers/media/common/tuners/tda18271-fe.c
@@ -931,56 +931,51 @@ fail:
static int tda18271_set_params(struct dvb_frontend *fe,
struct dvb_frontend_parameters *params)
{
+ struct dtv_frontend_properties *c = &fe->dtv_property_cache;
+ u32 delsys = c->delivery_system;
+ u32 bw = c->bandwidth_hz;
+ u32 freq = c->frequency;
+ u32 band = BANDWIDTH_6_MHZ;
struct tda18271_priv *priv = fe->tuner_priv;
struct tda18271_std_map *std_map = &priv->std;
struct tda18271_std_map_item *map;
int ret;
- u32 bw, freq = params->frequency;
priv->mode = TDA18271_DIGITAL;
- if (fe->ops.info.type == FE_ATSC) {
- switch (params->u.vsb.modulation) {
- case VSB_8:
- case VSB_16:
- map = &std_map->atsc_6;
- break;
- case QAM_64:
- case QAM_256:
- map = &std_map->qam_6;
- break;
- default:
- tda_warn("modulation not set!\n");
- return -EINVAL;
- }
-#if 0
- /* userspace request is already center adjusted */
- freq += 1750000; /* Adjust to center (+1.75MHZ) */
-#endif
+ switch (delsys) {
+ case SYS_ATSC:
+ map = &std_map->atsc_6;
bw = 6000000;
- } else if (fe->ops.info.type == FE_OFDM) {
- switch (params->u.ofdm.bandwidth) {
- case BANDWIDTH_6_MHZ:
- bw = 6000000;
+ break;
+ case SYS_DVBT:
+ case SYS_DVBT2:
+ if (bw <= 6000000) {
map = &std_map->dvbt_6;
- break;
- case BANDWIDTH_7_MHZ:
- bw = 7000000;
+ } else if (bw <= 7000000) {
map = &std_map->dvbt_7;
- break;
- case BANDWIDTH_8_MHZ:
- bw = 8000000;
+ band = BANDWIDTH_7_MHZ;
+ } else {
map = &std_map->dvbt_8;
- break;
- default:
- tda_warn("bandwidth not set!\n");
- return -EINVAL;
+ band = BANDWIDTH_8_MHZ;
}
- } else if (fe->ops.info.type == FE_QAM) {
- /* DVB-C */
- map = &std_map->qam_8;
- bw = 8000000;
- } else {
+ break;
+ case SYS_DVBC_ANNEX_B:
+ bw = 6000000;
+ /* falltrough */
+ case SYS_DVBC_ANNEX_A:
+ case SYS_DVBC_ANNEX_C:
+ if (bw <= 6000000) {
+ map = &std_map->qam_6;
+ } else if (bw <= 7000000) {
+ map = &std_map->qam_7;
+ band = BANDWIDTH_7_MHZ;
+ } else {
+ map = &std_map->qam_8;
+ band = BANDWIDTH_8_MHZ;
+ }
+ break;
+ default:
tda_warn("modulation type not supported!\n");
return -EINVAL;
}
@@ -996,8 +991,7 @@ static int tda18271_set_params(struct dvb_frontend *fe,
priv->if_freq = map->if_freq;
priv->frequency = freq;
- priv->bandwidth = (fe->ops.info.type == FE_OFDM) ?
- params->u.ofdm.bandwidth : 0;
+ priv->bandwidth = band;
fail:
return ret;
}
--
1.7.8.352.g876a6
^ permalink raw reply related [flat|nested] 51+ messages in thread
* [PATCH v4 15/47] [media] tda827x: use DVBv5 parameters on set_params()
2011-12-24 15:50 ` [PATCH v4 14/47] [media] tda18271-fe: use DVBv5 parameters on set_params() Mauro Carvalho Chehab
@ 2011-12-24 15:50 ` Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 16/47] [media] tuner-xc2028: " Mauro Carvalho Chehab
0 siblings, 1 reply; 51+ messages in thread
From: Mauro Carvalho Chehab @ 2011-12-24 15:50 UTC (permalink / raw)
Cc: Mauro Carvalho Chehab, Linux Media Mailing List
Instead of using DVBv3 parameters, rely on DVBv5 parameters to
set the tuner.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
drivers/media/common/tuners/tda827x.c | 49 +++++++++++++++++++--------------
1 files changed, 28 insertions(+), 21 deletions(-)
diff --git a/drivers/media/common/tuners/tda827x.c b/drivers/media/common/tuners/tda827x.c
index e0d5b43..7316308 100644
--- a/drivers/media/common/tuners/tda827x.c
+++ b/drivers/media/common/tuners/tda827x.c
@@ -155,9 +155,11 @@ static int tuner_transfer(struct dvb_frontend *fe,
static int tda827xo_set_params(struct dvb_frontend *fe,
struct dvb_frontend_parameters *params)
{
+ struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct tda827x_priv *priv = fe->tuner_priv;
u8 buf[14];
int rc;
+ u32 band;
struct i2c_msg msg = { .addr = priv->i2c_addr, .flags = 0,
.buf = buf, .len = sizeof(buf) };
@@ -165,18 +167,20 @@ static int tda827xo_set_params(struct dvb_frontend *fe,
u32 N;
dprintk("%s:\n", __func__);
- switch (params->u.ofdm.bandwidth) {
- case BANDWIDTH_6_MHZ:
+ if (c->bandwidth_hz == 0) {
+ if_freq = 5000000;
+ band = BANDWIDTH_8_MHZ;
+ } else if (c->bandwidth_hz <= 6000000) {
if_freq = 4000000;
- break;
- case BANDWIDTH_7_MHZ:
+ band = BANDWIDTH_6_MHZ;
+ } else if (c->bandwidth_hz <= 7000000) {
if_freq = 4500000;
- break;
- default: /* 8 MHz or Auto */
+ band = BANDWIDTH_7_MHZ;
+ } else { /* 8 MHz */
if_freq = 5000000;
- break;
+ band = BANDWIDTH_8_MHZ;
}
- tuner_freq = params->frequency;
+ tuner_freq = c->frequency;
i = 0;
while (tda827x_table[i].lomax < tuner_freq) {
@@ -220,8 +224,8 @@ static int tda827xo_set_params(struct dvb_frontend *fe,
if (rc < 0)
goto err;
- priv->frequency = params->frequency;
- priv->bandwidth = (fe->ops.info.type == FE_OFDM) ? params->u.ofdm.bandwidth : 0;
+ priv->frequency = c->frequency;
+ priv->bandwidth = band;
return 0;
@@ -516,9 +520,11 @@ static void tda827xa_lna_gain(struct dvb_frontend *fe, int high,
static int tda827xa_set_params(struct dvb_frontend *fe,
struct dvb_frontend_parameters *params)
{
+ struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct tda827x_priv *priv = fe->tuner_priv;
struct tda827xa_data *frequency_map = tda827xa_dvbt;
u8 buf[11];
+ u32 band;
struct i2c_msg msg = { .addr = priv->i2c_addr, .flags = 0,
.buf = buf, .len = sizeof(buf) };
@@ -531,18 +537,20 @@ static int tda827xa_set_params(struct dvb_frontend *fe,
tda827xa_lna_gain(fe, 1, NULL);
msleep(20);
- switch (params->u.ofdm.bandwidth) {
- case BANDWIDTH_6_MHZ:
+ if (c->bandwidth_hz == 0) {
+ if_freq = 5000000;
+ band = BANDWIDTH_8_MHZ;
+ } else if (c->bandwidth_hz <= 6000000) {
if_freq = 4000000;
- break;
- case BANDWIDTH_7_MHZ:
+ band = BANDWIDTH_6_MHZ;
+ } else if (c->bandwidth_hz <= 7000000) {
if_freq = 4500000;
- break;
- default: /* 8 MHz or Auto */
+ band = BANDWIDTH_7_MHZ;
+ } else { /* 8 MHz */
if_freq = 5000000;
- break;
+ band = BANDWIDTH_8_MHZ;
}
- tuner_freq = params->frequency;
+ tuner_freq = c->frequency;
if (fe->ops.info.type == FE_QAM) {
dprintk("%s select tda827xa_dvbc\n", __func__);
@@ -645,9 +653,8 @@ static int tda827xa_set_params(struct dvb_frontend *fe,
if (rc < 0)
goto err;
- priv->frequency = params->frequency;
- priv->bandwidth = (fe->ops.info.type == FE_OFDM) ? params->u.ofdm.bandwidth : 0;
-
+ priv->frequency = c->frequency;
+ priv->bandwidth = band;
return 0;
--
1.7.8.352.g876a6
^ permalink raw reply related [flat|nested] 51+ messages in thread
* [PATCH v4 16/47] [media] tuner-xc2028: use DVBv5 parameters on set_params()
2011-12-24 15:50 ` [PATCH v4 15/47] [media] tda827x: " Mauro Carvalho Chehab
@ 2011-12-24 15:50 ` Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 17/47] [media] xc4000: " Mauro Carvalho Chehab
2012-01-02 19:32 ` [PATCH v4 16/47] [media] tuner-xc2028: use DVBv5 parameters on set_params() Gianluca Gennari
0 siblings, 2 replies; 51+ messages in thread
From: Mauro Carvalho Chehab @ 2011-12-24 15:50 UTC (permalink / raw)
Cc: Mauro Carvalho Chehab, Linux Media Mailing List
Instead of using DVBv3 parameters, rely on DVBv5 parameters to
set the tuner.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
drivers/media/common/tuners/tuner-xc2028.c | 83 ++++++++++++----------------
1 files changed, 36 insertions(+), 47 deletions(-)
diff --git a/drivers/media/common/tuners/tuner-xc2028.c b/drivers/media/common/tuners/tuner-xc2028.c
index e531267..8c0dc6a1 100644
--- a/drivers/media/common/tuners/tuner-xc2028.c
+++ b/drivers/media/common/tuners/tuner-xc2028.c
@@ -1087,65 +1087,26 @@ static int xc2028_set_analog_freq(struct dvb_frontend *fe,
static int xc2028_set_params(struct dvb_frontend *fe,
struct dvb_frontend_parameters *p)
{
+ struct dtv_frontend_properties *c = &fe->dtv_property_cache;
+ u32 delsys = c->delivery_system;
+ u32 bw = c->bandwidth_hz;
struct xc2028_data *priv = fe->tuner_priv;
unsigned int type=0;
- fe_bandwidth_t bw = BANDWIDTH_8_MHZ;
u16 demod = 0;
tuner_dbg("%s called\n", __func__);
- switch(fe->ops.info.type) {
- case FE_OFDM:
- bw = p->u.ofdm.bandwidth;
+ switch (delsys) {
+ case SYS_DVBT:
+ case SYS_DVBT2:
/*
* The only countries with 6MHz seem to be Taiwan/Uruguay.
* Both seem to require QAM firmware for OFDM decoding
* Tested in Taiwan by Terry Wu <terrywu2009@gmail.com>
*/
- if (bw == BANDWIDTH_6_MHZ)
+ if (bw <= 6000000)
type |= QAM;
- break;
- case FE_ATSC:
- bw = BANDWIDTH_6_MHZ;
- /* The only ATSC firmware (at least on v2.7) is D2633 */
- type |= ATSC | D2633;
- break;
- /* DVB-S and pure QAM (FE_QAM) are not supported */
- default:
- return -EINVAL;
- }
-
- switch (bw) {
- case BANDWIDTH_8_MHZ:
- if (p->frequency < 470000000)
- priv->ctrl.vhfbw7 = 0;
- else
- priv->ctrl.uhfbw8 = 1;
- type |= (priv->ctrl.vhfbw7 && priv->ctrl.uhfbw8) ? DTV78 : DTV8;
- type |= F8MHZ;
- break;
- case BANDWIDTH_7_MHZ:
- if (p->frequency < 470000000)
- priv->ctrl.vhfbw7 = 1;
- else
- priv->ctrl.uhfbw8 = 0;
- type |= (priv->ctrl.vhfbw7 && priv->ctrl.uhfbw8) ? DTV78 : DTV7;
- type |= F8MHZ;
- break;
- case BANDWIDTH_6_MHZ:
- type |= DTV6;
- priv->ctrl.vhfbw7 = 0;
- priv->ctrl.uhfbw8 = 0;
- break;
- default:
- tuner_err("error: bandwidth not supported.\n");
- };
- /*
- Selects between D2633 or D2620 firmware.
- It doesn't make sense for ATSC, since it should be D2633 on all cases
- */
- if (fe->ops.info.type != FE_ATSC) {
switch (priv->ctrl.type) {
case XC2028_D2633:
type |= D2633;
@@ -1161,6 +1122,34 @@ static int xc2028_set_params(struct dvb_frontend *fe,
else
type |= D2620;
}
+ break;
+ case SYS_ATSC:
+ /* The only ATSC firmware (at least on v2.7) is D2633 */
+ type |= ATSC | D2633;
+ break;
+ /* DVB-S and pure QAM (FE_QAM) are not supported */
+ default:
+ return -EINVAL;
+ }
+
+ if (bw <= 6000000) {
+ type |= DTV6;
+ priv->ctrl.vhfbw7 = 0;
+ priv->ctrl.uhfbw8 = 0;
+ } else if (bw <= 7000000) {
+ if (c->frequency < 470000000)
+ priv->ctrl.vhfbw7 = 1;
+ else
+ priv->ctrl.uhfbw8 = 0;
+ type |= (priv->ctrl.vhfbw7 && priv->ctrl.uhfbw8) ? DTV78 : DTV7;
+ type |= F8MHZ;
+ } else {
+ if (c->frequency < 470000000)
+ priv->ctrl.vhfbw7 = 0;
+ else
+ priv->ctrl.uhfbw8 = 1;
+ type |= (priv->ctrl.vhfbw7 && priv->ctrl.uhfbw8) ? DTV78 : DTV8;
+ type |= F8MHZ;
}
/* All S-code tables need a 200kHz shift */
@@ -1185,7 +1174,7 @@ static int xc2028_set_params(struct dvb_frontend *fe,
*/
}
- return generic_set_freq(fe, p->frequency,
+ return generic_set_freq(fe, c->frequency,
V4L2_TUNER_DIGITAL_TV, type, 0, demod);
}
--
1.7.8.352.g876a6
^ permalink raw reply related [flat|nested] 51+ messages in thread
* [PATCH v4 17/47] [media] xc4000: use DVBv5 parameters on set_params()
2011-12-24 15:50 ` [PATCH v4 16/47] [media] tuner-xc2028: " Mauro Carvalho Chehab
@ 2011-12-24 15:50 ` Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 18/47] [media] cx24113: " Mauro Carvalho Chehab
2012-01-02 19:32 ` [PATCH v4 16/47] [media] tuner-xc2028: use DVBv5 parameters on set_params() Gianluca Gennari
1 sibling, 1 reply; 51+ messages in thread
From: Mauro Carvalho Chehab @ 2011-12-24 15:50 UTC (permalink / raw)
Cc: Mauro Carvalho Chehab, Linux Media Mailing List
Instead of using DVBv3 parameters, rely on DVBv5 parameters to
set the tuner.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
drivers/media/common/tuners/xc4000.c | 97 +++++++++++++++-------------------
1 files changed, 42 insertions(+), 55 deletions(-)
diff --git a/drivers/media/common/tuners/xc4000.c b/drivers/media/common/tuners/xc4000.c
index 634f4d9..e6acc7a 100644
--- a/drivers/media/common/tuners/xc4000.c
+++ b/drivers/media/common/tuners/xc4000.c
@@ -1124,80 +1124,67 @@ static void xc_debug_dump(struct xc4000_priv *priv)
static int xc4000_set_params(struct dvb_frontend *fe,
struct dvb_frontend_parameters *params)
{
+ struct dtv_frontend_properties *c = &fe->dtv_property_cache;
+ u32 delsys = c->delivery_system;
+ u32 bw = c->bandwidth_hz;
struct xc4000_priv *priv = fe->tuner_priv;
unsigned int type;
int ret = -EREMOTEIO;
- dprintk(1, "%s() frequency=%d (Hz)\n", __func__, params->frequency);
+ dprintk(1, "%s() frequency=%d (Hz)\n", __func__, c->frequency);
mutex_lock(&priv->lock);
- if (fe->ops.info.type == FE_ATSC) {
- dprintk(1, "%s() ATSC\n", __func__);
- switch (params->u.vsb.modulation) {
- case VSB_8:
- case VSB_16:
- dprintk(1, "%s() VSB modulation\n", __func__);
- priv->rf_mode = XC_RF_MODE_AIR;
- priv->freq_hz = params->frequency - 1750000;
- priv->bandwidth = BANDWIDTH_6_MHZ;
- priv->video_standard = XC4000_DTV6;
- type = DTV6;
- break;
- case QAM_64:
- case QAM_256:
- case QAM_AUTO:
- dprintk(1, "%s() QAM modulation\n", __func__);
- priv->rf_mode = XC_RF_MODE_CABLE;
- priv->freq_hz = params->frequency - 1750000;
- priv->bandwidth = BANDWIDTH_6_MHZ;
- priv->video_standard = XC4000_DTV6;
- type = DTV6;
- break;
- default:
- ret = -EINVAL;
- goto fail;
- }
- } else if (fe->ops.info.type == FE_OFDM) {
+ switch (delsys) {
+ case SYS_ATSC:
+ dprintk(1, "%s() VSB modulation\n", __func__);
+ priv->rf_mode = XC_RF_MODE_AIR;
+ priv->freq_hz = c->frequency - 1750000;
+ priv->bandwidth = BANDWIDTH_6_MHZ;
+ priv->video_standard = XC4000_DTV6;
+ type = DTV6;
+ break;
+ case SYS_DVBC_ANNEX_B:
+ dprintk(1, "%s() QAM modulation\n", __func__);
+ priv->rf_mode = XC_RF_MODE_CABLE;
+ priv->freq_hz = c->frequency - 1750000;
+ priv->bandwidth = BANDWIDTH_6_MHZ;
+ priv->video_standard = XC4000_DTV6;
+ type = DTV6;
+ break;
+ case SYS_DVBT:
+ case SYS_DVBT2:
dprintk(1, "%s() OFDM\n", __func__);
- switch (params->u.ofdm.bandwidth) {
- case BANDWIDTH_6_MHZ:
+ if (bw == 0) {
+ if (c->frequency < 400000000) {
+ priv->bandwidth = BANDWIDTH_7_MHZ;
+ priv->freq_hz = c->frequency - 2250000;
+ } else {
+ priv->bandwidth = BANDWIDTH_8_MHZ;
+ priv->freq_hz = c->frequency - 2750000;
+ }
+ priv->video_standard = XC4000_DTV7_8;
+ type = DTV78;
+ } else if (bw <= 6000000) {
priv->bandwidth = BANDWIDTH_6_MHZ;
priv->video_standard = XC4000_DTV6;
- priv->freq_hz = params->frequency - 1750000;
+ priv->freq_hz = c->frequency - 1750000;
type = DTV6;
- break;
- case BANDWIDTH_7_MHZ:
+ } else if (bw <= 7000000) {
priv->bandwidth = BANDWIDTH_7_MHZ;
priv->video_standard = XC4000_DTV7;
- priv->freq_hz = params->frequency - 2250000;
+ priv->freq_hz = c->frequency - 2250000;
type = DTV7;
- break;
- case BANDWIDTH_8_MHZ:
+ } else {
priv->bandwidth = BANDWIDTH_8_MHZ;
priv->video_standard = XC4000_DTV8;
- priv->freq_hz = params->frequency - 2750000;
+ priv->freq_hz = c->frequency - 2750000;
type = DTV8;
- break;
- case BANDWIDTH_AUTO:
- if (params->frequency < 400000000) {
- priv->bandwidth = BANDWIDTH_7_MHZ;
- priv->freq_hz = params->frequency - 2250000;
- } else {
- priv->bandwidth = BANDWIDTH_8_MHZ;
- priv->freq_hz = params->frequency - 2750000;
- }
- priv->video_standard = XC4000_DTV7_8;
- type = DTV78;
- break;
- default:
- printk(KERN_ERR "xc4000 bandwidth not set!\n");
- ret = -EINVAL;
- goto fail;
}
priv->rf_mode = XC_RF_MODE_AIR;
- } else {
- printk(KERN_ERR "xc4000 modulation type not supported!\n");
+ break;
+ default:
+ printk(KERN_ERR "xc4000 delivery system not supported!\n");
ret = -EINVAL;
goto fail;
}
--
1.7.8.352.g876a6
^ permalink raw reply related [flat|nested] 51+ messages in thread
* [PATCH v4 18/47] [media] cx24113: use DVBv5 parameters on set_params()
2011-12-24 15:50 ` [PATCH v4 17/47] [media] xc4000: " Mauro Carvalho Chehab
@ 2011-12-24 15:50 ` Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 19/47] [media] zl10039: " Mauro Carvalho Chehab
0 siblings, 1 reply; 51+ messages in thread
From: Mauro Carvalho Chehab @ 2011-12-24 15:50 UTC (permalink / raw)
Cc: Mauro Carvalho Chehab, Linux Media Mailing List
Instead of using DVBv3 parameters, rely on DVBv5 parameters to
set the tuner
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
drivers/media/dvb/frontends/cx24113.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/media/dvb/frontends/cx24113.c b/drivers/media/dvb/frontends/cx24113.c
index c341d57..07737e2 100644
--- a/drivers/media/dvb/frontends/cx24113.c
+++ b/drivers/media/dvb/frontends/cx24113.c
@@ -479,18 +479,19 @@ static int cx24113_init(struct dvb_frontend *fe)
static int cx24113_set_params(struct dvb_frontend *fe,
struct dvb_frontend_parameters *p)
{
+ struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct cx24113_state *state = fe->tuner_priv;
/* for a ROLL-OFF factor of 0.35, 0.2: 600, 0.25: 625 */
u32 roll_off = 675;
u32 bw;
- bw = ((p->u.qpsk.symbol_rate/100) * roll_off) / 1000;
+ bw = ((c->symbol_rate/100) * roll_off) / 1000;
bw += (10000000/100) + 5;
bw /= 10;
bw += 1000;
cx24113_set_bandwidth(state, bw);
- cx24113_set_frequency(state, p->frequency);
+ cx24113_set_frequency(state, c->frequency);
msleep(5);
return cx24113_get_status(fe, &bw);
}
--
1.7.8.352.g876a6
^ permalink raw reply related [flat|nested] 51+ messages in thread
* [PATCH v4 19/47] [media] zl10039: use DVBv5 parameters on set_params()
2011-12-24 15:50 ` [PATCH v4 18/47] [media] cx24113: " Mauro Carvalho Chehab
@ 2011-12-24 15:50 ` Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 20/47] [media] av7110: " Mauro Carvalho Chehab
0 siblings, 1 reply; 51+ messages in thread
From: Mauro Carvalho Chehab @ 2011-12-24 15:50 UTC (permalink / raw)
Cc: Mauro Carvalho Chehab, Linux Media Mailing List
Instead of using DVBv3 parameters, rely on DVBv5 parameters to
set the tuner
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
drivers/media/dvb/frontends/zl10039.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/media/dvb/frontends/zl10039.c b/drivers/media/dvb/frontends/zl10039.c
index c085e58..7fc8cef 100644
--- a/drivers/media/dvb/frontends/zl10039.c
+++ b/drivers/media/dvb/frontends/zl10039.c
@@ -177,8 +177,9 @@ static int zl10039_sleep(struct dvb_frontend *fe)
}
static int zl10039_set_params(struct dvb_frontend *fe,
- struct dvb_frontend_parameters *params)
+ struct dvb_frontend_parameters *params)
{
+ struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct zl10039_state *state = fe->tuner_priv;
u8 buf[6];
u8 bf;
@@ -188,12 +189,12 @@ static int zl10039_set_params(struct dvb_frontend *fe,
dprintk("%s\n", __func__);
dprintk("Set frequency = %d, symbol rate = %d\n",
- params->frequency, params->u.qpsk.symbol_rate);
+ c->frequency, c->symbol_rate);
/* Assumed 10.111 MHz crystal oscillator */
/* Cancelled num/den 80 to prevent overflow */
- div = (params->frequency * 1000) / 126387;
- fbw = (params->u.qpsk.symbol_rate * 27) / 32000;
+ div = (c->frequency * 1000) / 126387;
+ fbw = (c->symbol_rate * 27) / 32000;
/* Cancelled num/den 10 to prevent overflow */
bf = ((fbw * 5088) / 1011100) - 1;
--
1.7.8.352.g876a6
^ permalink raw reply related [flat|nested] 51+ messages in thread
* [PATCH v4 20/47] [media] av7110: use DVBv5 parameters on set_params()
2011-12-24 15:50 ` [PATCH v4 19/47] [media] zl10039: " Mauro Carvalho Chehab
@ 2011-12-24 15:50 ` Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 21/47] [media] budget-ci: " Mauro Carvalho Chehab
0 siblings, 1 reply; 51+ messages in thread
From: Mauro Carvalho Chehab @ 2011-12-24 15:50 UTC (permalink / raw)
Cc: Mauro Carvalho Chehab, Linux Media Mailing List
Instead of using DVBv3 parameters, rely on DVBv5 parameters to
set the tuner
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
drivers/media/dvb/ttpci/av7110.c | 55 +++++++++++++++++++++----------------
1 files changed, 31 insertions(+), 24 deletions(-)
diff --git a/drivers/media/dvb/ttpci/av7110.c b/drivers/media/dvb/ttpci/av7110.c
index abf6b55..37eb4ac 100644
--- a/drivers/media/dvb/ttpci/av7110.c
+++ b/drivers/media/dvb/ttpci/av7110.c
@@ -1570,17 +1570,18 @@ static int get_firmware(struct av7110* av7110)
static int alps_bsrv2_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters *params)
{
+ struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct av7110* av7110 = fe->dvb->priv;
u8 pwr = 0;
u8 buf[4];
struct i2c_msg msg = { .addr = 0x61, .flags = 0, .buf = buf, .len = sizeof(buf) };
- u32 div = (params->frequency + 479500) / 125;
+ u32 div = (p->frequency + 479500) / 125;
- if (params->frequency > 2000000) pwr = 3;
- else if (params->frequency > 1800000) pwr = 2;
- else if (params->frequency > 1600000) pwr = 1;
- else if (params->frequency > 1200000) pwr = 0;
- else if (params->frequency >= 1100000) pwr = 1;
+ if (p->frequency > 2000000) pwr = 3;
+ else if (p->frequency > 1800000) pwr = 2;
+ else if (p->frequency > 1600000) pwr = 1;
+ else if (p->frequency > 1200000) pwr = 0;
+ else if (p->frequency >= 1100000) pwr = 1;
else pwr = 2;
buf[0] = (div >> 8) & 0x7f;
@@ -1606,17 +1607,18 @@ static struct ves1x93_config alps_bsrv2_config = {
static int alps_tdbe2_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters *params)
{
+ struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct av7110* av7110 = fe->dvb->priv;
u32 div;
u8 data[4];
struct i2c_msg msg = { .addr = 0x62, .flags = 0, .buf = data, .len = sizeof(data) };
- div = (params->frequency + 35937500 + 31250) / 62500;
+ div = (p->frequency + 35937500 + 31250) / 62500;
data[0] = (div >> 8) & 0x7f;
data[1] = div & 0xff;
data[2] = 0x85 | ((div >> 10) & 0x60);
- data[3] = (params->frequency < 174000000 ? 0x88 : params->frequency < 470000000 ? 0x84 : 0x81);
+ data[3] = (p->frequency < 174000000 ? 0x88 : p->frequency < 470000000 ? 0x84 : 0x81);
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1);
@@ -1637,12 +1639,13 @@ static struct ves1820_config alps_tdbe2_config = {
static int grundig_29504_451_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters *params)
{
+ struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct av7110* av7110 = fe->dvb->priv;
u32 div;
u8 data[4];
struct i2c_msg msg = { .addr = 0x61, .flags = 0, .buf = data, .len = sizeof(data) };
- div = params->frequency / 125;
+ div = p->frequency / 125;
data[0] = (div >> 8) & 0x7f;
data[1] = div & 0xff;
data[2] = 0x8e;
@@ -1663,9 +1666,10 @@ static struct tda8083_config grundig_29504_451_config = {
static int philips_cd1516_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters *params)
{
+ struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct av7110* av7110 = fe->dvb->priv;
u32 div;
- u32 f = params->frequency;
+ u32 f = p->frequency;
u8 data[4];
struct i2c_msg msg = { .addr = 0x61, .flags = 0, .buf = data, .len = sizeof(data) };
@@ -1694,14 +1698,15 @@ static struct ves1820_config philips_cd1516_config = {
static int alps_tdlb7_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters *params)
{
+ struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct av7110* av7110 = fe->dvb->priv;
u32 div, pwr;
u8 data[4];
struct i2c_msg msg = { .addr = 0x60, .flags = 0, .buf = data, .len = sizeof(data) };
- div = (params->frequency + 36200000) / 166666;
+ div = (p->frequency + 36200000) / 166666;
- if (params->frequency <= 782000000)
+ if (p->frequency <= 782000000)
pwr = 1;
else
pwr = 2;
@@ -1831,6 +1836,7 @@ static u8 nexusca_stv0297_inittab[] = {
static int nexusca_stv0297_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters *params)
{
+ struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct av7110* av7110 = fe->dvb->priv;
u32 div;
u8 data[4];
@@ -1838,19 +1844,19 @@ static int nexusca_stv0297_tuner_set_params(struct dvb_frontend* fe, struct dvb_
struct i2c_msg readmsg = { .addr = 0x63, .flags = I2C_M_RD, .buf = data, .len = 1 };
int i;
- div = (params->frequency + 36150000 + 31250) / 62500;
+ div = (p->frequency + 36150000 + 31250) / 62500;
data[0] = (div >> 8) & 0x7f;
data[1] = div & 0xff;
data[2] = 0xce;
- if (params->frequency < 45000000)
+ if (p->frequency < 45000000)
return -EINVAL;
- else if (params->frequency < 137000000)
+ else if (p->frequency < 137000000)
data[3] = 0x01;
- else if (params->frequency < 403000000)
+ else if (p->frequency < 403000000)
data[3] = 0x02;
- else if (params->frequency < 860000000)
+ else if (p->frequency < 860000000)
data[3] = 0x04;
else
return -EINVAL;
@@ -1886,24 +1892,25 @@ static struct stv0297_config nexusca_stv0297_config = {
static int grundig_29504_401_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters *params)
{
+ struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct av7110* av7110 = fe->dvb->priv;
u32 div;
u8 cfg, cpump, band_select;
u8 data[4];
struct i2c_msg msg = { .addr = 0x61, .flags = 0, .buf = data, .len = sizeof(data) };
- div = (36125000 + params->frequency) / 166666;
+ div = (36125000 + p->frequency) / 166666;
cfg = 0x88;
- if (params->frequency < 175000000) cpump = 2;
- else if (params->frequency < 390000000) cpump = 1;
- else if (params->frequency < 470000000) cpump = 2;
- else if (params->frequency < 750000000) cpump = 1;
+ if (p->frequency < 175000000) cpump = 2;
+ else if (p->frequency < 390000000) cpump = 1;
+ else if (p->frequency < 470000000) cpump = 2;
+ else if (p->frequency < 750000000) cpump = 1;
else cpump = 3;
- if (params->frequency < 175000000) band_select = 0x0e;
- else if (params->frequency < 470000000) band_select = 0x05;
+ if (p->frequency < 175000000) band_select = 0x0e;
+ else if (p->frequency < 470000000) band_select = 0x05;
else band_select = 0x03;
data[0] = (div >> 8) & 0x7f;
--
1.7.8.352.g876a6
^ permalink raw reply related [flat|nested] 51+ messages in thread
* [PATCH v4 21/47] [media] budget-ci: use DVBv5 parameters on set_params()
2011-12-24 15:50 ` [PATCH v4 20/47] [media] av7110: " Mauro Carvalho Chehab
@ 2011-12-24 15:50 ` Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 22/47] [media] budget-patch: " Mauro Carvalho Chehab
0 siblings, 1 reply; 51+ messages in thread
From: Mauro Carvalho Chehab @ 2011-12-24 15:50 UTC (permalink / raw)
Cc: Mauro Carvalho Chehab, Linux Media Mailing List
Instead of using DVBv3 parameters, rely on DVBv5 parameters to
set the tuner
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
drivers/media/dvb/ttpci/budget-ci.c | 41 ++++++++++++++++++----------------
1 files changed, 22 insertions(+), 19 deletions(-)
diff --git a/drivers/media/dvb/ttpci/budget-ci.c b/drivers/media/dvb/ttpci/budget-ci.c
index ab180f9..9807968 100644
--- a/drivers/media/dvb/ttpci/budget-ci.c
+++ b/drivers/media/dvb/ttpci/budget-ci.c
@@ -663,30 +663,31 @@ static int philips_su1278_tt_set_symbol_rate(struct dvb_frontend *fe, u32 srate,
static int philips_su1278_tt_tuner_set_params(struct dvb_frontend *fe,
struct dvb_frontend_parameters *params)
{
+ struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct budget_ci *budget_ci = (struct budget_ci *) fe->dvb->priv;
u32 div;
u8 buf[4];
struct i2c_msg msg = {.addr = 0x60,.flags = 0,.buf = buf,.len = sizeof(buf) };
- if ((params->frequency < 950000) || (params->frequency > 2150000))
+ if ((p->frequency < 950000) || (p->frequency > 2150000))
return -EINVAL;
- div = (params->frequency + (500 - 1)) / 500; // round correctly
+ div = (p->frequency + (500 - 1)) / 500; // round correctly
buf[0] = (div >> 8) & 0x7f;
buf[1] = div & 0xff;
buf[2] = 0x80 | ((div & 0x18000) >> 10) | 2;
buf[3] = 0x20;
- if (params->u.qpsk.symbol_rate < 4000000)
+ if (p->symbol_rate < 4000000)
buf[3] |= 1;
- if (params->frequency < 1250000)
+ if (p->frequency < 1250000)
buf[3] |= 0;
- else if (params->frequency < 1550000)
+ else if (p->frequency < 1550000)
buf[3] |= 0x40;
- else if (params->frequency < 2050000)
+ else if (p->frequency < 2050000)
buf[3] |= 0x80;
- else if (params->frequency < 2150000)
+ else if (p->frequency < 2150000)
buf[3] |= 0xC0;
if (fe->ops.i2c_gate_ctrl)
@@ -743,6 +744,7 @@ static int philips_tdm1316l_tuner_init(struct dvb_frontend *fe)
static int philips_tdm1316l_tuner_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
{
+ struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct budget_ci *budget_ci = (struct budget_ci *) fe->dvb->priv;
u8 tuner_buf[4];
struct i2c_msg tuner_msg = {.addr = budget_ci->tuner_pll_address,.flags = 0,.buf = tuner_buf,.len = sizeof(tuner_buf) };
@@ -750,7 +752,7 @@ static int philips_tdm1316l_tuner_set_params(struct dvb_frontend *fe, struct dvb
u8 band, cp, filter;
// determine charge pump
- tuner_frequency = params->frequency + 36130000;
+ tuner_frequency = p->frequency + 36130000;
if (tuner_frequency < 87000000)
return -EINVAL;
else if (tuner_frequency < 130000000)
@@ -775,30 +777,30 @@ static int philips_tdm1316l_tuner_set_params(struct dvb_frontend *fe, struct dvb
return -EINVAL;
// determine band
- if (params->frequency < 49000000)
+ if (p->frequency < 49000000)
return -EINVAL;
- else if (params->frequency < 159000000)
+ else if (p->frequency < 159000000)
band = 1;
- else if (params->frequency < 444000000)
+ else if (p->frequency < 444000000)
band = 2;
- else if (params->frequency < 861000000)
+ else if (p->frequency < 861000000)
band = 4;
else
return -EINVAL;
// setup PLL filter and TDA9889
- switch (params->u.ofdm.bandwidth) {
- case BANDWIDTH_6_MHZ:
+ switch (p->bandwidth_hz) {
+ case 6000000:
tda1004x_writereg(fe, 0x0C, 0x14);
filter = 0;
break;
- case BANDWIDTH_7_MHZ:
+ case 7000000:
tda1004x_writereg(fe, 0x0C, 0x80);
filter = 0;
break;
- case BANDWIDTH_8_MHZ:
+ case 8000000:
tda1004x_writereg(fe, 0x0C, 0x14);
filter = 1;
break;
@@ -809,7 +811,7 @@ static int philips_tdm1316l_tuner_set_params(struct dvb_frontend *fe, struct dvb
// calculate divisor
// ((36130000+((1000000/6)/2)) + Finput)/(1000000/6)
- tuner_frequency = (((params->frequency / 1000) * 6) + 217280) / 1000;
+ tuner_frequency = (((p->frequency / 1000) * 6) + 217280) / 1000;
// setup tuner buffer
tuner_buf[0] = tuner_frequency >> 8;
@@ -858,6 +860,7 @@ static struct tda1004x_config philips_tdm1316l_config_invert = {
static int dvbc_philips_tdm1316l_tuner_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
{
+ struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct budget_ci *budget_ci = (struct budget_ci *) fe->dvb->priv;
u8 tuner_buf[5];
struct i2c_msg tuner_msg = {.addr = budget_ci->tuner_pll_address,
@@ -868,7 +871,7 @@ static int dvbc_philips_tdm1316l_tuner_set_params(struct dvb_frontend *fe, struc
u8 band, cp, filter;
// determine charge pump
- tuner_frequency = params->frequency + 36125000;
+ tuner_frequency = p->frequency + 36125000;
if (tuner_frequency < 87000000)
return -EINVAL;
else if (tuner_frequency < 130000000) {
@@ -905,7 +908,7 @@ static int dvbc_philips_tdm1316l_tuner_set_params(struct dvb_frontend *fe, struc
filter = 1;
// calculate divisor
- tuner_frequency = (params->frequency + 36125000 + (62500/2)) / 62500;
+ tuner_frequency = (p->frequency + 36125000 + (62500/2)) / 62500;
// setup tuner buffer
tuner_buf[0] = tuner_frequency >> 8;
--
1.7.8.352.g876a6
^ permalink raw reply related [flat|nested] 51+ messages in thread
* [PATCH v4 22/47] [media] budget-patch: use DVBv5 parameters on set_params()
2011-12-24 15:50 ` [PATCH v4 21/47] [media] budget-ci: " Mauro Carvalho Chehab
@ 2011-12-24 15:50 ` Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 23/47] [media] saa7134: " Mauro Carvalho Chehab
0 siblings, 1 reply; 51+ messages in thread
From: Mauro Carvalho Chehab @ 2011-12-24 15:50 UTC (permalink / raw)
Cc: Mauro Carvalho Chehab, Linux Media Mailing List
Instead of using DVBv3 parameters, rely on DVBv5 parameters to
set the tuner
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
drivers/media/dvb/ttpci/budget-patch.c | 16 +++++++++-------
1 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/drivers/media/dvb/ttpci/budget-patch.c b/drivers/media/dvb/ttpci/budget-patch.c
index 3395d1a..1f14a7f 100644
--- a/drivers/media/dvb/ttpci/budget-patch.c
+++ b/drivers/media/dvb/ttpci/budget-patch.c
@@ -263,17 +263,18 @@ static int budget_patch_diseqc_send_burst(struct dvb_frontend* fe, fe_sec_mini_c
static int alps_bsrv2_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters* params)
{
+ struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct budget_patch* budget = (struct budget_patch*) fe->dvb->priv;
u8 pwr = 0;
u8 buf[4];
struct i2c_msg msg = { .addr = 0x61, .flags = 0, .buf = buf, .len = sizeof(buf) };
- u32 div = (params->frequency + 479500) / 125;
+ u32 div = (p->frequency + 479500) / 125;
- if (params->frequency > 2000000) pwr = 3;
- else if (params->frequency > 1800000) pwr = 2;
- else if (params->frequency > 1600000) pwr = 1;
- else if (params->frequency > 1200000) pwr = 0;
- else if (params->frequency >= 1100000) pwr = 1;
+ if (p->frequency > 2000000) pwr = 3;
+ else if (p->frequency > 1800000) pwr = 2;
+ else if (p->frequency > 1600000) pwr = 1;
+ else if (p->frequency > 1200000) pwr = 0;
+ else if (p->frequency >= 1100000) pwr = 1;
else pwr = 2;
buf[0] = (div >> 8) & 0x7f;
@@ -299,12 +300,13 @@ static struct ves1x93_config alps_bsrv2_config = {
static int grundig_29504_451_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters* params)
{
+ struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct budget_patch* budget = (struct budget_patch*) fe->dvb->priv;
u32 div;
u8 data[4];
struct i2c_msg msg = { .addr = 0x61, .flags = 0, .buf = data, .len = sizeof(data) };
- div = params->frequency / 125;
+ div = p->frequency / 125;
data[0] = (div >> 8) & 0x7f;
data[1] = div & 0xff;
data[2] = 0x8e;
--
1.7.8.352.g876a6
^ permalink raw reply related [flat|nested] 51+ messages in thread
* [PATCH v4 23/47] [media] saa7134: use DVBv5 parameters on set_params()
2011-12-24 15:50 ` [PATCH v4 22/47] [media] budget-patch: " Mauro Carvalho Chehab
@ 2011-12-24 15:50 ` Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 24/47] [media] cx88: " Mauro Carvalho Chehab
0 siblings, 1 reply; 51+ messages in thread
From: Mauro Carvalho Chehab @ 2011-12-24 15:50 UTC (permalink / raw)
Cc: Mauro Carvalho Chehab, Linux Media Mailing List
Instead of using DVBv3 parameters, rely on DVBv5 parameters to
set the tuner
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
drivers/media/video/saa7134/saa7134-dvb.c | 24 +++++++++++++-----------
1 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/drivers/media/video/saa7134/saa7134-dvb.c b/drivers/media/video/saa7134/saa7134-dvb.c
index 1e4ef16..5fdb845 100644
--- a/drivers/media/video/saa7134/saa7134-dvb.c
+++ b/drivers/media/video/saa7134/saa7134-dvb.c
@@ -186,6 +186,7 @@ static int mt352_avermedia_xc3028_init(struct dvb_frontend *fe)
static int mt352_pinnacle_tuner_set_params(struct dvb_frontend* fe,
struct dvb_frontend_parameters* params)
{
+ struct dtv_frontend_properties *c = &fe->dtv_property_cache;
u8 off[] = { 0x00, 0xf1};
u8 on[] = { 0x00, 0x71};
struct i2c_msg msg = {.addr=0x43, .flags=0, .buf=off, .len = sizeof(off)};
@@ -196,7 +197,7 @@ static int mt352_pinnacle_tuner_set_params(struct dvb_frontend* fe,
/* set frequency (mt2050) */
f.tuner = 0;
f.type = V4L2_TUNER_DIGITAL_TV;
- f.frequency = params->frequency / 1000 * 16 / 1000;
+ f.frequency = c->frequency / 1000 * 16 / 1000;
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1);
i2c_transfer(&dev->i2c_adap, &msg, 1);
@@ -289,6 +290,7 @@ static int philips_tda1004x_request_firmware(struct dvb_frontend *fe,
static int philips_tda6651_pll_set(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
{
+ struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct saa7134_dev *dev = fe->dvb->priv;
struct tda1004x_state *state = fe->demodulator_priv;
u8 addr = state->config->tuner_address;
@@ -299,7 +301,7 @@ static int philips_tda6651_pll_set(struct dvb_frontend *fe, struct dvb_frontend_
u8 band, cp, filter;
/* determine charge pump */
- tuner_frequency = params->frequency + 36166000;
+ tuner_frequency = c->frequency + 36166000;
if (tuner_frequency < 87000000)
return -EINVAL;
else if (tuner_frequency < 130000000)
@@ -324,28 +326,28 @@ static int philips_tda6651_pll_set(struct dvb_frontend *fe, struct dvb_frontend_
return -EINVAL;
/* determine band */
- if (params->frequency < 49000000)
+ if (c->frequency < 49000000)
return -EINVAL;
- else if (params->frequency < 161000000)
+ else if (c->frequency < 161000000)
band = 1;
- else if (params->frequency < 444000000)
+ else if (c->frequency < 444000000)
band = 2;
- else if (params->frequency < 861000000)
+ else if (c->frequency < 861000000)
band = 4;
else
return -EINVAL;
/* setup PLL filter */
- switch (params->u.ofdm.bandwidth) {
- case BANDWIDTH_6_MHZ:
+ switch (c->bandwidth_hz) {
+ case 6000000:
filter = 0;
break;
- case BANDWIDTH_7_MHZ:
+ case 7000000:
filter = 0;
break;
- case BANDWIDTH_8_MHZ:
+ case 8000000:
filter = 1;
break;
@@ -356,7 +358,7 @@ static int philips_tda6651_pll_set(struct dvb_frontend *fe, struct dvb_frontend_
/* calculate divisor
* ((36166000+((1000000/6)/2)) + Finput)/(1000000/6)
*/
- tuner_frequency = (((params->frequency / 1000) * 6) + 217496) / 1000;
+ tuner_frequency = (((c->frequency / 1000) * 6) + 217496) / 1000;
/* setup tuner buffer */
tuner_buf[0] = (tuner_frequency >> 8) & 0x7f;
--
1.7.8.352.g876a6
^ permalink raw reply related [flat|nested] 51+ messages in thread
* [PATCH v4 24/47] [media] cx88: use DVBv5 parameters on set_params()
2011-12-24 15:50 ` [PATCH v4 23/47] [media] saa7134: " Mauro Carvalho Chehab
@ 2011-12-24 15:50 ` Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 25/47] [media] tua6100: " Mauro Carvalho Chehab
0 siblings, 1 reply; 51+ messages in thread
From: Mauro Carvalho Chehab @ 2011-12-24 15:50 UTC (permalink / raw)
Cc: Mauro Carvalho Chehab, Linux Media Mailing List
Instead of using DVBv3 parameters, rely on DVBv5 parameters to
set the tuner
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
drivers/media/video/cx88/cx88-dvb.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c
index cf3d33a..1311af0 100644
--- a/drivers/media/video/cx88/cx88-dvb.c
+++ b/drivers/media/video/cx88/cx88-dvb.c
@@ -818,6 +818,7 @@ static const u8 samsung_smt_7020_inittab[] = {
static int samsung_smt_7020_tuner_set_params(struct dvb_frontend *fe,
struct dvb_frontend_parameters *params)
{
+ struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct cx8802_dev *dev = fe->dvb->priv;
u8 buf[4];
u32 div;
@@ -827,14 +828,14 @@ static int samsung_smt_7020_tuner_set_params(struct dvb_frontend *fe,
.buf = buf,
.len = sizeof(buf) };
- div = params->frequency / 125;
+ div = c->frequency / 125;
buf[0] = (div >> 8) & 0x7f;
buf[1] = div & 0xff;
buf[2] = 0x84; /* 0xC4 */
buf[3] = 0x00;
- if (params->frequency < 1500000)
+ if (c->frequency < 1500000)
buf[3] |= 0x10;
if (fe->ops.i2c_gate_ctrl)
--
1.7.8.352.g876a6
^ permalink raw reply related [flat|nested] 51+ messages in thread
* [PATCH v4 25/47] [media] tua6100: use DVBv5 parameters on set_params()
2011-12-24 15:50 ` [PATCH v4 24/47] [media] cx88: " Mauro Carvalho Chehab
@ 2011-12-24 15:50 ` Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 26/47] [media] itd1000: " Mauro Carvalho Chehab
0 siblings, 1 reply; 51+ messages in thread
From: Mauro Carvalho Chehab @ 2011-12-24 15:50 UTC (permalink / raw)
Cc: Mauro Carvalho Chehab, Linux Media Mailing List
Instead of using DVBv3 parameters, rely on DVBv5 parameters to
set the tuner
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
drivers/media/dvb/frontends/tua6100.c | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/drivers/media/dvb/frontends/tua6100.c b/drivers/media/dvb/frontends/tua6100.c
index bcb95c2..621d750 100644
--- a/drivers/media/dvb/frontends/tua6100.c
+++ b/drivers/media/dvb/frontends/tua6100.c
@@ -70,6 +70,7 @@ static int tua6100_sleep(struct dvb_frontend *fe)
static int tua6100_set_params(struct dvb_frontend *fe,
struct dvb_frontend_parameters *params)
{
+ struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct tua6100_priv *priv = fe->tuner_priv;
u32 div;
u32 prediv;
@@ -85,36 +86,36 @@ static int tua6100_set_params(struct dvb_frontend *fe,
#define _ri 4000000
// setup register 0
- if (params->frequency < 2000000) {
+ if (c->frequency < 2000000) {
reg0[1] = 0x03;
} else {
reg0[1] = 0x07;
}
// setup register 1
- if (params->frequency < 1630000) {
+ if (c->frequency < 1630000) {
reg1[1] = 0x2c;
} else {
reg1[1] = 0x0c;
}
if (_P == 64)
reg1[1] |= 0x40;
- if (params->frequency >= 1525000)
+ if (c->frequency >= 1525000)
reg1[1] |= 0x80;
// register 2
reg2[1] = (_R >> 8) & 0x03;
reg2[2] = _R;
- if (params->frequency < 1455000) {
+ if (c->frequency < 1455000) {
reg2[1] |= 0x1c;
- } else if (params->frequency < 1630000) {
+ } else if (c->frequency < 1630000) {
reg2[1] |= 0x0c;
} else {
reg2[1] |= 0x1c;
}
- // The N divisor ratio (note: params->frequency is in kHz, but we need it in Hz)
- prediv = (params->frequency * _R) / (_ri / 1000);
+ // The N divisor ratio (note: c->frequency is in kHz, but we need it in Hz)
+ prediv = (c->frequency * _R) / (_ri / 1000);
div = prediv / _P;
reg1[1] |= (div >> 9) & 0x03;
reg1[2] = div >> 1;
--
1.7.8.352.g876a6
^ permalink raw reply related [flat|nested] 51+ messages in thread
* [PATCH v4 26/47] [media] itd1000: use DVBv5 parameters on set_params()
2011-12-24 15:50 ` [PATCH v4 25/47] [media] tua6100: " Mauro Carvalho Chehab
@ 2011-12-24 15:50 ` Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 27/47] [media] bsbe1, bsru6, tdh1: " Mauro Carvalho Chehab
0 siblings, 1 reply; 51+ messages in thread
From: Mauro Carvalho Chehab @ 2011-12-24 15:50 UTC (permalink / raw)
Cc: Mauro Carvalho Chehab, Linux Media Mailing List
Instead of using DVBv3 parameters, rely on DVBv5 parameters to
set the tuner
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
drivers/media/dvb/frontends/itd1000.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/media/dvb/frontends/itd1000.c b/drivers/media/dvb/frontends/itd1000.c
index aa9ccb8..afe7cc0 100644
--- a/drivers/media/dvb/frontends/itd1000.c
+++ b/drivers/media/dvb/frontends/itd1000.c
@@ -252,11 +252,12 @@ static void itd1000_set_lo(struct itd1000_state *state, u32 freq_khz)
static int itd1000_set_parameters(struct dvb_frontend *fe, struct dvb_frontend_parameters *p)
{
+ struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct itd1000_state *state = fe->tuner_priv;
u8 pllcon1;
- itd1000_set_lo(state, p->frequency);
- itd1000_set_lpf_bw(state, p->u.qpsk.symbol_rate);
+ itd1000_set_lo(state, c->frequency);
+ itd1000_set_lpf_bw(state, c->symbol_rate);
pllcon1 = itd1000_read_reg(state, PLLCON1) & 0x7f;
itd1000_write_reg(state, PLLCON1, pllcon1 | (1 << 7));
--
1.7.8.352.g876a6
^ permalink raw reply related [flat|nested] 51+ messages in thread
* [PATCH v4 27/47] [media] bsbe1, bsru6, tdh1: use DVBv5 parameters on set_params()
2011-12-24 15:50 ` [PATCH v4 26/47] [media] itd1000: " Mauro Carvalho Chehab
@ 2011-12-24 15:50 ` Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 28/47] [media] ix2505v: " Mauro Carvalho Chehab
0 siblings, 1 reply; 51+ messages in thread
From: Mauro Carvalho Chehab @ 2011-12-24 15:50 UTC (permalink / raw)
Cc: Mauro Carvalho Chehab, Linux Media Mailing List
Instead of using DVBv3 parameters, rely on DVBv5 parameters to
set the tuner
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
drivers/media/dvb/frontends/bsbe1.h | 5 +++--
drivers/media/dvb/frontends/bsru6.h | 7 ++++---
drivers/media/dvb/frontends/tdhd1.h | 9 +++++----
3 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/drivers/media/dvb/frontends/bsbe1.h b/drivers/media/dvb/frontends/bsbe1.h
index 5e431eb..e008946 100644
--- a/drivers/media/dvb/frontends/bsbe1.h
+++ b/drivers/media/dvb/frontends/bsbe1.h
@@ -71,16 +71,17 @@ static int alps_bsbe1_set_symbol_rate(struct dvb_frontend* fe, u32 srate, u32 ra
static int alps_bsbe1_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters *params)
{
+ struct dtv_frontend_properties *p = &fe->dtv_property_cache;
int ret;
u8 data[4];
u32 div;
struct i2c_msg msg = { .addr = 0x61, .flags = 0, .buf = data, .len = sizeof(data) };
struct i2c_adapter *i2c = fe->tuner_priv;
- if ((params->frequency < 950000) || (params->frequency > 2150000))
+ if ((p->frequency < 950000) || (p->frequency > 2150000))
return -EINVAL;
- div = params->frequency / 1000;
+ div = p->frequency / 1000;
data[0] = (div >> 8) & 0x7f;
data[1] = div & 0xff;
data[2] = 0x80 | ((div & 0x18000) >> 10) | 0x1;
diff --git a/drivers/media/dvb/frontends/bsru6.h b/drivers/media/dvb/frontends/bsru6.h
index c480c83..cd8c675 100644
--- a/drivers/media/dvb/frontends/bsru6.h
+++ b/drivers/media/dvb/frontends/bsru6.h
@@ -103,21 +103,22 @@ static int alps_bsru6_set_symbol_rate(struct dvb_frontend *fe, u32 srate, u32 ra
static int alps_bsru6_tuner_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
{
+ struct dtv_frontend_properties *p = &fe->dtv_property_cache;
u8 buf[4];
u32 div;
struct i2c_msg msg = { .addr = 0x61, .flags = 0, .buf = buf, .len = sizeof(buf) };
struct i2c_adapter *i2c = fe->tuner_priv;
- if ((params->frequency < 950000) || (params->frequency > 2150000))
+ if ((p->frequency < 950000) || (p->frequency > 2150000))
return -EINVAL;
- div = (params->frequency + (125 - 1)) / 125; // round correctly
+ div = (p->frequency + (125 - 1)) / 125; // round correctly
buf[0] = (div >> 8) & 0x7f;
buf[1] = div & 0xff;
buf[2] = 0x80 | ((div & 0x18000) >> 10) | 4;
buf[3] = 0xC4;
- if (params->frequency > 1530000)
+ if (p->frequency > 1530000)
buf[3] = 0xc0;
if (fe->ops.i2c_gate_ctrl)
diff --git a/drivers/media/dvb/frontends/tdhd1.h b/drivers/media/dvb/frontends/tdhd1.h
index 51f1706..9db221b 100644
--- a/drivers/media/dvb/frontends/tdhd1.h
+++ b/drivers/media/dvb/frontends/tdhd1.h
@@ -42,22 +42,23 @@ static struct tda1004x_config alps_tdhd1_204a_config = {
static int alps_tdhd1_204a_tuner_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
{
+ struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct i2c_adapter *i2c = fe->tuner_priv;
u8 data[4];
struct i2c_msg msg = { .addr = 0x61, .flags = 0, .buf = data, .len = sizeof(data) };
u32 div;
- div = (params->frequency + 36166666) / 166666;
+ div = (p->frequency + 36166666) / 166666;
data[0] = (div >> 8) & 0x7f;
data[1] = div & 0xff;
data[2] = 0x85;
- if (params->frequency >= 174000000 && params->frequency <= 230000000)
+ if (p->frequency >= 174000000 && p->frequency <= 230000000)
data[3] = 0x02;
- else if (params->frequency >= 470000000 && params->frequency <= 823000000)
+ else if (p->frequency >= 470000000 && p->frequency <= 823000000)
data[3] = 0x0C;
- else if (params->frequency > 823000000 && params->frequency <= 862000000)
+ else if (p->frequency > 823000000 && p->frequency <= 862000000)
data[3] = 0x8C;
else
return -EINVAL;
--
1.7.8.352.g876a6
^ permalink raw reply related [flat|nested] 51+ messages in thread
* [PATCH v4 28/47] [media] ix2505v: use DVBv5 parameters on set_params()
2011-12-24 15:50 ` [PATCH v4 27/47] [media] bsbe1, bsru6, tdh1: " Mauro Carvalho Chehab
@ 2011-12-24 15:50 ` Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 29/47] [media] stb6000: " Mauro Carvalho Chehab
0 siblings, 1 reply; 51+ messages in thread
From: Mauro Carvalho Chehab @ 2011-12-24 15:50 UTC (permalink / raw)
Cc: Mauro Carvalho Chehab, Linux Media Mailing List
Instead of using DVBv3 parameters, rely on DVBv5 parameters to
set the tuner
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
drivers/media/dvb/frontends/ix2505v.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/media/dvb/frontends/ix2505v.c b/drivers/media/dvb/frontends/ix2505v.c
index 9a517a4..aca4817 100644
--- a/drivers/media/dvb/frontends/ix2505v.c
+++ b/drivers/media/dvb/frontends/ix2505v.c
@@ -132,9 +132,10 @@ static int ix2505v_release(struct dvb_frontend *fe)
static int ix2505v_set_params(struct dvb_frontend *fe,
struct dvb_frontend_parameters *params)
{
+ struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct ix2505v_state *state = fe->tuner_priv;
- u32 frequency = params->frequency;
- u32 b_w = (params->u.qpsk.symbol_rate * 27) / 32000;
+ u32 frequency = c->frequency;
+ u32 b_w = (c->symbol_rate * 27) / 32000;
u32 div_factor, N , A, x;
int ret = 0, len;
u8 gain, cc, ref, psc, local_osc, lpf;
--
1.7.8.352.g876a6
^ permalink raw reply related [flat|nested] 51+ messages in thread
* [PATCH v4 29/47] [media] stb6000: use DVBv5 parameters on set_params()
2011-12-24 15:50 ` [PATCH v4 28/47] [media] ix2505v: " Mauro Carvalho Chehab
@ 2011-12-24 15:50 ` Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 30/47] [media] tda826x: " Mauro Carvalho Chehab
0 siblings, 1 reply; 51+ messages in thread
From: Mauro Carvalho Chehab @ 2011-12-24 15:50 UTC (permalink / raw)
Cc: Mauro Carvalho Chehab, Linux Media Mailing List
Instead of using DVBv3 parameters, rely on DVBv5 parameters to
set the tuner
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
drivers/media/dvb/frontends/stb6000.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/media/dvb/frontends/stb6000.c b/drivers/media/dvb/frontends/stb6000.c
index ed69964..d4f4ebb 100644
--- a/drivers/media/dvb/frontends/stb6000.c
+++ b/drivers/media/dvb/frontends/stb6000.c
@@ -78,6 +78,7 @@ static int stb6000_sleep(struct dvb_frontend *fe)
static int stb6000_set_params(struct dvb_frontend *fe,
struct dvb_frontend_parameters *params)
{
+ struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct stb6000_priv *priv = fe->tuner_priv;
unsigned int n, m;
int ret;
@@ -93,8 +94,8 @@ static int stb6000_set_params(struct dvb_frontend *fe,
dprintk("%s:\n", __func__);
- freq_mhz = params->frequency / 1000;
- bandwidth = params->u.qpsk.symbol_rate / 1000000;
+ freq_mhz = p->frequency / 1000;
+ bandwidth = p->symbol_rate / 1000000;
if (bandwidth > 31)
bandwidth = 31;
--
1.7.8.352.g876a6
^ permalink raw reply related [flat|nested] 51+ messages in thread
* [PATCH v4 30/47] [media] tda826x: use DVBv5 parameters on set_params()
2011-12-24 15:50 ` [PATCH v4 29/47] [media] stb6000: " Mauro Carvalho Chehab
@ 2011-12-24 15:50 ` Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 31/47] [media] mxl111sf-tuner: " Mauro Carvalho Chehab
0 siblings, 1 reply; 51+ messages in thread
From: Mauro Carvalho Chehab @ 2011-12-24 15:50 UTC (permalink / raw)
Cc: Mauro Carvalho Chehab, Linux Media Mailing List
Instead of using DVBv3 parameters, rely on DVBv5 parameters to
set the tuner
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
drivers/media/dvb/frontends/tda826x.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/media/dvb/frontends/tda826x.c b/drivers/media/dvb/frontends/tda826x.c
index 06c9480..ab9122a 100644
--- a/drivers/media/dvb/frontends/tda826x.c
+++ b/drivers/media/dvb/frontends/tda826x.c
@@ -73,6 +73,7 @@ static int tda826x_sleep(struct dvb_frontend *fe)
static int tda826x_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
{
+ struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct tda826x_priv *priv = fe->tuner_priv;
int ret;
u32 div;
@@ -83,11 +84,11 @@ static int tda826x_set_params(struct dvb_frontend *fe, struct dvb_frontend_param
dprintk("%s:\n", __func__);
- div = (params->frequency + (1000-1)) / 1000;
+ div = (p->frequency + (1000-1)) / 1000;
/* BW = ((1 + RO) * SR/2 + 5) * 1.3 [SR in MSPS, BW in MHz] */
/* with R0 = 0.35 and some transformations: */
- ksyms = params->u.qpsk.symbol_rate / 1000;
+ ksyms = p->symbol_rate / 1000;
bandwidth = (878 * ksyms + 6500000) / 1000000 + 1;
if (bandwidth < 5)
bandwidth = 5;
--
1.7.8.352.g876a6
^ permalink raw reply related [flat|nested] 51+ messages in thread
* [PATCH v4 31/47] [media] mxl111sf-tuner: use DVBv5 parameters on set_params()
2011-12-24 15:50 ` [PATCH v4 30/47] [media] tda826x: " Mauro Carvalho Chehab
@ 2011-12-24 15:50 ` Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 32/47] [media] mantis_vp1033: " Mauro Carvalho Chehab
0 siblings, 1 reply; 51+ messages in thread
From: Mauro Carvalho Chehab @ 2011-12-24 15:50 UTC (permalink / raw)
Cc: Mauro Carvalho Chehab, Linux Media Mailing List
Instead of using DVBv3 parameters, rely on DVBv5 parameters to
set the tuner
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
drivers/media/dvb/dvb-usb/mxl111sf-tuner.c | 46 +++++++++++++--------------
1 files changed, 22 insertions(+), 24 deletions(-)
diff --git a/drivers/media/dvb/dvb-usb/mxl111sf-tuner.c b/drivers/media/dvb/dvb-usb/mxl111sf-tuner.c
index 3bfc6d8..aeac7a9 100644
--- a/drivers/media/dvb/dvb-usb/mxl111sf-tuner.c
+++ b/drivers/media/dvb/dvb-usb/mxl111sf-tuner.c
@@ -275,52 +275,50 @@ static int mxl1x1sf_tuner_loop_thru_ctrl(struct mxl111sf_tuner_state *state,
static int mxl111sf_tuner_set_params(struct dvb_frontend *fe,
struct dvb_frontend_parameters *params)
{
+ struct dtv_frontend_properties *c = &fe->dtv_property_cache;
+ u32 delsys = c->delivery_system;
struct mxl111sf_tuner_state *state = fe->tuner_priv;
int ret;
u8 bw;
+ u32 band = BANDWIDTH_6_MHZ;
mxl_dbg("()");
- if (fe->ops.info.type == FE_ATSC) {
- switch (params->u.vsb.modulation) {
- case VSB_8:
- case VSB_16:
- bw = 0; /* ATSC */
- break;
- case QAM_64:
- case QAM_256:
- bw = 1; /* US CABLE */
- break;
- default:
- err("%s: modulation not set!", __func__);
- return -EINVAL;
- }
- } else if (fe->ops.info.type == FE_OFDM) {
- switch (params->u.ofdm.bandwidth) {
- case BANDWIDTH_6_MHZ:
+ switch (delsys) {
+ case SYS_ATSC:
+ bw = 0; /* ATSC */
+ break;
+ case SYS_DVBC_ANNEX_B:
+ bw = 1; /* US CABLE */
+ break;
+ case SYS_DVBT:
+ switch (c->bandwidth_hz) {
+ case 6000000:
bw = 6;
break;
- case BANDWIDTH_7_MHZ:
+ case 7000000:
bw = 7;
+ band = BANDWIDTH_7_MHZ;
break;
- case BANDWIDTH_8_MHZ:
+ case 8000000:
bw = 8;
+ band = BANDWIDTH_8_MHZ;
break;
default:
err("%s: bandwidth not set!", __func__);
return -EINVAL;
}
- } else {
+ break;
+ default:
err("%s: modulation type not supported!", __func__);
return -EINVAL;
}
- ret = mxl1x1sf_tune_rf(fe, params->frequency, bw);
+ ret = mxl1x1sf_tune_rf(fe, c->frequency, bw);
if (mxl_fail(ret))
goto fail;
- state->frequency = params->frequency;
- state->bandwidth = (fe->ops.info.type == FE_OFDM) ?
- params->u.ofdm.bandwidth : 0;
+ state->frequency = c->frequency;
+ state->bandwidth = band;
fail:
return ret;
}
--
1.7.8.352.g876a6
^ permalink raw reply related [flat|nested] 51+ messages in thread
* [PATCH v4 32/47] [media] mantis_vp1033: use DVBv5 parameters on set_params()
2011-12-24 15:50 ` [PATCH v4 31/47] [media] mxl111sf-tuner: " Mauro Carvalho Chehab
@ 2011-12-24 15:50 ` Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 33/47] [media] mantis_vp2033: " Mauro Carvalho Chehab
0 siblings, 1 reply; 51+ messages in thread
From: Mauro Carvalho Chehab @ 2011-12-24 15:50 UTC (permalink / raw)
Cc: Mauro Carvalho Chehab, Linux Media Mailing List
Instead of using DVBv3 parameters, rely on DVBv5 parameters to
set the tuner
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
drivers/media/dvb/mantis/mantis_vp1033.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/media/dvb/mantis/mantis_vp1033.c b/drivers/media/dvb/mantis/mantis_vp1033.c
index 2ae0afa..dfaca2a 100644
--- a/drivers/media/dvb/mantis/mantis_vp1033.c
+++ b/drivers/media/dvb/mantis/mantis_vp1033.c
@@ -86,6 +86,7 @@ u8 lgtdqcs001f_inittab[] = {
int lgtdqcs001f_tuner_set(struct dvb_frontend *fe,
struct dvb_frontend_parameters *params)
{
+ struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct mantis_pci *mantis = fe->dvb->priv;
struct i2c_adapter *adapter = &mantis->adapter;
@@ -95,14 +96,14 @@ int lgtdqcs001f_tuner_set(struct dvb_frontend *fe,
struct i2c_msg msg = {.addr = 0x61, .flags = 0, .buf = buf, .len = sizeof(buf)};
- div = params->frequency / 250;
+ div = p->frequency / 250;
buf[0] = (div >> 8) & 0x7f;
buf[1] = div & 0xff;
buf[2] = 0x83;
buf[3] = 0xc0;
- if (params->frequency < 1531000)
+ if (p->frequency < 1531000)
buf[3] |= 0x04;
else
buf[3] &= ~0x04;
--
1.7.8.352.g876a6
^ permalink raw reply related [flat|nested] 51+ messages in thread
* [PATCH v4 33/47] [media] mantis_vp2033: use DVBv5 parameters on set_params()
2011-12-24 15:50 ` [PATCH v4 32/47] [media] mantis_vp1033: " Mauro Carvalho Chehab
@ 2011-12-24 15:50 ` Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 34/47] [media] mantis_vp2040: " Mauro Carvalho Chehab
0 siblings, 1 reply; 51+ messages in thread
From: Mauro Carvalho Chehab @ 2011-12-24 15:50 UTC (permalink / raw)
Cc: Mauro Carvalho Chehab, Linux Media Mailing List
Instead of using DVBv3 parameters, rely on DVBv5 parameters to
set the tuner
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
drivers/media/dvb/mantis/mantis_vp2033.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/media/dvb/mantis/mantis_vp2033.c b/drivers/media/dvb/mantis/mantis_vp2033.c
index 06da0dd..f58ce60 100644
--- a/drivers/media/dvb/mantis/mantis_vp2033.c
+++ b/drivers/media/dvb/mantis/mantis_vp2033.c
@@ -67,6 +67,7 @@ static u8 read_pwm(struct mantis_pci *mantis)
static int tda1002x_cu1216_tuner_set(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
{
+ struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct mantis_pci *mantis = fe->dvb->priv;
struct i2c_adapter *adapter = &mantis->adapter;
@@ -77,13 +78,13 @@ static int tda1002x_cu1216_tuner_set(struct dvb_frontend *fe, struct dvb_fronten
#define CU1216_IF 36125000
#define TUNER_MUL 62500
- u32 div = (params->frequency + CU1216_IF + TUNER_MUL / 2) / TUNER_MUL;
+ u32 div = (p->frequency + CU1216_IF + TUNER_MUL / 2) / TUNER_MUL;
buf[0] = (div >> 8) & 0x7f;
buf[1] = div & 0xff;
buf[2] = 0xce;
- buf[3] = (params->frequency < 150000000 ? 0x01 :
- params->frequency < 445000000 ? 0x02 : 0x04);
+ buf[3] = (p->frequency < 150000000 ? 0x01 :
+ p->frequency < 445000000 ? 0x02 : 0x04);
buf[4] = 0xde;
buf[5] = 0x20;
--
1.7.8.352.g876a6
^ permalink raw reply related [flat|nested] 51+ messages in thread
* [PATCH v4 34/47] [media] mantis_vp2040: use DVBv5 parameters on set_params()
2011-12-24 15:50 ` [PATCH v4 33/47] [media] mantis_vp2033: " Mauro Carvalho Chehab
@ 2011-12-24 15:50 ` Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 35/47] [media] pluto2: " Mauro Carvalho Chehab
0 siblings, 1 reply; 51+ messages in thread
From: Mauro Carvalho Chehab @ 2011-12-24 15:50 UTC (permalink / raw)
Cc: Mauro Carvalho Chehab, Linux Media Mailing List
Instead of using DVBv3 parameters, rely on DVBv5 parameters to
set the tuner
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
drivers/media/dvb/mantis/mantis_vp2040.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/media/dvb/mantis/mantis_vp2040.c b/drivers/media/dvb/mantis/mantis_vp2040.c
index f72b137..beadfea 100644
--- a/drivers/media/dvb/mantis/mantis_vp2040.c
+++ b/drivers/media/dvb/mantis/mantis_vp2040.c
@@ -49,6 +49,7 @@ struct tda10023_config vp2040_tda10023_cu1216_config = {
static int tda1002x_cu1216_tuner_set(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
{
+ struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct mantis_pci *mantis = fe->dvb->priv;
struct i2c_adapter *adapter = &mantis->adapter;
@@ -59,13 +60,13 @@ static int tda1002x_cu1216_tuner_set(struct dvb_frontend *fe, struct dvb_fronten
#define CU1216_IF 36125000
#define TUNER_MUL 62500
- u32 div = (params->frequency + CU1216_IF + TUNER_MUL / 2) / TUNER_MUL;
+ u32 div = (p->frequency + CU1216_IF + TUNER_MUL / 2) / TUNER_MUL;
buf[0] = (div >> 8) & 0x7f;
buf[1] = div & 0xff;
buf[2] = 0xce;
- buf[3] = (params->frequency < 150000000 ? 0x01 :
- params->frequency < 445000000 ? 0x02 : 0x04);
+ buf[3] = (p->frequency < 150000000 ? 0x01 :
+ p->frequency < 445000000 ? 0x02 : 0x04);
buf[4] = 0xde;
buf[5] = 0x20;
--
1.7.8.352.g876a6
^ permalink raw reply related [flat|nested] 51+ messages in thread
* [PATCH v4 35/47] [media] pluto2: use DVBv5 parameters on set_params()
2011-12-24 15:50 ` [PATCH v4 34/47] [media] mantis_vp2040: " Mauro Carvalho Chehab
@ 2011-12-24 15:50 ` Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 36/47] [media] dvb-ttusb-budget: " Mauro Carvalho Chehab
0 siblings, 1 reply; 51+ messages in thread
From: Mauro Carvalho Chehab @ 2011-12-24 15:50 UTC (permalink / raw)
Cc: Mauro Carvalho Chehab, Linux Media Mailing List
Instead of using DVBv3 parameters, rely on DVBv5 parameters to
set the tuner
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
drivers/media/dvb/pluto2/pluto2.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/media/dvb/pluto2/pluto2.c b/drivers/media/dvb/pluto2/pluto2.c
index 80fb510..027da57 100644
--- a/drivers/media/dvb/pluto2/pluto2.c
+++ b/drivers/media/dvb/pluto2/pluto2.c
@@ -446,8 +446,9 @@ static inline u32 divide(u32 numerator, u32 denominator)
/* LG Innotek TDTE-E001P (Infineon TUA6034) */
static int lg_tdtpe001p_tuner_set_params(struct dvb_frontend *fe,
- struct dvb_frontend_parameters *p)
+ struct dvb_frontend_parameters *foo)
{
+ struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct pluto *pluto = frontend_to_pluto(fe);
struct i2c_msg msg;
int ret;
@@ -478,7 +479,7 @@ static int lg_tdtpe001p_tuner_set_params(struct dvb_frontend *fe,
else
buf[3] = 0x04;
- if (p->u.ofdm.bandwidth == BANDWIDTH_8_MHZ)
+ if (p->bandwidth_hz == 8000000)
buf[3] |= 0x08;
if (sizeof(buf) == 6) {
--
1.7.8.352.g876a6
^ permalink raw reply related [flat|nested] 51+ messages in thread
* [PATCH v4 36/47] [media] dvb-ttusb-budget: use DVBv5 parameters on set_params()
2011-12-24 15:50 ` [PATCH v4 35/47] [media] pluto2: " Mauro Carvalho Chehab
@ 2011-12-24 15:50 ` Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 37/47] [media] tuner-simple: " Mauro Carvalho Chehab
0 siblings, 1 reply; 51+ messages in thread
From: Mauro Carvalho Chehab @ 2011-12-24 15:50 UTC (permalink / raw)
Cc: Mauro Carvalho Chehab, Linux Media Mailing List
Instead of using DVBv3 parameters, rely on DVBv5 parameters to
set the tuner
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c | 50 ++++++++++++--------
1 files changed, 30 insertions(+), 20 deletions(-)
diff --git a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
index 420bb42..2379f38 100644
--- a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
+++ b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
@@ -1019,17 +1019,18 @@ static u32 functionality(struct i2c_adapter *adapter)
static int alps_tdmb7_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters* params)
{
+ struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct ttusb* ttusb = (struct ttusb*) fe->dvb->priv;
u8 data[4];
struct i2c_msg msg = {.addr=0x61, .flags=0, .buf=data, .len=sizeof(data) };
u32 div;
- div = (params->frequency + 36166667) / 166667;
+ div = (p->frequency + 36166667) / 166667;
data[0] = (div >> 8) & 0x7f;
data[1] = div & 0xff;
data[2] = ((div >> 10) & 0x60) | 0x85;
- data[3] = params->frequency < 592000000 ? 0x40 : 0x80;
+ data[3] = p->frequency < 592000000 ? 0x40 : 0x80;
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1);
@@ -1073,6 +1074,7 @@ static int philips_tdm1316l_tuner_init(struct dvb_frontend* fe)
static int philips_tdm1316l_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters* params)
{
+ struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct ttusb* ttusb = (struct ttusb*) fe->dvb->priv;
u8 tuner_buf[4];
struct i2c_msg tuner_msg = {.addr=0x60, .flags=0, .buf=tuner_buf, .len=sizeof(tuner_buf) };
@@ -1080,7 +1082,7 @@ static int philips_tdm1316l_tuner_set_params(struct dvb_frontend* fe, struct dvb
u8 band, cp, filter;
// determine charge pump
- tuner_frequency = params->frequency + 36130000;
+ tuner_frequency = p->frequency + 36130000;
if (tuner_frequency < 87000000) return -EINVAL;
else if (tuner_frequency < 130000000) cp = 3;
else if (tuner_frequency < 160000000) cp = 5;
@@ -1094,25 +1096,29 @@ static int philips_tdm1316l_tuner_set_params(struct dvb_frontend* fe, struct dvb
else return -EINVAL;
// determine band
- if (params->frequency < 49000000) return -EINVAL;
- else if (params->frequency < 159000000) band = 1;
- else if (params->frequency < 444000000) band = 2;
- else if (params->frequency < 861000000) band = 4;
+ if (p->frequency < 49000000)
+ return -EINVAL;
+ else if (p->frequency < 159000000)
+ band = 1;
+ else if (p->frequency < 444000000)
+ band = 2;
+ else if (p->frequency < 861000000)
+ band = 4;
else return -EINVAL;
// setup PLL filter
- switch (params->u.ofdm.bandwidth) {
- case BANDWIDTH_6_MHZ:
+ switch (p->bandwidth_hz) {
+ case 6000000:
tda1004x_writereg(fe, 0x0C, 0);
filter = 0;
break;
- case BANDWIDTH_7_MHZ:
+ case 7000000:
tda1004x_writereg(fe, 0x0C, 0);
filter = 0;
break;
- case BANDWIDTH_8_MHZ:
+ case 8000000:
tda1004x_writereg(fe, 0x0C, 0xFF);
filter = 1;
break;
@@ -1123,7 +1129,7 @@ static int philips_tdm1316l_tuner_set_params(struct dvb_frontend* fe, struct dvb
// calculate divisor
// ((36130000+((1000000/6)/2)) + Finput)/(1000000/6)
- tuner_frequency = (((params->frequency / 1000) * 6) + 217280) / 1000;
+ tuner_frequency = (((p->frequency / 1000) * 6) + 217280) / 1000;
// setup tuner buffer
tuner_buf[0] = tuner_frequency >> 8;
@@ -1275,21 +1281,22 @@ static int alps_stv0299_set_symbol_rate(struct dvb_frontend *fe, u32 srate, u32
static int philips_tsa5059_tuner_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
{
+ struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct ttusb* ttusb = (struct ttusb*) fe->dvb->priv;
u8 buf[4];
u32 div;
struct i2c_msg msg = {.addr = 0x61,.flags = 0,.buf = buf,.len = sizeof(buf) };
- if ((params->frequency < 950000) || (params->frequency > 2150000))
+ if ((p->frequency < 950000) || (p->frequency > 2150000))
return -EINVAL;
- div = (params->frequency + (125 - 1)) / 125; // round correctly
+ div = (p->frequency + (125 - 1)) / 125; /* round correctly */
buf[0] = (div >> 8) & 0x7f;
buf[1] = div & 0xff;
buf[2] = 0x80 | ((div & 0x18000) >> 10) | 4;
buf[3] = 0xC4;
- if (params->frequency > 1530000)
+ if (p->frequency > 1530000)
buf[3] = 0xC0;
/* BSBE1 wants XCE bit set */
@@ -1318,12 +1325,13 @@ static struct stv0299_config alps_stv0299_config = {
static int ttusb_novas_grundig_29504_491_tuner_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
{
+ struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct ttusb* ttusb = (struct ttusb*) fe->dvb->priv;
u8 buf[4];
u32 div;
struct i2c_msg msg = {.addr = 0x61,.flags = 0,.buf = buf,.len = sizeof(buf) };
- div = params->frequency / 125;
+ div = p->frequency / 125;
buf[0] = (div >> 8) & 0x7f;
buf[1] = div & 0xff;
@@ -1345,17 +1353,18 @@ static struct tda8083_config ttusb_novas_grundig_29504_491_config = {
static int alps_tdbe2_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters* params)
{
+ struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct ttusb* ttusb = fe->dvb->priv;
u32 div;
u8 data[4];
struct i2c_msg msg = { .addr = 0x62, .flags = 0, .buf = data, .len = sizeof(data) };
- div = (params->frequency + 35937500 + 31250) / 62500;
+ div = (p->frequency + 35937500 + 31250) / 62500;
data[0] = (div >> 8) & 0x7f;
data[1] = div & 0xff;
data[2] = 0x85 | ((div >> 10) & 0x60);
- data[3] = (params->frequency < 174000000 ? 0x88 : params->frequency < 470000000 ? 0x84 : 0x81);
+ data[3] = (p->frequency < 174000000 ? 0x88 : p->frequency < 470000000 ? 0x84 : 0x81);
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1);
@@ -1389,6 +1398,7 @@ static u8 read_pwm(struct ttusb* ttusb)
static int dvbc_philips_tdm1316l_tuner_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
{
+ struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct ttusb *ttusb = (struct ttusb *) fe->dvb->priv;
u8 tuner_buf[5];
struct i2c_msg tuner_msg = {.addr = 0x60,
@@ -1399,7 +1409,7 @@ static int dvbc_philips_tdm1316l_tuner_set_params(struct dvb_frontend *fe, struc
u8 band, cp, filter;
// determine charge pump
- tuner_frequency = params->frequency;
+ tuner_frequency = p->frequency;
if (tuner_frequency < 87000000) {return -EINVAL;}
else if (tuner_frequency < 130000000) {cp = 3; band = 1;}
else if (tuner_frequency < 160000000) {cp = 5; band = 1;}
@@ -1417,7 +1427,7 @@ static int dvbc_philips_tdm1316l_tuner_set_params(struct dvb_frontend *fe, struc
// calculate divisor
// (Finput + Fif)/Fref; Fif = 36125000 Hz, Fref = 62500 Hz
- tuner_frequency = ((params->frequency + 36125000) / 62500);
+ tuner_frequency = ((p->frequency + 36125000) / 62500);
// setup tuner buffer
tuner_buf[0] = tuner_frequency >> 8;
--
1.7.8.352.g876a6
^ permalink raw reply related [flat|nested] 51+ messages in thread
* [PATCH v4 37/47] [media] tuner-simple: use DVBv5 parameters on set_params()
2011-12-24 15:50 ` [PATCH v4 36/47] [media] dvb-ttusb-budget: " Mauro Carvalho Chehab
@ 2011-12-24 15:50 ` Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 38/47] [media] dvb-bt8xx: " Mauro Carvalho Chehab
0 siblings, 1 reply; 51+ messages in thread
From: Mauro Carvalho Chehab @ 2011-12-24 15:50 UTC (permalink / raw)
Cc: Mauro Carvalho Chehab, Linux Media Mailing List
Despite its name, tuner-simple has a complex logic to set freqs ;)
Basically, it can be called by two different ways: via set_params()
or via calc_regs() callbacks. Both are bound to the DVBv3 API.
Also, set_params internally calls calc_regs().
In order to get rid of DVBv3 params at set_params(), it shouldn't
call calc_regs() anymore. The code duplication is very small,
as most of the code there is just to check for invalid parameters.
With regards to calc_regs(), it should still trust on bandwidth and
frequency parameters passed via DVBv3, until a later patch fixes
it.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
drivers/media/common/tuners/tuner-simple.c | 63 ++++++++++++++++++++-------
1 files changed, 46 insertions(+), 17 deletions(-)
diff --git a/drivers/media/common/tuners/tuner-simple.c b/drivers/media/common/tuners/tuner-simple.c
index 4092200..e6342db 100644
--- a/drivers/media/common/tuners/tuner-simple.c
+++ b/drivers/media/common/tuners/tuner-simple.c
@@ -791,24 +791,26 @@ static int simple_set_params(struct dvb_frontend *fe,
}
static void simple_set_dvb(struct dvb_frontend *fe, u8 *buf,
- const struct dvb_frontend_parameters *params)
+ const u32 delsys,
+ const u32 frequency,
+ const u32 bandwidth)
{
struct tuner_simple_priv *priv = fe->tuner_priv;
switch (priv->type) {
case TUNER_PHILIPS_FMD1216ME_MK3:
case TUNER_PHILIPS_FMD1216MEX_MK3:
- if (params->u.ofdm.bandwidth == BANDWIDTH_8_MHZ &&
- params->frequency >= 158870000)
+ if (bandwidth == 8000000 &&
+ frequency >= 158870000)
buf[3] |= 0x08;
break;
case TUNER_PHILIPS_TD1316:
/* determine band */
- buf[3] |= (params->frequency < 161000000) ? 1 :
- (params->frequency < 444000000) ? 2 : 4;
+ buf[3] |= (frequency < 161000000) ? 1 :
+ (frequency < 444000000) ? 2 : 4;
/* setup PLL filter */
- if (params->u.ofdm.bandwidth == BANDWIDTH_8_MHZ)
+ if (bandwidth == 8000000)
buf[3] |= 1 << 3;
break;
case TUNER_PHILIPS_TUV1236D:
@@ -819,12 +821,11 @@ static void simple_set_dvb(struct dvb_frontend *fe, u8 *buf,
if (dtv_input[priv->nr])
new_rf = dtv_input[priv->nr];
else
- switch (params->u.vsb.modulation) {
- case QAM_64:
- case QAM_256:
+ switch (delsys) {
+ case SYS_DVBC_ANNEX_B:
new_rf = 1;
break;
- case VSB_8:
+ case SYS_ATSC:
default:
new_rf = 0;
break;
@@ -838,7 +839,9 @@ static void simple_set_dvb(struct dvb_frontend *fe, u8 *buf,
}
static u32 simple_dvb_configure(struct dvb_frontend *fe, u8 *buf,
- const struct dvb_frontend_parameters *params)
+ const u32 delsys,
+ const u32 freq,
+ const u32 bw)
{
/* This function returns the tuned frequency on success, 0 on error */
struct tuner_simple_priv *priv = fe->tuner_priv;
@@ -847,7 +850,7 @@ static u32 simple_dvb_configure(struct dvb_frontend *fe, u8 *buf,
u8 config, cb;
u32 div;
int ret;
- unsigned frequency = params->frequency / 62500;
+ u32 frequency = freq / 62500;
if (!tun->stepsize) {
/* tuner-core was loaded before the digital tuner was
@@ -871,7 +874,7 @@ static u32 simple_dvb_configure(struct dvb_frontend *fe, u8 *buf,
buf[2] = config;
buf[3] = cb;
- simple_set_dvb(fe, buf, params);
+ simple_set_dvb(fe, buf, delsys, freq, bw);
tuner_dbg("%s: div=%d | buf=0x%02x,0x%02x,0x%02x,0x%02x\n",
tun->name, div, buf[0], buf[1], buf[2], buf[3]);
@@ -884,13 +887,29 @@ static int simple_dvb_calc_regs(struct dvb_frontend *fe,
struct dvb_frontend_parameters *params,
u8 *buf, int buf_len)
{
+ struct dtv_frontend_properties *c = &fe->dtv_property_cache;
+ u32 delsys = c->delivery_system;
+ u32 bw = c->bandwidth_hz;
struct tuner_simple_priv *priv = fe->tuner_priv;
u32 frequency;
if (buf_len < 5)
return -EINVAL;
- frequency = simple_dvb_configure(fe, buf+1, params);
+ switch (delsys) {
+ case SYS_DVBT:
+ case SYS_DVBT2:
+ if (params->u.ofdm.bandwidth == BANDWIDTH_6_MHZ)
+ bw = 6000000;
+ if (params->u.ofdm.bandwidth == BANDWIDTH_7_MHZ)
+ bw = 7000000;
+ if (params->u.ofdm.bandwidth == BANDWIDTH_8_MHZ)
+ bw = 8000000;
+ break;
+ default:
+ break;
+ }
+ frequency = simple_dvb_configure(fe, buf+1, delsys, params->frequency, bw);
if (frequency == 0)
return -EINVAL;
@@ -906,7 +925,12 @@ static int simple_dvb_calc_regs(struct dvb_frontend *fe,
static int simple_dvb_set_params(struct dvb_frontend *fe,
struct dvb_frontend_parameters *params)
{
+ struct dtv_frontend_properties *c = &fe->dtv_property_cache;
+ u32 delsys = c->delivery_system;
+ u32 bw = c->bandwidth_hz;
+ u32 freq = c->frequency;
struct tuner_simple_priv *priv = fe->tuner_priv;
+ u32 frequency;
u32 prev_freq, prev_bw;
int ret;
u8 buf[5];
@@ -917,9 +941,14 @@ static int simple_dvb_set_params(struct dvb_frontend *fe,
prev_freq = priv->frequency;
prev_bw = priv->bandwidth;
- ret = simple_dvb_calc_regs(fe, params, buf, 5);
- if (ret != 5)
- goto fail;
+ frequency = simple_dvb_configure(fe, buf+1, delsys, freq, bw);
+ if (frequency == 0)
+ return -EINVAL;
+
+ buf[0] = priv->i2c_props.addr;
+
+ priv->frequency = frequency;
+ priv->bandwidth = bw;
/* put analog demod in standby when tuning digital */
if (fe->ops.analog_ops.standby)
--
1.7.8.352.g876a6
^ permalink raw reply related [flat|nested] 51+ messages in thread
* [PATCH v4 38/47] [media] dvb-bt8xx: use DVBv5 parameters on set_params()
2011-12-24 15:50 ` [PATCH v4 37/47] [media] tuner-simple: " Mauro Carvalho Chehab
@ 2011-12-24 15:50 ` Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 39/47] [media] dvb-pll: " Mauro Carvalho Chehab
0 siblings, 1 reply; 51+ messages in thread
From: Mauro Carvalho Chehab @ 2011-12-24 15:50 UTC (permalink / raw)
Cc: Mauro Carvalho Chehab, Linux Media Mailing List
Instead of using DVBv3 parameters, rely on DVBv5 parameters to
set the tuner.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
drivers/media/dvb/bt8xx/dvb-bt8xx.c | 31 ++++++++++++++++---------------
1 files changed, 16 insertions(+), 15 deletions(-)
diff --git a/drivers/media/dvb/bt8xx/dvb-bt8xx.c b/drivers/media/dvb/bt8xx/dvb-bt8xx.c
index 521d691..5948601 100644
--- a/drivers/media/dvb/bt8xx/dvb-bt8xx.c
+++ b/drivers/media/dvb/bt8xx/dvb-bt8xx.c
@@ -193,11 +193,10 @@ static struct zl10353_config thomson_dtt7579_zl10353_config = {
static int cx24108_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters* params)
{
- u32 freq = params->frequency;
-
+ struct dtv_frontend_properties *c = &fe->dtv_property_cache;
+ u32 freq = c->frequency;
int i, a, n, pump;
u32 band, pll;
-
u32 osci[]={950000,1019000,1075000,1178000,1296000,1432000,
1576000,1718000,1856000,2036000,2150000};
u32 bandsel[]={0,0x00020000,0x00040000,0x00100800,0x00101000,
@@ -269,29 +268,30 @@ static struct cx24110_config pctvsat_config = {
static int microtune_mt7202dtf_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters* params)
{
+ struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct dvb_bt8xx_card *card = (struct dvb_bt8xx_card *) fe->dvb->priv;
u8 cfg, cpump, band_select;
u8 data[4];
u32 div;
struct i2c_msg msg = { .addr = 0x60, .flags = 0, .buf = data, .len = sizeof(data) };
- div = (36000000 + params->frequency + 83333) / 166666;
+ div = (36000000 + c->frequency + 83333) / 166666;
cfg = 0x88;
- if (params->frequency < 175000000)
+ if (c->frequency < 175000000)
cpump = 2;
- else if (params->frequency < 390000000)
+ else if (c->frequency < 390000000)
cpump = 1;
- else if (params->frequency < 470000000)
+ else if (c->frequency < 470000000)
cpump = 2;
- else if (params->frequency < 750000000)
+ else if (c->frequency < 750000000)
cpump = 2;
else
cpump = 3;
- if (params->frequency < 175000000)
+ if (c->frequency < 175000000)
band_select = 0x0e;
- else if (params->frequency < 470000000)
+ else if (c->frequency < 470000000)
band_select = 0x05;
else
band_select = 0x03;
@@ -463,23 +463,24 @@ static struct or51211_config or51211_config = {
static int vp3021_alps_tded4_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters* params)
{
+ struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct dvb_bt8xx_card *card = (struct dvb_bt8xx_card *) fe->dvb->priv;
u8 buf[4];
u32 div;
struct i2c_msg msg = { .addr = 0x60, .flags = 0, .buf = buf, .len = sizeof(buf) };
- div = (params->frequency + 36166667) / 166667;
+ div = (c->frequency + 36166667) / 166667;
buf[0] = (div >> 8) & 0x7F;
buf[1] = div & 0xFF;
buf[2] = 0x85;
- if ((params->frequency >= 47000000) && (params->frequency < 153000000))
+ if ((c->frequency >= 47000000) && (c->frequency < 153000000))
buf[3] = 0x01;
- else if ((params->frequency >= 153000000) && (params->frequency < 430000000))
+ else if ((c->frequency >= 153000000) && (c->frequency < 430000000))
buf[3] = 0x02;
- else if ((params->frequency >= 430000000) && (params->frequency < 824000000))
+ else if ((c->frequency >= 430000000) && (c->frequency < 824000000))
buf[3] = 0x0C;
- else if ((params->frequency >= 824000000) && (params->frequency < 863000000))
+ else if ((c->frequency >= 824000000) && (c->frequency < 863000000))
buf[3] = 0x8C;
else
return -EINVAL;
--
1.7.8.352.g876a6
^ permalink raw reply related [flat|nested] 51+ messages in thread
* [PATCH v4 39/47] [media] dvb-pll: use DVBv5 parameters on set_params()
2011-12-24 15:50 ` [PATCH v4 38/47] [media] dvb-bt8xx: " Mauro Carvalho Chehab
@ 2011-12-24 15:50 ` Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 40/47] [media] zl10036: " Mauro Carvalho Chehab
0 siblings, 1 reply; 51+ messages in thread
From: Mauro Carvalho Chehab @ 2011-12-24 15:50 UTC (permalink / raw)
Cc: Mauro Carvalho Chehab, Linux Media Mailing List
Instead of using DVBv3 parameters, rely on DVBv5 parameters to
set the tuner.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
drivers/media/dvb/frontends/dvb-pll.c | 61 +++++++++++++++++---------------
1 files changed, 32 insertions(+), 29 deletions(-)
diff --git a/drivers/media/dvb/frontends/dvb-pll.c b/drivers/media/dvb/frontends/dvb-pll.c
index 62a65ef..4ed7bee 100644
--- a/drivers/media/dvb/frontends/dvb-pll.c
+++ b/drivers/media/dvb/frontends/dvb-pll.c
@@ -61,8 +61,7 @@ struct dvb_pll_desc {
u32 min;
u32 max;
u32 iffreq;
- void (*set)(struct dvb_frontend *fe, u8 *buf,
- const struct dvb_frontend_parameters *params);
+ void (*set)(struct dvb_frontend *fe, u8 *buf);
u8 *initdata;
u8 *initdata2;
u8 *sleepdata;
@@ -93,10 +92,10 @@ static struct dvb_pll_desc dvb_pll_thomson_dtt7579 = {
},
};
-static void thomson_dtt759x_bw(struct dvb_frontend *fe, u8 *buf,
- const struct dvb_frontend_parameters *params)
+static void thomson_dtt759x_bw(struct dvb_frontend *fe, u8 *buf)
{
- if (BANDWIDTH_7_MHZ == params->u.ofdm.bandwidth)
+ u32 bw = fe->dtv_property_cache.bandwidth_hz;
+ if (bw == 7000000)
buf[3] |= 0x10;
}
@@ -186,10 +185,10 @@ static struct dvb_pll_desc dvb_pll_env57h1xd5 = {
/* Philips TDA6650/TDA6651
* used in Panasonic ENV77H11D5
*/
-static void tda665x_bw(struct dvb_frontend *fe, u8 *buf,
- const struct dvb_frontend_parameters *params)
+static void tda665x_bw(struct dvb_frontend *fe, u8 *buf)
{
- if (params->u.ofdm.bandwidth == BANDWIDTH_8_MHZ)
+ u32 bw = fe->dtv_property_cache.bandwidth_hz;
+ if (bw == 8000000)
buf[3] |= 0x08;
}
@@ -220,10 +219,10 @@ static struct dvb_pll_desc dvb_pll_tda665x = {
/* Infineon TUA6034
* used in LG TDTP E102P
*/
-static void tua6034_bw(struct dvb_frontend *fe, u8 *buf,
- const struct dvb_frontend_parameters *params)
+static void tua6034_bw(struct dvb_frontend *fe, u8 *buf)
{
- if (BANDWIDTH_7_MHZ != params->u.ofdm.bandwidth)
+ u32 bw = fe->dtv_property_cache.bandwidth_hz;
+ if (bw == 7000000)
buf[3] |= 0x08;
}
@@ -244,10 +243,10 @@ static struct dvb_pll_desc dvb_pll_tua6034 = {
/* ALPS TDED4
* used in Nebula-Cards and USB boxes
*/
-static void tded4_bw(struct dvb_frontend *fe, u8 *buf,
- const struct dvb_frontend_parameters *params)
+static void tded4_bw(struct dvb_frontend *fe, u8 *buf)
{
- if (params->u.ofdm.bandwidth == BANDWIDTH_8_MHZ)
+ u32 bw = fe->dtv_property_cache.bandwidth_hz;
+ if (bw == 8000000)
buf[3] |= 0x04;
}
@@ -319,11 +318,11 @@ static struct dvb_pll_desc dvb_pll_philips_sd1878_tda8261 = {
},
};
-static void opera1_bw(struct dvb_frontend *fe, u8 *buf,
- const struct dvb_frontend_parameters *params)
+static void opera1_bw(struct dvb_frontend *fe, u8 *buf)
{
+ struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct dvb_pll_priv *priv = fe->tuner_priv;
- u32 b_w = (params->u.qpsk.symbol_rate * 27) / 32000;
+ u32 b_w = (c->symbol_rate * 27) / 32000;
struct i2c_msg msg = {
.addr = priv->pll_i2c_address,
.flags = 0,
@@ -392,8 +391,7 @@ static struct dvb_pll_desc dvb_pll_opera1 = {
}
};
-static void samsung_dtos403ih102a_set(struct dvb_frontend *fe, u8 *buf,
- const struct dvb_frontend_parameters *params)
+static void samsung_dtos403ih102a_set(struct dvb_frontend *fe, u8 *buf)
{
struct dvb_pll_priv *priv = fe->tuner_priv;
struct i2c_msg msg = {
@@ -537,30 +535,29 @@ static struct dvb_pll_desc *pll_list[] = {
/* code */
static int dvb_pll_configure(struct dvb_frontend *fe, u8 *buf,
- const struct dvb_frontend_parameters *params)
+ const u32 frequency)
{
struct dvb_pll_priv *priv = fe->tuner_priv;
struct dvb_pll_desc *desc = priv->pll_desc;
u32 div;
int i;
- if (params->frequency != 0 && (params->frequency < desc->min ||
- params->frequency > desc->max))
+ if (frequency && (frequency < desc->min || frequency > desc->max))
return -EINVAL;
for (i = 0; i < desc->count; i++) {
- if (params->frequency > desc->entries[i].limit)
+ if (frequency > desc->entries[i].limit)
continue;
break;
}
if (debug)
printk("pll: %s: freq=%d | i=%d/%d\n", desc->name,
- params->frequency, i, desc->count);
+ frequency, i, desc->count);
if (i == desc->count)
return -EINVAL;
- div = (params->frequency + desc->iffreq +
+ div = (frequency + desc->iffreq +
desc->entries[i].stepsize/2) / desc->entries[i].stepsize;
buf[0] = div >> 8;
buf[1] = div & 0xff;
@@ -568,7 +565,7 @@ static int dvb_pll_configure(struct dvb_frontend *fe, u8 *buf,
buf[3] = desc->entries[i].cb;
if (desc->set)
- desc->set(fe, buf, params);
+ desc->set(fe, buf);
if (debug)
printk("pll: %s: div=%d | buf=0x%02x,0x%02x,0x%02x,0x%02x\n",
@@ -614,6 +611,7 @@ static int dvb_pll_sleep(struct dvb_frontend *fe)
static int dvb_pll_set_params(struct dvb_frontend *fe,
struct dvb_frontend_parameters *params)
{
+ struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct dvb_pll_priv *priv = fe->tuner_priv;
u8 buf[4];
struct i2c_msg msg =
@@ -625,7 +623,7 @@ static int dvb_pll_set_params(struct dvb_frontend *fe,
if (priv->i2c == NULL)
return -EINVAL;
- if ((result = dvb_pll_configure(fe, buf, params)) < 0)
+ if ((result = dvb_pll_configure(fe, buf, c->frequency)) < 0)
return result;
else
frequency = result;
@@ -637,7 +635,12 @@ static int dvb_pll_set_params(struct dvb_frontend *fe,
}
priv->frequency = frequency;
- priv->bandwidth = (fe->ops.info.type == FE_OFDM) ? params->u.ofdm.bandwidth : 0;
+ if (c->bandwidth_hz <= 6000000)
+ priv->bandwidth = BANDWIDTH_6_MHZ;
+ else if (c->bandwidth_hz <= 7000000)
+ priv->bandwidth = BANDWIDTH_7_MHZ;
+ if (c->bandwidth_hz <= 8000000)
+ priv->bandwidth = BANDWIDTH_8_MHZ;
return 0;
}
@@ -653,7 +656,7 @@ static int dvb_pll_calc_regs(struct dvb_frontend *fe,
if (buf_len < 5)
return -EINVAL;
- if ((result = dvb_pll_configure(fe, buf+1, params)) < 0)
+ if ((result = dvb_pll_configure(fe, buf+1, params->frequency)) < 0)
return result;
else
frequency = result;
--
1.7.8.352.g876a6
^ permalink raw reply related [flat|nested] 51+ messages in thread
* [PATCH v4 40/47] [media] zl10036: use DVBv5 parameters on set_params()
2011-12-24 15:50 ` [PATCH v4 39/47] [media] dvb-pll: " Mauro Carvalho Chehab
@ 2011-12-24 15:50 ` Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 41/47] [media] dib0070: Remove unused dvb_frontend_parameters Mauro Carvalho Chehab
0 siblings, 1 reply; 51+ messages in thread
From: Mauro Carvalho Chehab @ 2011-12-24 15:50 UTC (permalink / raw)
Cc: Mauro Carvalho Chehab, Linux Media Mailing List
Instead of using DVBv3 parameters, rely on DVBv5 parameters to
set the tuner
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
drivers/media/dvb/frontends/zl10036.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/media/dvb/frontends/zl10036.c b/drivers/media/dvb/frontends/zl10036.c
index 81aa984..129d0f2 100644
--- a/drivers/media/dvb/frontends/zl10036.c
+++ b/drivers/media/dvb/frontends/zl10036.c
@@ -308,9 +308,10 @@ static int zl10036_set_gain_params(struct zl10036_state *state,
static int zl10036_set_params(struct dvb_frontend *fe,
struct dvb_frontend_parameters *params)
{
+ struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct zl10036_state *state = fe->tuner_priv;
int ret = 0;
- u32 frequency = params->frequency;
+ u32 frequency = p->frequency;
u32 fbw;
int i;
u8 c;
@@ -326,7 +327,7 @@ static int zl10036_set_params(struct dvb_frontend *fe,
* fBW = (alpha*symbolrate)/(2*0.8)
* 1.35 / (2*0.8) = 27 / 32
*/
- fbw = (27 * params->u.qpsk.symbol_rate) / 32;
+ fbw = (27 * p->symbol_rate) / 32;
/* scale to kHz */
fbw /= 1000;
@@ -353,7 +354,7 @@ static int zl10036_set_params(struct dvb_frontend *fe,
if (ret < 0)
goto error;
- ret = zl10036_set_frequency(state, params->frequency);
+ ret = zl10036_set_frequency(state, p->frequency);
if (ret < 0)
goto error;
--
1.7.8.352.g876a6
^ permalink raw reply related [flat|nested] 51+ messages in thread
* [PATCH v4 41/47] [media] dib0070: Remove unused dvb_frontend_parameters
2011-12-24 15:50 ` [PATCH v4 40/47] [media] zl10036: " Mauro Carvalho Chehab
@ 2011-12-24 15:50 ` Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 42/47] [media] cxusb: use DVBv5 parameters on set_params() Mauro Carvalho Chehab
0 siblings, 1 reply; 51+ messages in thread
From: Mauro Carvalho Chehab @ 2011-12-24 15:50 UTC (permalink / raw)
Cc: Mauro Carvalho Chehab, Linux Media Mailing List
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
drivers/media/dvb/frontends/dib0070.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/media/dvb/frontends/dib0070.c b/drivers/media/dvb/frontends/dib0070.c
index dc1cb17..4ca3441 100644
--- a/drivers/media/dvb/frontends/dib0070.c
+++ b/drivers/media/dvb/frontends/dib0070.c
@@ -150,7 +150,7 @@ static int dib0070_write_reg(struct dib0070_state *state, u8 reg, u16 val)
} \
} while (0)
-static int dib0070_set_bandwidth(struct dvb_frontend *fe, struct dvb_frontend_parameters *ch)
+static int dib0070_set_bandwidth(struct dvb_frontend *fe)
{
struct dib0070_state *state = fe->tuner_priv;
u16 tmp = dib0070_read_reg(state, 0x02) & 0x3fff;
@@ -335,7 +335,7 @@ static const struct dib0070_lna_match dib0070_lna[] = {
};
#define LPF 100
-static int dib0070_tune_digital(struct dvb_frontend *fe, struct dvb_frontend_parameters *ch)
+static int dib0070_tune_digital(struct dvb_frontend *fe)
{
struct dib0070_state *state = fe->tuner_priv;
@@ -507,7 +507,7 @@ static int dib0070_tune_digital(struct dvb_frontend *fe, struct dvb_frontend_par
*tune_state = CT_TUNER_STEP_5;
} else if (*tune_state == CT_TUNER_STEP_5) {
- dib0070_set_bandwidth(fe, ch);
+ dib0070_set_bandwidth(fe);
*tune_state = CT_TUNER_STOP;
} else {
ret = FE_CALLBACK_TIME_NEVER; /* tuner finished, time to call again infinite */
@@ -524,7 +524,7 @@ static int dib0070_tune(struct dvb_frontend *fe, struct dvb_frontend_parameters
state->tune_state = CT_TUNER_START;
do {
- ret = dib0070_tune_digital(fe, p);
+ ret = dib0070_tune_digital(fe);
if (ret != FE_CALLBACK_TIME_NEVER)
msleep(ret/10);
else
--
1.7.8.352.g876a6
^ permalink raw reply related [flat|nested] 51+ messages in thread
* [PATCH v4 42/47] [media] cxusb: use DVBv5 parameters on set_params()
2011-12-24 15:50 ` [PATCH v4 41/47] [media] dib0070: Remove unused dvb_frontend_parameters Mauro Carvalho Chehab
@ 2011-12-24 15:50 ` Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 43/47] [media] dib0700_devices: " Mauro Carvalho Chehab
0 siblings, 1 reply; 51+ messages in thread
From: Mauro Carvalho Chehab @ 2011-12-24 15:50 UTC (permalink / raw)
Cc: Mauro Carvalho Chehab, Linux Media Mailing List
Instead of using DVBv3 parameters, rely on DVBv5 parameters to
set the tuner
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
drivers/media/dvb/dvb-usb/cxusb.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/media/dvb/dvb-usb/cxusb.c b/drivers/media/dvb/dvb-usb/cxusb.c
index 9f2a02c..4f9bfc5 100644
--- a/drivers/media/dvb/dvb-usb/cxusb.c
+++ b/drivers/media/dvb/dvb-usb/cxusb.c
@@ -1074,11 +1074,12 @@ struct dib0700_adapter_state {
static int dib7070_set_param_override(struct dvb_frontend *fe,
struct dvb_frontend_parameters *fep)
{
+ struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct dvb_usb_adapter *adap = fe->dvb->priv;
struct dib0700_adapter_state *state = adap->priv;
u16 offset;
- u8 band = BAND_OF_FREQUENCY(fep->frequency/1000);
+ u8 band = BAND_OF_FREQUENCY(p->frequency/1000);
switch (band) {
case BAND_VHF: offset = 950; break;
default:
--
1.7.8.352.g876a6
^ permalink raw reply related [flat|nested] 51+ messages in thread
* [PATCH v4 43/47] [media] dib0700_devices: use DVBv5 parameters on set_params()
2011-12-24 15:50 ` [PATCH v4 42/47] [media] cxusb: use DVBv5 parameters on set_params() Mauro Carvalho Chehab
@ 2011-12-24 15:50 ` Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 44/47] [media] budget-av: " Mauro Carvalho Chehab
0 siblings, 1 reply; 51+ messages in thread
From: Mauro Carvalho Chehab @ 2011-12-24 15:50 UTC (permalink / raw)
Cc: Mauro Carvalho Chehab, Linux Media Mailing List
Instead of using DVBv3 parameters, rely on DVBv5 parameters to
set the tuner
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
drivers/media/dvb/dvb-usb/dib0700_devices.c | 19 ++++++++++++-------
1 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/drivers/media/dvb/dvb-usb/dib0700_devices.c b/drivers/media/dvb/dvb-usb/dib0700_devices.c
index d0174fd..70c3be6 100644
--- a/drivers/media/dvb/dvb-usb/dib0700_devices.c
+++ b/drivers/media/dvb/dvb-usb/dib0700_devices.c
@@ -806,11 +806,12 @@ static struct dib0070_config dib7770p_dib0070_config = {
static int dib7070_set_param_override(struct dvb_frontend *fe, struct dvb_frontend_parameters *fep)
{
+ struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct dvb_usb_adapter *adap = fe->dvb->priv;
struct dib0700_adapter_state *state = adap->priv;
u16 offset;
- u8 band = BAND_OF_FREQUENCY(fep->frequency/1000);
+ u8 band = BAND_OF_FREQUENCY(p->frequency/1000);
switch (band) {
case BAND_VHF: offset = 950; break;
case BAND_UHF:
@@ -824,11 +825,12 @@ static int dib7070_set_param_override(struct dvb_frontend *fe, struct dvb_fronte
static int dib7770_set_param_override(struct dvb_frontend *fe,
struct dvb_frontend_parameters *fep)
{
- struct dvb_usb_adapter *adap = fe->dvb->priv;
- struct dib0700_adapter_state *state = adap->priv;
+ struct dtv_frontend_properties *p = &fe->dtv_property_cache;
+ struct dvb_usb_adapter *adap = fe->dvb->priv;
+ struct dib0700_adapter_state *state = adap->priv;
u16 offset;
- u8 band = BAND_OF_FREQUENCY(fep->frequency/1000);
+ u8 band = BAND_OF_FREQUENCY(p->frequency/1000);
switch (band) {
case BAND_VHF:
dib7000p_set_gpio(fe, 0, 0, 1);
@@ -1208,11 +1210,12 @@ static struct dib0070_config dib807x_dib0070_config[2] = {
static int dib807x_set_param_override(struct dvb_frontend *fe,
struct dvb_frontend_parameters *fep)
{
+ struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct dvb_usb_adapter *adap = fe->dvb->priv;
struct dib0700_adapter_state *state = adap->priv;
u16 offset = dib0070_wbd_offset(fe);
- u8 band = BAND_OF_FREQUENCY(fep->frequency/1000);
+ u8 band = BAND_OF_FREQUENCY(p->frequency/1000);
switch (band) {
case BAND_VHF:
offset += 750;
@@ -1506,9 +1509,10 @@ static struct dib0090_config dib809x_dib0090_config = {
static int dib8096_set_param_override(struct dvb_frontend *fe,
struct dvb_frontend_parameters *fep)
{
+ struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct dvb_usb_adapter *adap = fe->dvb->priv;
struct dib0700_adapter_state *state = adap->priv;
- u8 band = BAND_OF_FREQUENCY(fep->frequency/1000);
+ u8 band = BAND_OF_FREQUENCY(p->frequency/1000);
u16 target;
int ret = 0;
enum frontend_tune_state tune_state = CT_SHUTDOWN;
@@ -1822,6 +1826,7 @@ struct dibx090p_adc dib8090p_adc_tab[] = {
static int dib8096p_agc_startup(struct dvb_frontend *fe,
struct dvb_frontend_parameters *fep)
{
+ struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct dvb_usb_adapter *adap = fe->dvb->priv;
struct dib0700_adapter_state *state = adap->priv;
struct dibx000_bandwidth_config pll;
@@ -1841,7 +1846,7 @@ static int dib8096p_agc_startup(struct dvb_frontend *fe,
dib8000_set_wbd_ref(fe, target);
- while (fep->frequency / 1000 > adc_table->freq) {
+ while (p->frequency / 1000 > adc_table->freq) {
better_sampling_freq = 1;
adc_table++;
}
--
1.7.8.352.g876a6
^ permalink raw reply related [flat|nested] 51+ messages in thread
* [PATCH v4 44/47] [media] budget-av: use DVBv5 parameters on set_params()
2011-12-24 15:50 ` [PATCH v4 43/47] [media] dib0700_devices: " Mauro Carvalho Chehab
@ 2011-12-24 15:50 ` Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 45/47] [media] budget: " Mauro Carvalho Chehab
0 siblings, 1 reply; 51+ messages in thread
From: Mauro Carvalho Chehab @ 2011-12-24 15:50 UTC (permalink / raw)
Cc: Mauro Carvalho Chehab, Linux Media Mailing List
Instead of using DVBv3 parameters, rely on DVBv5 parameters to
set the tuner
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
drivers/media/dvb/ttpci/budget-av.c | 43 ++++++++++++++++++----------------
1 files changed, 23 insertions(+), 20 deletions(-)
diff --git a/drivers/media/dvb/ttpci/budget-av.c b/drivers/media/dvb/ttpci/budget-av.c
index 78d32f7..ef03777 100644
--- a/drivers/media/dvb/ttpci/budget-av.c
+++ b/drivers/media/dvb/ttpci/budget-av.c
@@ -505,30 +505,31 @@ static int philips_su1278_ty_ci_set_symbol_rate(struct dvb_frontend *fe, u32 sra
static int philips_su1278_ty_ci_tuner_set_params(struct dvb_frontend *fe,
struct dvb_frontend_parameters *params)
{
+ struct dtv_frontend_properties *c = &fe->dtv_property_cache;
u32 div;
u8 buf[4];
struct budget *budget = (struct budget *) fe->dvb->priv;
struct i2c_msg msg = {.addr = 0x61,.flags = 0,.buf = buf,.len = sizeof(buf) };
- if ((params->frequency < 950000) || (params->frequency > 2150000))
+ if ((c->frequency < 950000) || (c->frequency > 2150000))
return -EINVAL;
- div = (params->frequency + (125 - 1)) / 125; // round correctly
+ div = (c->frequency + (125 - 1)) / 125; // round correctly
buf[0] = (div >> 8) & 0x7f;
buf[1] = div & 0xff;
buf[2] = 0x80 | ((div & 0x18000) >> 10) | 4;
buf[3] = 0x20;
- if (params->u.qpsk.symbol_rate < 4000000)
+ if (c->symbol_rate < 4000000)
buf[3] |= 1;
- if (params->frequency < 1250000)
+ if (c->frequency < 1250000)
buf[3] |= 0;
- else if (params->frequency < 1550000)
+ else if (c->frequency < 1550000)
buf[3] |= 0x40;
- else if (params->frequency < 2050000)
+ else if (c->frequency < 2050000)
buf[3] |= 0x80;
- else if (params->frequency < 2150000)
+ else if (c->frequency < 2150000)
buf[3] |= 0xC0;
if (fe->ops.i2c_gate_ctrl)
@@ -619,6 +620,7 @@ static struct stv0299_config cinergy_1200s_1894_0010_config = {
static int philips_cu1216_tuner_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
{
+ struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct budget *budget = (struct budget *) fe->dvb->priv;
u8 buf[6];
struct i2c_msg msg = {.addr = 0x60,.flags = 0,.buf = buf,.len = sizeof(buf) };
@@ -627,13 +629,13 @@ static int philips_cu1216_tuner_set_params(struct dvb_frontend *fe, struct dvb_f
#define CU1216_IF 36125000
#define TUNER_MUL 62500
- u32 div = (params->frequency + CU1216_IF + TUNER_MUL / 2) / TUNER_MUL;
+ u32 div = (c->frequency + CU1216_IF + TUNER_MUL / 2) / TUNER_MUL;
buf[0] = (div >> 8) & 0x7f;
buf[1] = div & 0xff;
buf[2] = 0xce;
- buf[3] = (params->frequency < 150000000 ? 0x01 :
- params->frequency < 445000000 ? 0x02 : 0x04);
+ buf[3] = (c->frequency < 150000000 ? 0x01 :
+ c->frequency < 445000000 ? 0x02 : 0x04);
buf[4] = 0xde;
buf[5] = 0x20;
@@ -699,6 +701,7 @@ static int philips_tu1216_tuner_init(struct dvb_frontend *fe)
static int philips_tu1216_tuner_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
{
+ struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct budget *budget = (struct budget *) fe->dvb->priv;
u8 tuner_buf[4];
struct i2c_msg tuner_msg = {.addr = 0x60,.flags = 0,.buf = tuner_buf,.len =
@@ -707,7 +710,7 @@ static int philips_tu1216_tuner_set_params(struct dvb_frontend *fe, struct dvb_f
u8 band, cp, filter;
// determine charge pump
- tuner_frequency = params->frequency + 36166000;
+ tuner_frequency = c->frequency + 36166000;
if (tuner_frequency < 87000000)
return -EINVAL;
else if (tuner_frequency < 130000000)
@@ -732,28 +735,28 @@ static int philips_tu1216_tuner_set_params(struct dvb_frontend *fe, struct dvb_f
return -EINVAL;
// determine band
- if (params->frequency < 49000000)
+ if (c->frequency < 49000000)
return -EINVAL;
- else if (params->frequency < 161000000)
+ else if (c->frequency < 161000000)
band = 1;
- else if (params->frequency < 444000000)
+ else if (c->frequency < 444000000)
band = 2;
- else if (params->frequency < 861000000)
+ else if (c->frequency < 861000000)
band = 4;
else
return -EINVAL;
// setup PLL filter
- switch (params->u.ofdm.bandwidth) {
- case BANDWIDTH_6_MHZ:
+ switch (c->bandwidth_hz) {
+ case 6000000:
filter = 0;
break;
- case BANDWIDTH_7_MHZ:
+ case 7000000:
filter = 0;
break;
- case BANDWIDTH_8_MHZ:
+ case 8000000:
filter = 1;
break;
@@ -763,7 +766,7 @@ static int philips_tu1216_tuner_set_params(struct dvb_frontend *fe, struct dvb_f
// calculate divisor
// ((36166000+((1000000/6)/2)) + Finput)/(1000000/6)
- tuner_frequency = (((params->frequency / 1000) * 6) + 217496) / 1000;
+ tuner_frequency = (((c->frequency / 1000) * 6) + 217496) / 1000;
// setup tuner buffer
tuner_buf[0] = (tuner_frequency >> 8) & 0x7f;
--
1.7.8.352.g876a6
^ permalink raw reply related [flat|nested] 51+ messages in thread
* [PATCH v4 45/47] [media] budget: use DVBv5 parameters on set_params()
2011-12-24 15:50 ` [PATCH v4 44/47] [media] budget-av: " Mauro Carvalho Chehab
@ 2011-12-24 15:50 ` Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 46/47] [media] dvb: remove dvb_frontend_parameters from calc_regs() Mauro Carvalho Chehab
0 siblings, 1 reply; 51+ messages in thread
From: Mauro Carvalho Chehab @ 2011-12-24 15:50 UTC (permalink / raw)
Cc: Mauro Carvalho Chehab, Linux Media Mailing List
Instead of using DVBv3 parameters, rely on DVBv5 parameters to
set the tuner
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
drivers/media/dvb/ttpci/budget.c | 39 +++++++++++++++++++++----------------
1 files changed, 22 insertions(+), 17 deletions(-)
diff --git a/drivers/media/dvb/ttpci/budget.c b/drivers/media/dvb/ttpci/budget.c
index d238fb9..719b965 100644
--- a/drivers/media/dvb/ttpci/budget.c
+++ b/drivers/media/dvb/ttpci/budget.c
@@ -202,17 +202,18 @@ static int budget_diseqc_send_burst(struct dvb_frontend* fe, fe_sec_mini_cmd_t m
static int alps_bsrv2_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters* params)
{
+ struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct budget* budget = (struct budget*) fe->dvb->priv;
u8 pwr = 0;
u8 buf[4];
struct i2c_msg msg = { .addr = 0x61, .flags = 0, .buf = buf, .len = sizeof(buf) };
- u32 div = (params->frequency + 479500) / 125;
+ u32 div = (c->frequency + 479500) / 125;
- if (params->frequency > 2000000) pwr = 3;
- else if (params->frequency > 1800000) pwr = 2;
- else if (params->frequency > 1600000) pwr = 1;
- else if (params->frequency > 1200000) pwr = 0;
- else if (params->frequency >= 1100000) pwr = 1;
+ if (c->frequency > 2000000) pwr = 3;
+ else if (c->frequency > 1800000) pwr = 2;
+ else if (c->frequency > 1600000) pwr = 1;
+ else if (c->frequency > 1200000) pwr = 0;
+ else if (c->frequency >= 1100000) pwr = 1;
else pwr = 2;
buf[0] = (div >> 8) & 0x7f;
@@ -238,17 +239,18 @@ static struct ves1x93_config alps_bsrv2_config =
static int alps_tdbe2_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters* params)
{
+ struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct budget* budget = (struct budget*) fe->dvb->priv;
u32 div;
u8 data[4];
struct i2c_msg msg = { .addr = 0x62, .flags = 0, .buf = data, .len = sizeof(data) };
- div = (params->frequency + 35937500 + 31250) / 62500;
+ div = (c->frequency + 35937500 + 31250) / 62500;
data[0] = (div >> 8) & 0x7f;
data[1] = div & 0xff;
data[2] = 0x85 | ((div >> 10) & 0x60);
- data[3] = (params->frequency < 174000000 ? 0x88 : params->frequency < 470000000 ? 0x84 : 0x81);
+ data[3] = (c->frequency < 174000000 ? 0x88 : c->frequency < 470000000 ? 0x84 : 0x81);
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1);
@@ -265,6 +267,7 @@ static struct ves1820_config alps_tdbe2_config = {
static int grundig_29504_401_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters* params)
{
+ struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct budget *budget = fe->dvb->priv;
u8 *tuner_addr = fe->tuner_priv;
u32 div;
@@ -277,18 +280,18 @@ static int grundig_29504_401_tuner_set_params(struct dvb_frontend* fe, struct dv
else
msg.addr = 0x61;
- div = (36125000 + params->frequency) / 166666;
+ div = (36125000 + c->frequency) / 166666;
cfg = 0x88;
- if (params->frequency < 175000000) cpump = 2;
- else if (params->frequency < 390000000) cpump = 1;
- else if (params->frequency < 470000000) cpump = 2;
- else if (params->frequency < 750000000) cpump = 1;
+ if (c->frequency < 175000000) cpump = 2;
+ else if (c->frequency < 390000000) cpump = 1;
+ else if (c->frequency < 470000000) cpump = 2;
+ else if (c->frequency < 750000000) cpump = 1;
else cpump = 3;
- if (params->frequency < 175000000) band_select = 0x0e;
- else if (params->frequency < 470000000) band_select = 0x05;
+ if (c->frequency < 175000000) band_select = 0x0e;
+ else if (c->frequency < 470000000) band_select = 0x05;
else band_select = 0x03;
data[0] = (div >> 8) & 0x7f;
@@ -314,12 +317,13 @@ static u8 tuner_address_grundig_29504_401_activy = 0x60;
static int grundig_29504_451_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters* params)
{
+ struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct budget* budget = (struct budget*) fe->dvb->priv;
u32 div;
u8 data[4];
struct i2c_msg msg = { .addr = 0x61, .flags = 0, .buf = data, .len = sizeof(data) };
- div = params->frequency / 125;
+ div = c->frequency / 125;
data[0] = (div >> 8) & 0x7f;
data[1] = div & 0xff;
data[2] = 0x8e;
@@ -337,12 +341,13 @@ static struct tda8083_config grundig_29504_451_config = {
static int s5h1420_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters* params)
{
+ struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct budget* budget = (struct budget*) fe->dvb->priv;
u32 div;
u8 data[4];
struct i2c_msg msg = { .addr = 0x61, .flags = 0, .buf = data, .len = sizeof(data) };
- div = params->frequency / 1000;
+ div = c->frequency / 1000;
data[0] = (div >> 8) & 0x7f;
data[1] = div & 0xff;
data[2] = 0xc2;
--
1.7.8.352.g876a6
^ permalink raw reply related [flat|nested] 51+ messages in thread
* [PATCH v4 46/47] [media] dvb: remove dvb_frontend_parameters from calc_regs()
2011-12-24 15:50 ` [PATCH v4 45/47] [media] budget: " Mauro Carvalho Chehab
@ 2011-12-24 15:50 ` Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 47/47] [media] tuners: remove dvb_frontend_parameters from set_params() Mauro Carvalho Chehab
0 siblings, 1 reply; 51+ messages in thread
From: Mauro Carvalho Chehab @ 2011-12-24 15:50 UTC (permalink / raw)
Cc: Mauro Carvalho Chehab, Linux Media Mailing List
The calc_regs() callback is used by a few frontends (mt352, nxt200x,
digitv and zl10353). On all places it is called, the parameters are
set by DVBv5 way. So, just use the DVBv5 struct and remove the
extra parameter.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
drivers/media/common/tuners/tuner-simple.c | 31 ++++++--------
drivers/media/dvb/bt8xx/dvb-bt8xx.c | 64 ++++++++++++++-------------
drivers/media/dvb/dvb-core/dvb_frontend.h | 2 +-
drivers/media/dvb/dvb-usb/digitv.c | 2 +-
drivers/media/dvb/frontends/dvb-pll.c | 6 +-
drivers/media/dvb/frontends/mt352.c | 2 +-
drivers/media/dvb/frontends/nxt200x.c | 2 +-
drivers/media/dvb/frontends/zl10353.c | 2 +-
8 files changed, 54 insertions(+), 57 deletions(-)
diff --git a/drivers/media/common/tuners/tuner-simple.c b/drivers/media/common/tuners/tuner-simple.c
index e6342db..1dad5fb 100644
--- a/drivers/media/common/tuners/tuner-simple.c
+++ b/drivers/media/common/tuners/tuner-simple.c
@@ -884,7 +884,6 @@ static u32 simple_dvb_configure(struct dvb_frontend *fe, u8 *buf,
}
static int simple_dvb_calc_regs(struct dvb_frontend *fe,
- struct dvb_frontend_parameters *params,
u8 *buf, int buf_len)
{
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
@@ -896,28 +895,14 @@ static int simple_dvb_calc_regs(struct dvb_frontend *fe,
if (buf_len < 5)
return -EINVAL;
- switch (delsys) {
- case SYS_DVBT:
- case SYS_DVBT2:
- if (params->u.ofdm.bandwidth == BANDWIDTH_6_MHZ)
- bw = 6000000;
- if (params->u.ofdm.bandwidth == BANDWIDTH_7_MHZ)
- bw = 7000000;
- if (params->u.ofdm.bandwidth == BANDWIDTH_8_MHZ)
- bw = 8000000;
- break;
- default:
- break;
- }
- frequency = simple_dvb_configure(fe, buf+1, delsys, params->frequency, bw);
+ frequency = simple_dvb_configure(fe, buf+1, delsys, c->frequency, bw);
if (frequency == 0)
return -EINVAL;
buf[0] = priv->i2c_props.addr;
priv->frequency = frequency;
- priv->bandwidth = (fe->ops.info.type == FE_OFDM) ?
- params->u.ofdm.bandwidth : 0;
+ priv->bandwidth = c->bandwidth_hz;
return 5;
}
@@ -1044,7 +1029,17 @@ static int simple_get_frequency(struct dvb_frontend *fe, u32 *frequency)
static int simple_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth)
{
struct tuner_simple_priv *priv = fe->tuner_priv;
- *bandwidth = priv->bandwidth;
+ switch (priv->bandwidth) {
+ case 6000000:
+ *bandwidth = BANDWIDTH_6_MHZ;
+ break;
+ case 7000000:
+ *bandwidth = BANDWIDTH_7_MHZ;
+ break;
+ case 8000000:
+ *bandwidth = BANDWIDTH_8_MHZ;
+ break;
+ }
return 0;
}
diff --git a/drivers/media/dvb/bt8xx/dvb-bt8xx.c b/drivers/media/dvb/bt8xx/dvb-bt8xx.c
index 5948601..8275d7e 100644
--- a/drivers/media/dvb/bt8xx/dvb-bt8xx.c
+++ b/drivers/media/dvb/bt8xx/dvb-bt8xx.c
@@ -148,8 +148,9 @@ static int thomson_dtt7579_demod_init(struct dvb_frontend* fe)
return 0;
}
-static int thomson_dtt7579_tuner_calc_regs(struct dvb_frontend* fe, struct dvb_frontend_parameters* params, u8* pllbuf, int buf_len)
+static int thomson_dtt7579_tuner_calc_regs(struct dvb_frontend* fe, u8* pllbuf, int buf_len)
{
+ struct dtv_frontend_properties *c = &fe->dtv_property_cache;
u32 div;
unsigned char bs = 0;
unsigned char cp = 0;
@@ -157,18 +158,18 @@ static int thomson_dtt7579_tuner_calc_regs(struct dvb_frontend* fe, struct dvb_f
if (buf_len < 5)
return -EINVAL;
- div = (((params->frequency + 83333) * 3) / 500000) + IF_FREQUENCYx6;
+ div = (((c->frequency + 83333) * 3) / 500000) + IF_FREQUENCYx6;
- if (params->frequency < 542000000)
+ if (c->frequency < 542000000)
cp = 0xb4;
- else if (params->frequency < 771000000)
+ else if (c->frequency < 771000000)
cp = 0xbc;
else
cp = 0xf4;
- if (params->frequency == 0)
+ if (c->frequency == 0)
bs = 0x03;
- else if (params->frequency < 443250000)
+ else if (c->frequency < 443250000)
bs = 0x02;
else
bs = 0x08;
@@ -342,50 +343,51 @@ static int advbt771_samsung_tdtc9251dh0_demod_init(struct dvb_frontend* fe)
return 0;
}
-static int advbt771_samsung_tdtc9251dh0_tuner_calc_regs(struct dvb_frontend* fe, struct dvb_frontend_parameters* params, u8* pllbuf, int buf_len)
+static int advbt771_samsung_tdtc9251dh0_tuner_calc_regs(struct dvb_frontend* fe, u8* pllbuf, int buf_len)
{
+ struct dtv_frontend_properties *c = &fe->dtv_property_cache;
u32 div;
unsigned char bs = 0;
unsigned char cp = 0;
if (buf_len < 5) return -EINVAL;
- div = (((params->frequency + 83333) * 3) / 500000) + IF_FREQUENCYx6;
+ div = (((c->frequency + 83333) * 3) / 500000) + IF_FREQUENCYx6;
- if (params->frequency < 150000000)
+ if (c->frequency < 150000000)
cp = 0xB4;
- else if (params->frequency < 173000000)
+ else if (c->frequency < 173000000)
cp = 0xBC;
- else if (params->frequency < 250000000)
+ else if (c->frequency < 250000000)
cp = 0xB4;
- else if (params->frequency < 400000000)
+ else if (c->frequency < 400000000)
cp = 0xBC;
- else if (params->frequency < 420000000)
+ else if (c->frequency < 420000000)
cp = 0xF4;
- else if (params->frequency < 470000000)
+ else if (c->frequency < 470000000)
cp = 0xFC;
- else if (params->frequency < 600000000)
+ else if (c->frequency < 600000000)
cp = 0xBC;
- else if (params->frequency < 730000000)
+ else if (c->frequency < 730000000)
cp = 0xF4;
else
cp = 0xFC;
- if (params->frequency < 150000000)
+ if (c->frequency < 150000000)
bs = 0x01;
- else if (params->frequency < 173000000)
+ else if (c->frequency < 173000000)
bs = 0x01;
- else if (params->frequency < 250000000)
+ else if (c->frequency < 250000000)
bs = 0x02;
- else if (params->frequency < 400000000)
+ else if (c->frequency < 400000000)
bs = 0x02;
- else if (params->frequency < 420000000)
+ else if (c->frequency < 420000000)
bs = 0x02;
- else if (params->frequency < 470000000)
+ else if (c->frequency < 470000000)
bs = 0x02;
- else if (params->frequency < 600000000)
+ else if (c->frequency < 600000000)
bs = 0x08;
- else if (params->frequency < 730000000)
+ else if (c->frequency < 730000000)
bs = 0x08;
else
bs = 0x08;
@@ -514,31 +516,31 @@ static int digitv_alps_tded4_demod_init(struct dvb_frontend* fe)
return 0;
}
-static int digitv_alps_tded4_tuner_calc_regs(struct dvb_frontend* fe, struct dvb_frontend_parameters* params, u8* pllbuf, int buf_len)
+static int digitv_alps_tded4_tuner_calc_regs(struct dvb_frontend* fe, u8* pllbuf, int buf_len)
{
u32 div;
- struct dvb_ofdm_parameters *op = ¶ms->u.ofdm;
+ struct dtv_frontend_properties *c = &fe->dtv_property_cache;
if (buf_len < 5)
return -EINVAL;
- div = (((params->frequency + 83333) * 3) / 500000) + IF_FREQUENCYx6;
+ div = (((c->frequency + 83333) * 3) / 500000) + IF_FREQUENCYx6;
pllbuf[0] = 0x61;
pllbuf[1] = (div >> 8) & 0x7F;
pllbuf[2] = div & 0xFF;
pllbuf[3] = 0x85;
- dprintk("frequency %u, div %u\n", params->frequency, div);
+ dprintk("frequency %u, div %u\n", c->frequency, div);
- if (params->frequency < 470000000)
+ if (c->frequency < 470000000)
pllbuf[4] = 0x02;
- else if (params->frequency > 823000000)
+ else if (c->frequency > 823000000)
pllbuf[4] = 0x88;
else
pllbuf[4] = 0x08;
- if (op->bandwidth == 8)
+ if (c->bandwidth_hz == 8000000)
pllbuf[4] |= 0x04;
return 5;
diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.h b/drivers/media/dvb/dvb-core/dvb_frontend.h
index 67bbfa7..99ae782 100644
--- a/drivers/media/dvb/dvb-core/dvb_frontend.h
+++ b/drivers/media/dvb/dvb-core/dvb_frontend.h
@@ -202,7 +202,7 @@ struct dvb_tuner_ops {
int (*set_analog_params)(struct dvb_frontend *fe, struct analog_parameters *p);
/** This is support for demods like the mt352 - fills out the supplied buffer with what to write. */
- int (*calc_regs)(struct dvb_frontend *fe, struct dvb_frontend_parameters *p, u8 *buf, int buf_len);
+ int (*calc_regs)(struct dvb_frontend *fe, u8 *buf, int buf_len);
/** This is to allow setting tuner-specific configs */
int (*set_config)(struct dvb_frontend *fe, void *priv_cfg);
diff --git a/drivers/media/dvb/dvb-usb/digitv.c b/drivers/media/dvb/dvb-usb/digitv.c
index f718411..2856ab7 100644
--- a/drivers/media/dvb/dvb-usb/digitv.c
+++ b/drivers/media/dvb/dvb-usb/digitv.c
@@ -123,7 +123,7 @@ static int digitv_nxt6000_tuner_set_params(struct dvb_frontend *fe, struct dvb_f
struct dvb_usb_adapter *adap = fe->dvb->priv;
u8 b[5];
- fe->ops.tuner_ops.calc_regs(fe, fep, b, sizeof(b));
+ fe->ops.tuner_ops.calc_regs(fe, b, sizeof(b));
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1);
return digitv_ctrl_msg(adap->dev, USB_WRITE_TUNER, 0, &b[1], 4, NULL, 0);
diff --git a/drivers/media/dvb/frontends/dvb-pll.c b/drivers/media/dvb/frontends/dvb-pll.c
index 4ed7bee..21f425f 100644
--- a/drivers/media/dvb/frontends/dvb-pll.c
+++ b/drivers/media/dvb/frontends/dvb-pll.c
@@ -646,9 +646,9 @@ static int dvb_pll_set_params(struct dvb_frontend *fe,
}
static int dvb_pll_calc_regs(struct dvb_frontend *fe,
- struct dvb_frontend_parameters *params,
u8 *buf, int buf_len)
{
+ struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct dvb_pll_priv *priv = fe->tuner_priv;
int result;
u32 frequency = 0;
@@ -656,7 +656,7 @@ static int dvb_pll_calc_regs(struct dvb_frontend *fe,
if (buf_len < 5)
return -EINVAL;
- if ((result = dvb_pll_configure(fe, buf+1, params->frequency)) < 0)
+ if ((result = dvb_pll_configure(fe, buf+1, c->frequency)) < 0)
return result;
else
frequency = result;
@@ -664,7 +664,7 @@ static int dvb_pll_calc_regs(struct dvb_frontend *fe,
buf[0] = priv->pll_i2c_address;
priv->frequency = frequency;
- priv->bandwidth = (fe->ops.info.type == FE_OFDM) ? params->u.ofdm.bandwidth : 0;
+ priv->bandwidth = c->bandwidth_hz;
return 5;
}
diff --git a/drivers/media/dvb/frontends/mt352.c b/drivers/media/dvb/frontends/mt352.c
index 319672f..e2a86da 100644
--- a/drivers/media/dvb/frontends/mt352.c
+++ b/drivers/media/dvb/frontends/mt352.c
@@ -302,7 +302,7 @@ static int mt352_set_parameters(struct dvb_frontend* fe,
_mt352_write(fe, fsm_go, 2);
} else {
if (fe->ops.tuner_ops.calc_regs) {
- fe->ops.tuner_ops.calc_regs(fe, param, buf+8, 5);
+ fe->ops.tuner_ops.calc_regs(fe, buf+8, 5);
buf[8] <<= 1;
_mt352_write(fe, buf, sizeof(buf));
_mt352_write(fe, tuner_go, 2);
diff --git a/drivers/media/dvb/frontends/nxt200x.c b/drivers/media/dvb/frontends/nxt200x.c
index eac2065..ae5c3c3 100644
--- a/drivers/media/dvb/frontends/nxt200x.c
+++ b/drivers/media/dvb/frontends/nxt200x.c
@@ -566,7 +566,7 @@ static int nxt200x_setup_frontend_parameters (struct dvb_frontend* fe,
if (fe->ops.tuner_ops.calc_regs) {
/* get tuning information */
- fe->ops.tuner_ops.calc_regs(fe, p, buf, 5);
+ fe->ops.tuner_ops.calc_regs(fe, buf, 5);
/* write frequency information */
nxt200x_writetuner(state, buf);
diff --git a/drivers/media/dvb/frontends/zl10353.c b/drivers/media/dvb/frontends/zl10353.c
index adbbf6d..9caccc0 100644
--- a/drivers/media/dvb/frontends/zl10353.c
+++ b/drivers/media/dvb/frontends/zl10353.c
@@ -367,7 +367,7 @@ static int zl10353_set_parameters(struct dvb_frontend *fe,
fe->ops.i2c_gate_ctrl(fe, 0);
}
} else if (fe->ops.tuner_ops.calc_regs) {
- fe->ops.tuner_ops.calc_regs(fe, param, pllbuf + 1, 5);
+ fe->ops.tuner_ops.calc_regs(fe, pllbuf + 1, 5);
pllbuf[1] <<= 1;
zl10353_write(fe, pllbuf, sizeof(pllbuf));
}
--
1.7.8.352.g876a6
^ permalink raw reply related [flat|nested] 51+ messages in thread
* [PATCH v4 47/47] [media] tuners: remove dvb_frontend_parameters from set_params()
2011-12-24 15:50 ` [PATCH v4 46/47] [media] dvb: remove dvb_frontend_parameters from calc_regs() Mauro Carvalho Chehab
@ 2011-12-24 15:50 ` Mauro Carvalho Chehab
0 siblings, 0 replies; 51+ messages in thread
From: Mauro Carvalho Chehab @ 2011-12-24 15:50 UTC (permalink / raw)
Cc: Mauro Carvalho Chehab, Linux Media Mailing List
This is a big patch, yet trivial: now that all tuners use the DVBv5
way to pass parameters (e. g. via fe->dtv_property_cache), the
extra parameter can be removed from set_params() call.
After this change, very few DVBv3 specific stuff are left at the
tuners.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
drivers/media/common/tuners/max2165.c | 3 +-
drivers/media/common/tuners/mc44s803.c | 3 +-
drivers/media/common/tuners/mt2060.c | 2 +-
drivers/media/common/tuners/mt2131.c | 3 +-
drivers/media/common/tuners/mt2266.c | 2 +-
drivers/media/common/tuners/mxl5005s.c | 3 +-
drivers/media/common/tuners/mxl5007t.c | 3 +-
drivers/media/common/tuners/qt1010.c | 6 +---
drivers/media/common/tuners/tda18212.c | 3 +-
drivers/media/common/tuners/tda18218.c | 3 +-
drivers/media/common/tuners/tda18271-fe.c | 3 +-
drivers/media/common/tuners/tda827x.c | 6 +---
drivers/media/common/tuners/tuner-simple.c | 3 +-
drivers/media/common/tuners/tuner-xc2028.c | 3 +-
drivers/media/common/tuners/xc4000.c | 3 +-
drivers/media/common/tuners/xc5000.c | 3 +-
drivers/media/dvb/bt8xx/dvb-bt8xx.c | 6 ++--
drivers/media/dvb/dvb-core/dvb_frontend.h | 2 +-
drivers/media/dvb/dvb-usb/af9005-fe.c | 2 +-
drivers/media/dvb/dvb-usb/cxusb.c | 8 ++---
drivers/media/dvb/dvb-usb/dib0700_devices.c | 30 +++++++++------------
drivers/media/dvb/dvb-usb/digitv.c | 2 +-
drivers/media/dvb/dvb-usb/mxl111sf-demod.c | 2 +-
drivers/media/dvb/dvb-usb/mxl111sf-tuner.c | 3 +-
drivers/media/dvb/frontends/af9013.c | 2 +-
drivers/media/dvb/frontends/atbm8830.c | 2 +-
drivers/media/dvb/frontends/au8522_dig.c | 2 +-
drivers/media/dvb/frontends/bsbe1.h | 2 +-
drivers/media/dvb/frontends/bsru6.h | 2 +-
drivers/media/dvb/frontends/cx22700.c | 2 +-
drivers/media/dvb/frontends/cx22702.c | 2 +-
drivers/media/dvb/frontends/cx24110.c | 2 +-
drivers/media/dvb/frontends/cx24113.c | 3 +-
drivers/media/dvb/frontends/cx24123.c | 2 +-
drivers/media/dvb/frontends/cxd2820r_c.c | 2 +-
drivers/media/dvb/frontends/cxd2820r_t.c | 2 +-
drivers/media/dvb/frontends/cxd2820r_t2.c | 2 +-
drivers/media/dvb/frontends/dib0070.c | 2 +-
drivers/media/dvb/frontends/dib0090.c | 2 +-
drivers/media/dvb/frontends/dib3000mb.c | 2 +-
drivers/media/dvb/frontends/dib3000mc.c | 2 +-
drivers/media/dvb/frontends/dib7000m.c | 2 +-
drivers/media/dvb/frontends/dib7000p.c | 2 +-
drivers/media/dvb/frontends/dib8000.c | 2 +-
drivers/media/dvb/frontends/drxd_hard.c | 2 +-
drivers/media/dvb/frontends/drxk_hard.c | 2 +-
drivers/media/dvb/frontends/dvb-pll.c | 3 +-
drivers/media/dvb/frontends/dvb_dummy_fe.c | 2 +-
drivers/media/dvb/frontends/ec100.c | 2 +-
drivers/media/dvb/frontends/it913x-fe.c | 2 +-
drivers/media/dvb/frontends/itd1000.c | 2 +-
drivers/media/dvb/frontends/ix2505v.c | 3 +-
drivers/media/dvb/frontends/l64781.c | 2 +-
drivers/media/dvb/frontends/lgdt3305.c | 4 +-
drivers/media/dvb/frontends/lgdt330x.c | 2 +-
drivers/media/dvb/frontends/lgs8gl5.c | 2 +-
drivers/media/dvb/frontends/lgs8gxx.c | 2 +-
drivers/media/dvb/frontends/mb86a20s.c | 2 +-
drivers/media/dvb/frontends/mt312.c | 2 +-
drivers/media/dvb/frontends/mt352.c | 2 +-
drivers/media/dvb/frontends/nxt6000.c | 2 +-
drivers/media/dvb/frontends/or51132.c | 2 +-
drivers/media/dvb/frontends/or51211.c | 2 +-
drivers/media/dvb/frontends/s5h1409.c | 2 +-
drivers/media/dvb/frontends/s5h1411.c | 2 +-
drivers/media/dvb/frontends/s5h1420.c | 4 +-
drivers/media/dvb/frontends/s5h1432.c | 6 ++--
drivers/media/dvb/frontends/sp8870.c | 2 +-
drivers/media/dvb/frontends/sp887x.c | 2 +-
drivers/media/dvb/frontends/stb6000.c | 3 +-
drivers/media/dvb/frontends/stv0288.c | 2 +-
drivers/media/dvb/frontends/stv0297.c | 2 +-
drivers/media/dvb/frontends/stv0299.c | 2 +-
drivers/media/dvb/frontends/stv0367.c | 4 +-
drivers/media/dvb/frontends/stv6110.c | 3 +-
drivers/media/dvb/frontends/tda10021.c | 2 +-
drivers/media/dvb/frontends/tda10023.c | 2 +-
drivers/media/dvb/frontends/tda10048.c | 2 +-
drivers/media/dvb/frontends/tda1004x.c | 2 +-
drivers/media/dvb/frontends/tda10086.c | 2 +-
drivers/media/dvb/frontends/tda18271c2dd.c | 3 +-
drivers/media/dvb/frontends/tda8083.c | 2 +-
drivers/media/dvb/frontends/tda826x.c | 2 +-
drivers/media/dvb/frontends/tdhd1.h | 2 +-
drivers/media/dvb/frontends/tua6100.c | 3 +-
drivers/media/dvb/frontends/ves1820.c | 2 +-
drivers/media/dvb/frontends/ves1x93.c | 2 +-
drivers/media/dvb/frontends/zl10036.c | 3 +-
drivers/media/dvb/frontends/zl10039.c | 3 +-
drivers/media/dvb/frontends/zl10353.c | 2 +-
drivers/media/dvb/mantis/mantis_vp1033.c | 3 +-
drivers/media/dvb/mantis/mantis_vp2033.c | 2 +-
drivers/media/dvb/mantis/mantis_vp2040.c | 2 +-
drivers/media/dvb/pluto2/pluto2.c | 3 +-
drivers/media/dvb/ttpci/av7110.c | 14 +++++-----
drivers/media/dvb/ttpci/budget-av.c | 7 ++---
drivers/media/dvb/ttpci/budget-ci.c | 7 ++---
drivers/media/dvb/ttpci/budget-patch.c | 4 +-
drivers/media/dvb/ttpci/budget.c | 10 +++---
drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c | 12 ++++----
drivers/media/video/cx88/cx88-dvb.c | 3 +-
drivers/media/video/saa7134/saa7134-dvb.c | 9 +++---
102 files changed, 148 insertions(+), 186 deletions(-)
diff --git a/drivers/media/common/tuners/max2165.c b/drivers/media/common/tuners/max2165.c
index 0343449..cb2c98f 100644
--- a/drivers/media/common/tuners/max2165.c
+++ b/drivers/media/common/tuners/max2165.c
@@ -257,8 +257,7 @@ static void max2165_debug_status(struct max2165_priv *priv)
dprintk("VCO: %d, VCO Sub-band: %d, ADC: %d\n", vco, vco_sub_band, adc);
}
-static int max2165_set_params(struct dvb_frontend *fe,
- struct dvb_frontend_parameters *params)
+static int max2165_set_params(struct dvb_frontend *fe)
{
struct max2165_priv *priv = fe->tuner_priv;
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
diff --git a/drivers/media/common/tuners/mc44s803.c b/drivers/media/common/tuners/mc44s803.c
index 5a8758c..5ddce7e 100644
--- a/drivers/media/common/tuners/mc44s803.c
+++ b/drivers/media/common/tuners/mc44s803.c
@@ -214,8 +214,7 @@ exit:
return err;
}
-static int mc44s803_set_params(struct dvb_frontend *fe,
- struct dvb_frontend_parameters *params)
+static int mc44s803_set_params(struct dvb_frontend *fe)
{
struct mc44s803_priv *priv = fe->tuner_priv;
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
diff --git a/drivers/media/common/tuners/mt2060.c b/drivers/media/common/tuners/mt2060.c
index 6fe2ef9..13381de 100644
--- a/drivers/media/common/tuners/mt2060.c
+++ b/drivers/media/common/tuners/mt2060.c
@@ -153,7 +153,7 @@ static int mt2060_spurcheck(u32 lo1,u32 lo2,u32 if2)
#define IF2 36150 // IF2 frequency = 36.150 MHz
#define FREF 16000 // Quartz oscillator 16 MHz
-static int mt2060_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
+static int mt2060_set_params(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct mt2060_priv *priv;
diff --git a/drivers/media/common/tuners/mt2131.c b/drivers/media/common/tuners/mt2131.c
index d9cab1f..f83b0c1 100644
--- a/drivers/media/common/tuners/mt2131.c
+++ b/drivers/media/common/tuners/mt2131.c
@@ -92,8 +92,7 @@ static int mt2131_writeregs(struct mt2131_priv *priv,u8 *buf, u8 len)
return 0;
}
-static int mt2131_set_params(struct dvb_frontend *fe,
- struct dvb_frontend_parameters *params)
+static int mt2131_set_params(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct mt2131_priv *priv;
diff --git a/drivers/media/common/tuners/mt2266.c b/drivers/media/common/tuners/mt2266.c
index dd883d7..2fb5a60 100644
--- a/drivers/media/common/tuners/mt2266.c
+++ b/drivers/media/common/tuners/mt2266.c
@@ -122,7 +122,7 @@ static u8 mt2266_vhf[] = { 0x1d, 0xfe, 0x00, 0x00, 0xb4, 0x03, 0xa5, 0xa5,
#define FREF 30000 // Quartz oscillator 30 MHz
-static int mt2266_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
+static int mt2266_set_params(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct mt2266_priv *priv;
diff --git a/drivers/media/common/tuners/mxl5005s.c b/drivers/media/common/tuners/mxl5005s.c
index c35d355..6133315 100644
--- a/drivers/media/common/tuners/mxl5005s.c
+++ b/drivers/media/common/tuners/mxl5005s.c
@@ -3979,8 +3979,7 @@ static int mxl5005s_AssignTunerMode(struct dvb_frontend *fe, u32 mod_type,
return 0;
}
-static int mxl5005s_set_params(struct dvb_frontend *fe,
- struct dvb_frontend_parameters *params)
+static int mxl5005s_set_params(struct dvb_frontend *fe)
{
struct mxl5005s_state *state = fe->tuner_priv;
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
diff --git a/drivers/media/common/tuners/mxl5007t.c b/drivers/media/common/tuners/mxl5007t.c
index 6c45993..5d71e22 100644
--- a/drivers/media/common/tuners/mxl5007t.c
+++ b/drivers/media/common/tuners/mxl5007t.c
@@ -615,8 +615,7 @@ fail:
/* ------------------------------------------------------------------------- */
-static int mxl5007t_set_params(struct dvb_frontend *fe,
- struct dvb_frontend_parameters *params)
+static int mxl5007t_set_params(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
u32 delsys = c->delivery_system;
diff --git a/drivers/media/common/tuners/qt1010.c b/drivers/media/common/tuners/qt1010.c
index bd433ad..2d79b1f 100644
--- a/drivers/media/common/tuners/qt1010.c
+++ b/drivers/media/common/tuners/qt1010.c
@@ -82,8 +82,7 @@ static void qt1010_dump_regs(struct qt1010_priv *priv)
printk(KERN_CONT "\n");
}
-static int qt1010_set_params(struct dvb_frontend *fe,
- struct dvb_frontend_parameters *params)
+static int qt1010_set_params(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct qt1010_priv *priv;
@@ -319,7 +318,6 @@ static u8 qt1010_init_meas2(struct qt1010_priv *priv,
static int qt1010_init(struct dvb_frontend *fe)
{
struct qt1010_priv *priv = fe->tuner_priv;
- struct dvb_frontend_parameters params;
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
int err = 0;
u8 i, tmpval, *valptr = NULL;
@@ -399,7 +397,7 @@ static int qt1010_init(struct dvb_frontend *fe)
c->frequency = 545000000; /* Sigmatek DVB-110 545000000 */
/* MSI Megasky 580 GL861 533000000 */
- return qt1010_set_params(fe, ¶ms);
+ return qt1010_set_params(fe);
}
static int qt1010_release(struct dvb_frontend *fe)
diff --git a/drivers/media/common/tuners/tda18212.c b/drivers/media/common/tuners/tda18212.c
index a58c74f..602c2e3 100644
--- a/drivers/media/common/tuners/tda18212.c
+++ b/drivers/media/common/tuners/tda18212.c
@@ -130,8 +130,7 @@ static void tda18212_dump_regs(struct tda18212_priv *priv)
}
#endif
-static int tda18212_set_params(struct dvb_frontend *fe,
- struct dvb_frontend_parameters *p)
+static int tda18212_set_params(struct dvb_frontend *fe)
{
struct tda18212_priv *priv = fe->tuner_priv;
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
diff --git a/drivers/media/common/tuners/tda18218.c b/drivers/media/common/tuners/tda18218.c
index bbed0cf..917e718 100644
--- a/drivers/media/common/tuners/tda18218.c
+++ b/drivers/media/common/tuners/tda18218.c
@@ -109,8 +109,7 @@ static int tda18218_rd_reg(struct tda18218_priv *priv, u8 reg, u8 *val)
return tda18218_rd_regs(priv, reg, val, 1);
}
-static int tda18218_set_params(struct dvb_frontend *fe,
- struct dvb_frontend_parameters *params)
+static int tda18218_set_params(struct dvb_frontend *fe)
{
struct tda18218_priv *priv = fe->tuner_priv;
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
diff --git a/drivers/media/common/tuners/tda18271-fe.c b/drivers/media/common/tuners/tda18271-fe.c
index 6348bb3..53299b0 100644
--- a/drivers/media/common/tuners/tda18271-fe.c
+++ b/drivers/media/common/tuners/tda18271-fe.c
@@ -928,8 +928,7 @@ fail:
/* ------------------------------------------------------------------ */
-static int tda18271_set_params(struct dvb_frontend *fe,
- struct dvb_frontend_parameters *params)
+static int tda18271_set_params(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
u32 delsys = c->delivery_system;
diff --git a/drivers/media/common/tuners/tda827x.c b/drivers/media/common/tuners/tda827x.c
index 7316308..d96d0b9 100644
--- a/drivers/media/common/tuners/tda827x.c
+++ b/drivers/media/common/tuners/tda827x.c
@@ -152,8 +152,7 @@ static int tuner_transfer(struct dvb_frontend *fe,
return rc;
}
-static int tda827xo_set_params(struct dvb_frontend *fe,
- struct dvb_frontend_parameters *params)
+static int tda827xo_set_params(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct tda827x_priv *priv = fe->tuner_priv;
@@ -517,8 +516,7 @@ static void tda827xa_lna_gain(struct dvb_frontend *fe, int high,
}
}
-static int tda827xa_set_params(struct dvb_frontend *fe,
- struct dvb_frontend_parameters *params)
+static int tda827xa_set_params(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct tda827x_priv *priv = fe->tuner_priv;
diff --git a/drivers/media/common/tuners/tuner-simple.c b/drivers/media/common/tuners/tuner-simple.c
index 1dad5fb..ce91c43 100644
--- a/drivers/media/common/tuners/tuner-simple.c
+++ b/drivers/media/common/tuners/tuner-simple.c
@@ -907,8 +907,7 @@ static int simple_dvb_calc_regs(struct dvb_frontend *fe,
return 5;
}
-static int simple_dvb_set_params(struct dvb_frontend *fe,
- struct dvb_frontend_parameters *params)
+static int simple_dvb_set_params(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
u32 delsys = c->delivery_system;
diff --git a/drivers/media/common/tuners/tuner-xc2028.c b/drivers/media/common/tuners/tuner-xc2028.c
index 8c0dc6a1..a115657 100644
--- a/drivers/media/common/tuners/tuner-xc2028.c
+++ b/drivers/media/common/tuners/tuner-xc2028.c
@@ -1084,8 +1084,7 @@ static int xc2028_set_analog_freq(struct dvb_frontend *fe,
V4L2_TUNER_ANALOG_TV, type, p->std, 0);
}
-static int xc2028_set_params(struct dvb_frontend *fe,
- struct dvb_frontend_parameters *p)
+static int xc2028_set_params(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
u32 delsys = c->delivery_system;
diff --git a/drivers/media/common/tuners/xc4000.c b/drivers/media/common/tuners/xc4000.c
index e6acc7a..d17c0f5 100644
--- a/drivers/media/common/tuners/xc4000.c
+++ b/drivers/media/common/tuners/xc4000.c
@@ -1121,8 +1121,7 @@ static void xc_debug_dump(struct xc4000_priv *priv)
dprintk(1, "*** Quality (0:<8dB, 7:>56dB) = %d\n", quality);
}
-static int xc4000_set_params(struct dvb_frontend *fe,
- struct dvb_frontend_parameters *params)
+static int xc4000_set_params(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
u32 delsys = c->delivery_system;
diff --git a/drivers/media/common/tuners/xc5000.c b/drivers/media/common/tuners/xc5000.c
index 5c56d3c..7796339 100644
--- a/drivers/media/common/tuners/xc5000.c
+++ b/drivers/media/common/tuners/xc5000.c
@@ -628,8 +628,7 @@ static void xc_debug_dump(struct xc5000_priv *priv)
dprintk(1, "*** Quality (0:<8dB, 7:>56dB) = %d\n", quality);
}
-static int xc5000_set_params(struct dvb_frontend *fe,
- struct dvb_frontend_parameters *params)
+static int xc5000_set_params(struct dvb_frontend *fe)
{
int ret, b;
struct xc5000_priv *priv = fe->tuner_priv;
diff --git a/drivers/media/dvb/bt8xx/dvb-bt8xx.c b/drivers/media/dvb/bt8xx/dvb-bt8xx.c
index 8275d7e..352b27f 100644
--- a/drivers/media/dvb/bt8xx/dvb-bt8xx.c
+++ b/drivers/media/dvb/bt8xx/dvb-bt8xx.c
@@ -192,7 +192,7 @@ static struct zl10353_config thomson_dtt7579_zl10353_config = {
.demod_address = 0x0f,
};
-static int cx24108_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters* params)
+static int cx24108_tuner_set_params(struct dvb_frontend* fe)
{
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
u32 freq = c->frequency;
@@ -267,7 +267,7 @@ static struct cx24110_config pctvsat_config = {
.demod_address = 0x55,
};
-static int microtune_mt7202dtf_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters* params)
+static int microtune_mt7202dtf_tuner_set_params(struct dvb_frontend* fe)
{
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct dvb_bt8xx_card *card = (struct dvb_bt8xx_card *) fe->dvb->priv;
@@ -463,7 +463,7 @@ static struct or51211_config or51211_config = {
.sleep = or51211_sleep,
};
-static int vp3021_alps_tded4_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters* params)
+static int vp3021_alps_tded4_tuner_set_params(struct dvb_frontend* fe)
{
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct dvb_bt8xx_card *card = (struct dvb_bt8xx_card *) fe->dvb->priv;
diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.h b/drivers/media/dvb/dvb-core/dvb_frontend.h
index 99ae782..895f88f 100644
--- a/drivers/media/dvb/dvb-core/dvb_frontend.h
+++ b/drivers/media/dvb/dvb-core/dvb_frontend.h
@@ -198,7 +198,7 @@ struct dvb_tuner_ops {
int (*sleep)(struct dvb_frontend *fe);
/** This is for simple PLLs - set all parameters in one go. */
- int (*set_params)(struct dvb_frontend *fe, struct dvb_frontend_parameters *p);
+ int (*set_params)(struct dvb_frontend *fe);
int (*set_analog_params)(struct dvb_frontend *fe, struct analog_parameters *p);
/** This is support for demods like the mt352 - fills out the supplied buffer with what to write. */
diff --git a/drivers/media/dvb/dvb-usb/af9005-fe.c b/drivers/media/dvb/dvb-usb/af9005-fe.c
index 3263e97..aa44f65 100644
--- a/drivers/media/dvb/dvb-usb/af9005-fe.c
+++ b/drivers/media/dvb/dvb-usb/af9005-fe.c
@@ -1189,7 +1189,7 @@ static int af9005_fe_set_frontend(struct dvb_frontend *fe,
return ret;
/* set tuner */
deb_info("set tuner\n");
- ret = fe->ops.tuner_ops.set_params(fe, fep);
+ ret = fe->ops.tuner_ops.set_params(fe);
if (ret)
return ret;
diff --git a/drivers/media/dvb/dvb-usb/cxusb.c b/drivers/media/dvb/dvb-usb/cxusb.c
index 4f9bfc5..e8e5a74 100644
--- a/drivers/media/dvb/dvb-usb/cxusb.c
+++ b/drivers/media/dvb/dvb-usb/cxusb.c
@@ -1067,12 +1067,10 @@ static struct dib0070_config dib7070p_dib0070_config = {
};
struct dib0700_adapter_state {
- int (*set_param_save) (struct dvb_frontend *,
- struct dvb_frontend_parameters *);
+ int (*set_param_save) (struct dvb_frontend *);
};
-static int dib7070_set_param_override(struct dvb_frontend *fe,
- struct dvb_frontend_parameters *fep)
+static int dib7070_set_param_override(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct dvb_usb_adapter *adap = fe->dvb->priv;
@@ -1088,7 +1086,7 @@ static int dib7070_set_param_override(struct dvb_frontend *fe,
dib7000p_set_wbd_ref(fe, offset + dib0070_wbd_offset(fe));
- return state->set_param_save(fe, fep);
+ return state->set_param_save(fe);
}
static int cxusb_dualdig4_rev2_tuner_attach(struct dvb_usb_adapter *adap)
diff --git a/drivers/media/dvb/dvb-usb/dib0700_devices.c b/drivers/media/dvb/dvb-usb/dib0700_devices.c
index 70c3be6..81ef4b4 100644
--- a/drivers/media/dvb/dvb-usb/dib0700_devices.c
+++ b/drivers/media/dvb/dvb-usb/dib0700_devices.c
@@ -30,7 +30,7 @@ MODULE_PARM_DESC(force_lna_activation, "force the activation of Low-Noise-Amplif
"if applicable for the device (default: 0=automatic/off).");
struct dib0700_adapter_state {
- int (*set_param_save) (struct dvb_frontend *, struct dvb_frontend_parameters *);
+ int (*set_param_save) (struct dvb_frontend *);
const struct firmware *frontend_firmware;
};
@@ -804,7 +804,7 @@ static struct dib0070_config dib7770p_dib0070_config = {
.charge_pump = 2,
};
-static int dib7070_set_param_override(struct dvb_frontend *fe, struct dvb_frontend_parameters *fep)
+static int dib7070_set_param_override(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct dvb_usb_adapter *adap = fe->dvb->priv;
@@ -819,11 +819,10 @@ static int dib7070_set_param_override(struct dvb_frontend *fe, struct dvb_fronte
}
deb_info("WBD for DiB7000P: %d\n", offset + dib0070_wbd_offset(fe));
dib7000p_set_wbd_ref(fe, offset + dib0070_wbd_offset(fe));
- return state->set_param_save(fe, fep);
+ return state->set_param_save(fe);
}
-static int dib7770_set_param_override(struct dvb_frontend *fe,
- struct dvb_frontend_parameters *fep)
+static int dib7770_set_param_override(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct dvb_usb_adapter *adap = fe->dvb->priv;
@@ -844,7 +843,7 @@ static int dib7770_set_param_override(struct dvb_frontend *fe,
}
deb_info("WBD for DiB7000P: %d\n", offset + dib0070_wbd_offset(fe));
dib7000p_set_wbd_ref(fe, offset + dib0070_wbd_offset(fe));
- return state->set_param_save(fe, fep);
+ return state->set_param_save(fe);
}
static int dib7770p_tuner_attach(struct dvb_usb_adapter *adap)
@@ -1207,8 +1206,7 @@ static struct dib0070_config dib807x_dib0070_config[2] = {
}
};
-static int dib807x_set_param_override(struct dvb_frontend *fe,
- struct dvb_frontend_parameters *fep)
+static int dib807x_set_param_override(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct dvb_usb_adapter *adap = fe->dvb->priv;
@@ -1227,7 +1225,7 @@ static int dib807x_set_param_override(struct dvb_frontend *fe,
deb_info("WBD for DiB8000: %d\n", offset);
dib8000_set_wbd_ref(fe, offset);
- return state->set_param_save(fe, fep);
+ return state->set_param_save(fe);
}
static int dib807x_tuner_attach(struct dvb_usb_adapter *adap)
@@ -1506,8 +1504,7 @@ static struct dib0090_config dib809x_dib0090_config = {
.fref_clock_ratio = 6,
};
-static int dib8096_set_param_override(struct dvb_frontend *fe,
- struct dvb_frontend_parameters *fep)
+static int dib8096_set_param_override(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct dvb_usb_adapter *adap = fe->dvb->priv;
@@ -1518,7 +1515,7 @@ static int dib8096_set_param_override(struct dvb_frontend *fe,
enum frontend_tune_state tune_state = CT_SHUTDOWN;
u16 ltgain, rf_gain_limit;
- ret = state->set_param_save(fe, fep);
+ ret = state->set_param_save(fe);
if (ret < 0)
return ret;
@@ -1823,8 +1820,7 @@ struct dibx090p_adc dib8090p_adc_tab[] = {
{0xffffffff, 0, 0, 0}, /* 60 MHz */
};
-static int dib8096p_agc_startup(struct dvb_frontend *fe,
- struct dvb_frontend_parameters *fep)
+static int dib8096p_agc_startup(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct dvb_usb_adapter *adap = fe->dvb->priv;
@@ -1834,7 +1830,7 @@ static int dib8096p_agc_startup(struct dvb_frontend *fe,
int better_sampling_freq = 0, ret;
struct dibx090p_adc *adc_table = &dib8090p_adc_tab[0];
- ret = state->set_param_save(fe, fep);
+ ret = state->set_param_save(fe);
if (ret < 0)
return ret;
memset(&pll, 0, sizeof(struct dibx000_bandwidth_config));
@@ -2325,7 +2321,7 @@ static int dib7090p_get_best_sampling(struct dvb_frontend *fe , struct dib7090p_
return 0;
}
-static int dib7090_agc_startup(struct dvb_frontend *fe, struct dvb_frontend_parameters *fep)
+static int dib7090_agc_startup(struct dvb_frontend *fe)
{
struct dvb_usb_adapter *adap = fe->dvb->priv;
struct dib0700_adapter_state *state = adap->priv;
@@ -2334,7 +2330,7 @@ static int dib7090_agc_startup(struct dvb_frontend *fe, struct dvb_frontend_para
struct dib7090p_best_adc adc;
int ret;
- ret = state->set_param_save(fe, fep);
+ ret = state->set_param_save(fe);
if (ret < 0)
return ret;
diff --git a/drivers/media/dvb/dvb-usb/digitv.c b/drivers/media/dvb/dvb-usb/digitv.c
index 2856ab7..00a446d 100644
--- a/drivers/media/dvb/dvb-usb/digitv.c
+++ b/drivers/media/dvb/dvb-usb/digitv.c
@@ -118,7 +118,7 @@ static struct mt352_config digitv_mt352_config = {
.demod_init = digitv_mt352_demod_init,
};
-static int digitv_nxt6000_tuner_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *fep)
+static int digitv_nxt6000_tuner_set_params(struct dvb_frontend *fe)
{
struct dvb_usb_adapter *adap = fe->dvb->priv;
u8 b[5];
diff --git a/drivers/media/dvb/dvb-usb/mxl111sf-demod.c b/drivers/media/dvb/dvb-usb/mxl111sf-demod.c
index d1f5837..3ae7729 100644
--- a/drivers/media/dvb/dvb-usb/mxl111sf-demod.c
+++ b/drivers/media/dvb/dvb-usb/mxl111sf-demod.c
@@ -303,7 +303,7 @@ static int mxl111sf_demod_set_frontend(struct dvb_frontend *fe,
mxl_dbg("()");
if (fe->ops.tuner_ops.set_params) {
- ret = fe->ops.tuner_ops.set_params(fe, param);
+ ret = fe->ops.tuner_ops.set_params(fe);
if (mxl_fail(ret))
goto fail;
msleep(50);
diff --git a/drivers/media/dvb/dvb-usb/mxl111sf-tuner.c b/drivers/media/dvb/dvb-usb/mxl111sf-tuner.c
index aeac7a9..3a533df 100644
--- a/drivers/media/dvb/dvb-usb/mxl111sf-tuner.c
+++ b/drivers/media/dvb/dvb-usb/mxl111sf-tuner.c
@@ -272,8 +272,7 @@ static int mxl1x1sf_tuner_loop_thru_ctrl(struct mxl111sf_tuner_state *state,
/* ------------------------------------------------------------------------ */
-static int mxl111sf_tuner_set_params(struct dvb_frontend *fe,
- struct dvb_frontend_parameters *params)
+static int mxl111sf_tuner_set_params(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
u32 delsys = c->delivery_system;
diff --git a/drivers/media/dvb/frontends/af9013.c b/drivers/media/dvb/frontends/af9013.c
index f4276e4..889827d 100644
--- a/drivers/media/dvb/frontends/af9013.c
+++ b/drivers/media/dvb/frontends/af9013.c
@@ -608,7 +608,7 @@ static int af9013_set_frontend(struct dvb_frontend *fe,
/* program tuner */
if (fe->ops.tuner_ops.set_params)
- fe->ops.tuner_ops.set_params(fe, params);
+ fe->ops.tuner_ops.set_params(fe);
/* program CFOE coefficients */
ret = af9013_set_coeff(state, params->u.ofdm.bandwidth);
diff --git a/drivers/media/dvb/frontends/atbm8830.c b/drivers/media/dvb/frontends/atbm8830.c
index 1539ea1..90480d3 100644
--- a/drivers/media/dvb/frontends/atbm8830.c
+++ b/drivers/media/dvb/frontends/atbm8830.c
@@ -279,7 +279,7 @@ static int atbm8830_set_fe(struct dvb_frontend *fe,
if (fe->ops.tuner_ops.set_params) {
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1);
- fe->ops.tuner_ops.set_params(fe, fe_params);
+ fe->ops.tuner_ops.set_params(fe);
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0);
}
diff --git a/drivers/media/dvb/frontends/au8522_dig.c b/drivers/media/dvb/frontends/au8522_dig.c
index 5c0d398..1df9d9c 100644
--- a/drivers/media/dvb/frontends/au8522_dig.c
+++ b/drivers/media/dvb/frontends/au8522_dig.c
@@ -596,7 +596,7 @@ static int au8522_set_frontend(struct dvb_frontend *fe,
if (fe->ops.tuner_ops.set_params) {
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1);
- ret = fe->ops.tuner_ops.set_params(fe, p);
+ ret = fe->ops.tuner_ops.set_params(fe);
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0);
}
diff --git a/drivers/media/dvb/frontends/bsbe1.h b/drivers/media/dvb/frontends/bsbe1.h
index e008946..f482b10 100644
--- a/drivers/media/dvb/frontends/bsbe1.h
+++ b/drivers/media/dvb/frontends/bsbe1.h
@@ -69,7 +69,7 @@ static int alps_bsbe1_set_symbol_rate(struct dvb_frontend* fe, u32 srate, u32 ra
return 0;
}
-static int alps_bsbe1_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters *params)
+static int alps_bsbe1_tuner_set_params(struct dvb_frontend* fe)
{
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
int ret;
diff --git a/drivers/media/dvb/frontends/bsru6.h b/drivers/media/dvb/frontends/bsru6.h
index cd8c675..686df0c 100644
--- a/drivers/media/dvb/frontends/bsru6.h
+++ b/drivers/media/dvb/frontends/bsru6.h
@@ -101,7 +101,7 @@ static int alps_bsru6_set_symbol_rate(struct dvb_frontend *fe, u32 srate, u32 ra
return 0;
}
-static int alps_bsru6_tuner_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
+static int alps_bsru6_tuner_set_params(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
u8 buf[4];
diff --git a/drivers/media/dvb/frontends/cx22700.c b/drivers/media/dvb/frontends/cx22700.c
index 0142214..6ef82a1 100644
--- a/drivers/media/dvb/frontends/cx22700.c
+++ b/drivers/media/dvb/frontends/cx22700.c
@@ -326,7 +326,7 @@ static int cx22700_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_par
cx22700_writereg (state, 0x00, 0x00);
if (fe->ops.tuner_ops.set_params) {
- fe->ops.tuner_ops.set_params(fe, p);
+ fe->ops.tuner_ops.set_params(fe);
if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0);
}
diff --git a/drivers/media/dvb/frontends/cx22702.c b/drivers/media/dvb/frontends/cx22702.c
index 3139558..73dd87a 100644
--- a/drivers/media/dvb/frontends/cx22702.c
+++ b/drivers/media/dvb/frontends/cx22702.c
@@ -267,7 +267,7 @@ static int cx22702_set_tps(struct dvb_frontend *fe,
struct cx22702_state *state = fe->demodulator_priv;
if (fe->ops.tuner_ops.set_params) {
- fe->ops.tuner_ops.set_params(fe, p);
+ fe->ops.tuner_ops.set_params(fe);
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0);
}
diff --git a/drivers/media/dvb/frontends/cx24110.c b/drivers/media/dvb/frontends/cx24110.c
index bf9c999..1eb9253 100644
--- a/drivers/media/dvb/frontends/cx24110.c
+++ b/drivers/media/dvb/frontends/cx24110.c
@@ -537,7 +537,7 @@ static int cx24110_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_par
if (fe->ops.tuner_ops.set_params) {
- fe->ops.tuner_ops.set_params(fe, p);
+ fe->ops.tuner_ops.set_params(fe);
if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0);
}
diff --git a/drivers/media/dvb/frontends/cx24113.c b/drivers/media/dvb/frontends/cx24113.c
index 07737e2..4b8794f 100644
--- a/drivers/media/dvb/frontends/cx24113.c
+++ b/drivers/media/dvb/frontends/cx24113.c
@@ -476,8 +476,7 @@ static int cx24113_init(struct dvb_frontend *fe)
return ret;
}
-static int cx24113_set_params(struct dvb_frontend *fe,
- struct dvb_frontend_parameters *p)
+static int cx24113_set_params(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct cx24113_state *state = fe->tuner_priv;
diff --git a/drivers/media/dvb/frontends/cx24123.c b/drivers/media/dvb/frontends/cx24123.c
index b1dd8ac..4d387d3 100644
--- a/drivers/media/dvb/frontends/cx24123.c
+++ b/drivers/media/dvb/frontends/cx24123.c
@@ -945,7 +945,7 @@ static int cx24123_set_frontend(struct dvb_frontend *fe,
if (!state->config->dont_use_pll)
cx24123_pll_tune(fe, p);
else if (fe->ops.tuner_ops.set_params)
- fe->ops.tuner_ops.set_params(fe, p);
+ fe->ops.tuner_ops.set_params(fe);
else
err("it seems I don't have a tuner...");
diff --git a/drivers/media/dvb/frontends/cxd2820r_c.c b/drivers/media/dvb/frontends/cxd2820r_c.c
index 7016e27..26545d7 100644
--- a/drivers/media/dvb/frontends/cxd2820r_c.c
+++ b/drivers/media/dvb/frontends/cxd2820r_c.c
@@ -57,7 +57,7 @@ int cxd2820r_set_frontend_c(struct dvb_frontend *fe,
/* program tuner */
if (fe->ops.tuner_ops.set_params)
- fe->ops.tuner_ops.set_params(fe, params);
+ fe->ops.tuner_ops.set_params(fe);
if (priv->delivery_system != SYS_DVBC_ANNEX_A) {
for (i = 0; i < ARRAY_SIZE(tab); i++) {
diff --git a/drivers/media/dvb/frontends/cxd2820r_t.c b/drivers/media/dvb/frontends/cxd2820r_t.c
index b1450ac..a12ba74 100644
--- a/drivers/media/dvb/frontends/cxd2820r_t.c
+++ b/drivers/media/dvb/frontends/cxd2820r_t.c
@@ -81,7 +81,7 @@ int cxd2820r_set_frontend_t(struct dvb_frontend *fe,
/* program tuner */
if (fe->ops.tuner_ops.set_params)
- fe->ops.tuner_ops.set_params(fe, p);
+ fe->ops.tuner_ops.set_params(fe);
if (priv->delivery_system != SYS_DVBT) {
for (i = 0; i < ARRAY_SIZE(tab); i++) {
diff --git a/drivers/media/dvb/frontends/cxd2820r_t2.c b/drivers/media/dvb/frontends/cxd2820r_t2.c
index e21fc97..52ed2c4 100644
--- a/drivers/media/dvb/frontends/cxd2820r_t2.c
+++ b/drivers/media/dvb/frontends/cxd2820r_t2.c
@@ -99,7 +99,7 @@ int cxd2820r_set_frontend_t2(struct dvb_frontend *fe,
/* program tuner */
if (fe->ops.tuner_ops.set_params)
- fe->ops.tuner_ops.set_params(fe, params);
+ fe->ops.tuner_ops.set_params(fe);
if (priv->delivery_system != SYS_DVBT2) {
for (i = 0; i < ARRAY_SIZE(tab); i++) {
diff --git a/drivers/media/dvb/frontends/dib0070.c b/drivers/media/dvb/frontends/dib0070.c
index 4ca3441..3b024bf 100644
--- a/drivers/media/dvb/frontends/dib0070.c
+++ b/drivers/media/dvb/frontends/dib0070.c
@@ -516,7 +516,7 @@ static int dib0070_tune_digital(struct dvb_frontend *fe)
}
-static int dib0070_tune(struct dvb_frontend *fe, struct dvb_frontend_parameters *p)
+static int dib0070_tune(struct dvb_frontend *fe)
{
struct dib0070_state *state = fe->tuner_priv;
uint32_t ret;
diff --git a/drivers/media/dvb/frontends/dib0090.c b/drivers/media/dvb/frontends/dib0090.c
index 2b30ab2..224d81e 100644
--- a/drivers/media/dvb/frontends/dib0090.c
+++ b/drivers/media/dvb/frontends/dib0090.c
@@ -2566,7 +2566,7 @@ static int dib0090_get_frequency(struct dvb_frontend *fe, u32 * frequency)
return 0;
}
-static int dib0090_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *p)
+static int dib0090_set_params(struct dvb_frontend *fe)
{
struct dib0090_state *state = fe->tuner_priv;
u32 ret;
diff --git a/drivers/media/dvb/frontends/dib3000mb.c b/drivers/media/dvb/frontends/dib3000mb.c
index 437904c..7403198 100644
--- a/drivers/media/dvb/frontends/dib3000mb.c
+++ b/drivers/media/dvb/frontends/dib3000mb.c
@@ -124,7 +124,7 @@ static int dib3000mb_set_frontend(struct dvb_frontend* fe,
int search_state, seq;
if (tuner && fe->ops.tuner_ops.set_params) {
- fe->ops.tuner_ops.set_params(fe, fep);
+ fe->ops.tuner_ops.set_params(fe);
if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0);
deb_setf("bandwidth: ");
diff --git a/drivers/media/dvb/frontends/dib3000mc.c b/drivers/media/dvb/frontends/dib3000mc.c
index 088e7fa..32cd006 100644
--- a/drivers/media/dvb/frontends/dib3000mc.c
+++ b/drivers/media/dvb/frontends/dib3000mc.c
@@ -696,7 +696,7 @@ static int dib3000mc_set_frontend(struct dvb_frontend* fe,
state->sfn_workaround_active = buggy_sfn_workaround;
if (fe->ops.tuner_ops.set_params) {
- fe->ops.tuner_ops.set_params(fe, fep);
+ fe->ops.tuner_ops.set_params(fe);
msleep(100);
}
diff --git a/drivers/media/dvb/frontends/dib7000m.c b/drivers/media/dvb/frontends/dib7000m.c
index dbb76d7..a30a482 100644
--- a/drivers/media/dvb/frontends/dib7000m.c
+++ b/drivers/media/dvb/frontends/dib7000m.c
@@ -1217,7 +1217,7 @@ static int dib7000m_set_frontend(struct dvb_frontend* fe,
dib7000m_set_bandwidth(state, BANDWIDTH_TO_KHZ(fep->u.ofdm.bandwidth));
if (fe->ops.tuner_ops.set_params)
- fe->ops.tuner_ops.set_params(fe, fep);
+ fe->ops.tuner_ops.set_params(fe);
/* start up the AGC */
state->agc_state = 0;
diff --git a/drivers/media/dvb/frontends/dib7000p.c b/drivers/media/dvb/frontends/dib7000p.c
index b5f3fb4..9983207 100644
--- a/drivers/media/dvb/frontends/dib7000p.c
+++ b/drivers/media/dvb/frontends/dib7000p.c
@@ -1489,7 +1489,7 @@ static int dib7000p_set_frontend(struct dvb_frontend *fe, struct dvb_frontend_pa
state->sfn_workaround_active = buggy_sfn_workaround;
if (fe->ops.tuner_ops.set_params)
- fe->ops.tuner_ops.set_params(fe, fep);
+ fe->ops.tuner_ops.set_params(fe);
/* start up the AGC */
state->agc_state = 0;
diff --git a/drivers/media/dvb/frontends/dib8000.c b/drivers/media/dvb/frontends/dib8000.c
index b8da0c9..2da2bb3 100644
--- a/drivers/media/dvb/frontends/dib8000.c
+++ b/drivers/media/dvb/frontends/dib8000.c
@@ -2986,7 +2986,7 @@ static int dib8000_set_frontend(struct dvb_frontend *fe, struct dvb_frontend_par
dib8096p_set_output_mode(state->fe[index_frontend],
OUTMODE_HIGH_Z);
if (state->fe[index_frontend]->ops.tuner_ops.set_params)
- state->fe[index_frontend]->ops.tuner_ops.set_params(state->fe[index_frontend], fep);
+ state->fe[index_frontend]->ops.tuner_ops.set_params(state->fe[index_frontend]);
dib8000_set_tune_state(state->fe[index_frontend], CT_AGC_START);
}
diff --git a/drivers/media/dvb/frontends/drxd_hard.c b/drivers/media/dvb/frontends/drxd_hard.c
index beb6775..955d3a5 100644
--- a/drivers/media/dvb/frontends/drxd_hard.c
+++ b/drivers/media/dvb/frontends/drxd_hard.c
@@ -2907,7 +2907,7 @@ static int drxd_set_frontend(struct dvb_frontend *fe,
DRX_Stop(state);
if (fe->ops.tuner_ops.set_params) {
- fe->ops.tuner_ops.set_params(fe, param);
+ fe->ops.tuner_ops.set_params(fe);
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0);
}
diff --git a/drivers/media/dvb/frontends/drxk_hard.c b/drivers/media/dvb/frontends/drxk_hard.c
index d795898..83b8474 100644
--- a/drivers/media/dvb/frontends/drxk_hard.c
+++ b/drivers/media/dvb/frontends/drxk_hard.c
@@ -6240,7 +6240,7 @@ static int drxk_set_parameters(struct dvb_frontend *fe,
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1);
if (fe->ops.tuner_ops.set_params)
- fe->ops.tuner_ops.set_params(fe, p);
+ fe->ops.tuner_ops.set_params(fe);
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0);
state->param = *p;
diff --git a/drivers/media/dvb/frontends/dvb-pll.c b/drivers/media/dvb/frontends/dvb-pll.c
index 21f425f..0625e61 100644
--- a/drivers/media/dvb/frontends/dvb-pll.c
+++ b/drivers/media/dvb/frontends/dvb-pll.c
@@ -608,8 +608,7 @@ static int dvb_pll_sleep(struct dvb_frontend *fe)
return -EINVAL;
}
-static int dvb_pll_set_params(struct dvb_frontend *fe,
- struct dvb_frontend_parameters *params)
+static int dvb_pll_set_params(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct dvb_pll_priv *priv = fe->tuner_priv;
diff --git a/drivers/media/dvb/frontends/dvb_dummy_fe.c b/drivers/media/dvb/frontends/dvb_dummy_fe.c
index a7fc7e5..e3a7e42 100644
--- a/drivers/media/dvb/frontends/dvb_dummy_fe.c
+++ b/drivers/media/dvb/frontends/dvb_dummy_fe.c
@@ -76,7 +76,7 @@ static int dvb_dummy_fe_get_frontend(struct dvb_frontend* fe, struct dvb_fronten
static int dvb_dummy_fe_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p)
{
if (fe->ops.tuner_ops.set_params) {
- fe->ops.tuner_ops.set_params(fe, p);
+ fe->ops.tuner_ops.set_params(fe);
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0);
}
diff --git a/drivers/media/dvb/frontends/ec100.c b/drivers/media/dvb/frontends/ec100.c
index 2414dc6..1ef79f0 100644
--- a/drivers/media/dvb/frontends/ec100.c
+++ b/drivers/media/dvb/frontends/ec100.c
@@ -88,7 +88,7 @@ static int ec100_set_frontend(struct dvb_frontend *fe,
/* program tuner */
if (fe->ops.tuner_ops.set_params)
- fe->ops.tuner_ops.set_params(fe, params);
+ fe->ops.tuner_ops.set_params(fe);
ret = ec100_write_reg(state, 0x04, 0x06);
if (ret)
diff --git a/drivers/media/dvb/frontends/it913x-fe.c b/drivers/media/dvb/frontends/it913x-fe.c
index 8088e62..8857710 100644
--- a/drivers/media/dvb/frontends/it913x-fe.c
+++ b/drivers/media/dvb/frontends/it913x-fe.c
@@ -642,7 +642,7 @@ static int it913x_fe_set_frontend(struct dvb_frontend *fe,
break;
default:
if (fe->ops.tuner_ops.set_params) {
- fe->ops.tuner_ops.set_params(fe, p);
+ fe->ops.tuner_ops.set_params(fe);
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0);
}
diff --git a/drivers/media/dvb/frontends/itd1000.c b/drivers/media/dvb/frontends/itd1000.c
index afe7cc0..3164575 100644
--- a/drivers/media/dvb/frontends/itd1000.c
+++ b/drivers/media/dvb/frontends/itd1000.c
@@ -250,7 +250,7 @@ static void itd1000_set_lo(struct itd1000_state *state, u32 freq_khz)
itd1000_set_vco(state, freq_khz);
}
-static int itd1000_set_parameters(struct dvb_frontend *fe, struct dvb_frontend_parameters *p)
+static int itd1000_set_parameters(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct itd1000_state *state = fe->tuner_priv;
diff --git a/drivers/media/dvb/frontends/ix2505v.c b/drivers/media/dvb/frontends/ix2505v.c
index aca4817..bc5a820 100644
--- a/drivers/media/dvb/frontends/ix2505v.c
+++ b/drivers/media/dvb/frontends/ix2505v.c
@@ -129,8 +129,7 @@ static int ix2505v_release(struct dvb_frontend *fe)
* 1 -> 8 -> 6
*/
-static int ix2505v_set_params(struct dvb_frontend *fe,
- struct dvb_frontend_parameters *params)
+static int ix2505v_set_params(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct ix2505v_state *state = fe->tuner_priv;
diff --git a/drivers/media/dvb/frontends/l64781.c b/drivers/media/dvb/frontends/l64781.c
index 445fa10..eee6bb5 100644
--- a/drivers/media/dvb/frontends/l64781.c
+++ b/drivers/media/dvb/frontends/l64781.c
@@ -140,7 +140,7 @@ static int apply_frontend_param (struct dvb_frontend* fe, struct dvb_frontend_pa
int bw = p->bandwidth - BANDWIDTH_8_MHZ;
if (fe->ops.tuner_ops.set_params) {
- fe->ops.tuner_ops.set_params(fe, param);
+ fe->ops.tuner_ops.set_params(fe);
if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0);
}
diff --git a/drivers/media/dvb/frontends/lgdt3305.c b/drivers/media/dvb/frontends/lgdt3305.c
index 3272881..321f991 100644
--- a/drivers/media/dvb/frontends/lgdt3305.c
+++ b/drivers/media/dvb/frontends/lgdt3305.c
@@ -686,7 +686,7 @@ static int lgdt3304_set_parameters(struct dvb_frontend *fe,
lg_dbg("(%d, %d)\n", param->frequency, param->u.vsb.modulation);
if (fe->ops.tuner_ops.set_params) {
- ret = fe->ops.tuner_ops.set_params(fe, param);
+ ret = fe->ops.tuner_ops.set_params(fe);
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0);
if (lg_fail(ret))
@@ -756,7 +756,7 @@ static int lgdt3305_set_parameters(struct dvb_frontend *fe,
lg_dbg("(%d, %d)\n", param->frequency, param->u.vsb.modulation);
if (fe->ops.tuner_ops.set_params) {
- ret = fe->ops.tuner_ops.set_params(fe, param);
+ ret = fe->ops.tuner_ops.set_params(fe);
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0);
if (lg_fail(ret))
diff --git a/drivers/media/dvb/frontends/lgdt330x.c b/drivers/media/dvb/frontends/lgdt330x.c
index 43971e6..87b6a9c 100644
--- a/drivers/media/dvb/frontends/lgdt330x.c
+++ b/drivers/media/dvb/frontends/lgdt330x.c
@@ -415,7 +415,7 @@ static int lgdt330x_set_parameters(struct dvb_frontend* fe,
/* Tune to the specified frequency */
if (fe->ops.tuner_ops.set_params) {
- fe->ops.tuner_ops.set_params(fe, param);
+ fe->ops.tuner_ops.set_params(fe);
if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0);
}
diff --git a/drivers/media/dvb/frontends/lgs8gl5.c b/drivers/media/dvb/frontends/lgs8gl5.c
index bb37ed2..4a9bd99 100644
--- a/drivers/media/dvb/frontends/lgs8gl5.c
+++ b/drivers/media/dvb/frontends/lgs8gl5.c
@@ -322,7 +322,7 @@ lgs8gl5_set_frontend(struct dvb_frontend *fe,
return -EINVAL;
if (fe->ops.tuner_ops.set_params) {
- fe->ops.tuner_ops.set_params(fe, p);
+ fe->ops.tuner_ops.set_params(fe);
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0);
}
diff --git a/drivers/media/dvb/frontends/lgs8gxx.c b/drivers/media/dvb/frontends/lgs8gxx.c
index 1172b54..bf9b12b 100644
--- a/drivers/media/dvb/frontends/lgs8gxx.c
+++ b/drivers/media/dvb/frontends/lgs8gxx.c
@@ -678,7 +678,7 @@ static int lgs8gxx_set_fe(struct dvb_frontend *fe,
/* set frequency */
if (fe->ops.tuner_ops.set_params) {
- fe->ops.tuner_ops.set_params(fe, fe_params);
+ fe->ops.tuner_ops.set_params(fe);
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0);
}
diff --git a/drivers/media/dvb/frontends/mb86a20s.c b/drivers/media/dvb/frontends/mb86a20s.c
index 0f867a50..8c92070 100644
--- a/drivers/media/dvb/frontends/mb86a20s.c
+++ b/drivers/media/dvb/frontends/mb86a20s.c
@@ -496,7 +496,7 @@ static int mb86a20s_set_frontend(struct dvb_frontend *fe,
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1);
dprintk("Calling tuner set parameters\n");
- fe->ops.tuner_ops.set_params(fe, p);
+ fe->ops.tuner_ops.set_params(fe);
/*
* Make it more reliable: if, for some reason, the initial
diff --git a/drivers/media/dvb/frontends/mt312.c b/drivers/media/dvb/frontends/mt312.c
index 83e6f1a..302d72a 100644
--- a/drivers/media/dvb/frontends/mt312.c
+++ b/drivers/media/dvb/frontends/mt312.c
@@ -603,7 +603,7 @@ static int mt312_set_frontend(struct dvb_frontend *fe,
}
if (fe->ops.tuner_ops.set_params) {
- fe->ops.tuner_ops.set_params(fe, p);
+ fe->ops.tuner_ops.set_params(fe);
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0);
}
diff --git a/drivers/media/dvb/frontends/mt352.c b/drivers/media/dvb/frontends/mt352.c
index e2a86da..16a9fac 100644
--- a/drivers/media/dvb/frontends/mt352.c
+++ b/drivers/media/dvb/frontends/mt352.c
@@ -293,7 +293,7 @@ static int mt352_set_parameters(struct dvb_frontend* fe,
if (state->config.no_tuner) {
if (fe->ops.tuner_ops.set_params) {
- fe->ops.tuner_ops.set_params(fe, param);
+ fe->ops.tuner_ops.set_params(fe);
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0);
}
diff --git a/drivers/media/dvb/frontends/nxt6000.c b/drivers/media/dvb/frontends/nxt6000.c
index 6599b8f..d17dd2d 100644
--- a/drivers/media/dvb/frontends/nxt6000.c
+++ b/drivers/media/dvb/frontends/nxt6000.c
@@ -463,7 +463,7 @@ static int nxt6000_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_par
int result;
if (fe->ops.tuner_ops.set_params) {
- fe->ops.tuner_ops.set_params(fe, param);
+ fe->ops.tuner_ops.set_params(fe);
if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0);
}
diff --git a/drivers/media/dvb/frontends/or51132.c b/drivers/media/dvb/frontends/or51132.c
index 38e67ac..5cd965b 100644
--- a/drivers/media/dvb/frontends/or51132.c
+++ b/drivers/media/dvb/frontends/or51132.c
@@ -363,7 +363,7 @@ static int or51132_set_parameters(struct dvb_frontend* fe,
}
if (fe->ops.tuner_ops.set_params) {
- fe->ops.tuner_ops.set_params(fe, param);
+ fe->ops.tuner_ops.set_params(fe);
if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0);
}
diff --git a/drivers/media/dvb/frontends/or51211.c b/drivers/media/dvb/frontends/or51211.c
index c709ce6..92d4dd8 100644
--- a/drivers/media/dvb/frontends/or51211.c
+++ b/drivers/media/dvb/frontends/or51211.c
@@ -226,7 +226,7 @@ static int or51211_set_parameters(struct dvb_frontend* fe,
/* Change only if we are actually changing the channel */
if (state->current_frequency != param->frequency) {
if (fe->ops.tuner_ops.set_params) {
- fe->ops.tuner_ops.set_params(fe, param);
+ fe->ops.tuner_ops.set_params(fe);
if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0);
}
diff --git a/drivers/media/dvb/frontends/s5h1409.c b/drivers/media/dvb/frontends/s5h1409.c
index 0d6d5e3..5ffb19e 100644
--- a/drivers/media/dvb/frontends/s5h1409.c
+++ b/drivers/media/dvb/frontends/s5h1409.c
@@ -647,7 +647,7 @@ static int s5h1409_set_frontend(struct dvb_frontend *fe,
if (fe->ops.tuner_ops.set_params) {
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1);
- fe->ops.tuner_ops.set_params(fe, p);
+ fe->ops.tuner_ops.set_params(fe);
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0);
}
diff --git a/drivers/media/dvb/frontends/s5h1411.c b/drivers/media/dvb/frontends/s5h1411.c
index 5fca113..6852abe 100644
--- a/drivers/media/dvb/frontends/s5h1411.c
+++ b/drivers/media/dvb/frontends/s5h1411.c
@@ -602,7 +602,7 @@ static int s5h1411_set_frontend(struct dvb_frontend *fe,
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1);
- fe->ops.tuner_ops.set_params(fe, p);
+ fe->ops.tuner_ops.set_params(fe);
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0);
diff --git a/drivers/media/dvb/frontends/s5h1420.c b/drivers/media/dvb/frontends/s5h1420.c
index 3879d2e..c4a8a01 100644
--- a/drivers/media/dvb/frontends/s5h1420.c
+++ b/drivers/media/dvb/frontends/s5h1420.c
@@ -649,7 +649,7 @@ static int s5h1420_set_frontend(struct dvb_frontend* fe,
(state->symbol_rate == p->u.qpsk.symbol_rate)) {
if (fe->ops.tuner_ops.set_params) {
- fe->ops.tuner_ops.set_params(fe, p);
+ fe->ops.tuner_ops.set_params(fe);
if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0);
}
if (fe->ops.tuner_ops.get_frequency) {
@@ -744,7 +744,7 @@ static int s5h1420_set_frontend(struct dvb_frontend* fe,
/* set tuner PLL */
if (fe->ops.tuner_ops.set_params) {
- fe->ops.tuner_ops.set_params(fe, p);
+ fe->ops.tuner_ops.set_params(fe);
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0);
s5h1420_setfreqoffset(state, 0);
diff --git a/drivers/media/dvb/frontends/s5h1432.c b/drivers/media/dvb/frontends/s5h1432.c
index 0c6dcb9..2717bae 100644
--- a/drivers/media/dvb/frontends/s5h1432.c
+++ b/drivers/media/dvb/frontends/s5h1432.c
@@ -188,7 +188,7 @@ static int s5h1432_set_frontend(struct dvb_frontend *fe,
/*current_frequency = p->frequency; */
/*state->current_frequency = p->frequency; */
} else {
- fe->ops.tuner_ops.set_params(fe, p);
+ fe->ops.tuner_ops.set_params(fe);
msleep(300);
s5h1432_set_channel_bandwidth(fe, dvb_bandwidth);
switch (p->u.ofdm.bandwidth) {
@@ -207,7 +207,7 @@ static int s5h1432_set_frontend(struct dvb_frontend *fe,
default:
return 0;
}
- /*fe->ops.tuner_ops.set_params(fe, p); */
+ /*fe->ops.tuner_ops.set_params(fe); */
/*Soft Reset chip*/
msleep(30);
s5h1432_writereg(state, S5H1432_I2C_TOP_ADDR, 0x09, 0x1a);
@@ -231,7 +231,7 @@ static int s5h1432_set_frontend(struct dvb_frontend *fe,
default:
return 0;
}
- /*fe->ops.tuner_ops.set_params(fe,p); */
+ /*fe->ops.tuner_ops.set_params(fe); */
/*Soft Reset chip*/
msleep(30);
s5h1432_writereg(state, S5H1432_I2C_TOP_ADDR, 0x09, 0x1a);
diff --git a/drivers/media/dvb/frontends/sp8870.c b/drivers/media/dvb/frontends/sp8870.c
index b85eb60..9cff909 100644
--- a/drivers/media/dvb/frontends/sp8870.c
+++ b/drivers/media/dvb/frontends/sp8870.c
@@ -260,7 +260,7 @@ static int sp8870_set_frontend_parameters (struct dvb_frontend* fe,
// set tuner parameters
if (fe->ops.tuner_ops.set_params) {
- fe->ops.tuner_ops.set_params(fe, p);
+ fe->ops.tuner_ops.set_params(fe);
if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0);
}
diff --git a/drivers/media/dvb/frontends/sp887x.c b/drivers/media/dvb/frontends/sp887x.c
index 4a7c3d8..efe0926 100644
--- a/drivers/media/dvb/frontends/sp887x.c
+++ b/drivers/media/dvb/frontends/sp887x.c
@@ -353,7 +353,7 @@ static int sp887x_setup_frontend_parameters (struct dvb_frontend* fe,
/* setup the PLL */
if (fe->ops.tuner_ops.set_params) {
- fe->ops.tuner_ops.set_params(fe, p);
+ fe->ops.tuner_ops.set_params(fe);
if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0);
}
if (fe->ops.tuner_ops.get_frequency) {
diff --git a/drivers/media/dvb/frontends/stb6000.c b/drivers/media/dvb/frontends/stb6000.c
index d4f4ebb..a0c3c52 100644
--- a/drivers/media/dvb/frontends/stb6000.c
+++ b/drivers/media/dvb/frontends/stb6000.c
@@ -75,8 +75,7 @@ static int stb6000_sleep(struct dvb_frontend *fe)
return (ret == 1) ? 0 : ret;
}
-static int stb6000_set_params(struct dvb_frontend *fe,
- struct dvb_frontend_parameters *params)
+static int stb6000_set_params(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct stb6000_priv *priv = fe->tuner_priv;
diff --git a/drivers/media/dvb/frontends/stv0288.c b/drivers/media/dvb/frontends/stv0288.c
index 0aa3962..a1b4933 100644
--- a/drivers/media/dvb/frontends/stv0288.c
+++ b/drivers/media/dvb/frontends/stv0288.c
@@ -484,7 +484,7 @@ static int stv0288_set_frontend(struct dvb_frontend *fe,
dfp->frequency = c->frequency;
dfp->u.qpsk.symbol_rate = c->symbol_rate;
if (fe->ops.tuner_ops.set_params) {
- fe->ops.tuner_ops.set_params(fe, dfp);
+ fe->ops.tuner_ops.set_params(fe);
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0);
}
diff --git a/drivers/media/dvb/frontends/stv0297.c b/drivers/media/dvb/frontends/stv0297.c
index 84d88f33..daeaddf 100644
--- a/drivers/media/dvb/frontends/stv0297.c
+++ b/drivers/media/dvb/frontends/stv0297.c
@@ -455,7 +455,7 @@ static int stv0297_set_frontend(struct dvb_frontend *fe, struct dvb_frontend_par
stv0297_init(fe);
if (fe->ops.tuner_ops.set_params) {
- fe->ops.tuner_ops.set_params(fe, p);
+ fe->ops.tuner_ops.set_params(fe);
if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0);
}
diff --git a/drivers/media/dvb/frontends/stv0299.c b/drivers/media/dvb/frontends/stv0299.c
index 42684be..bd79e05 100644
--- a/drivers/media/dvb/frontends/stv0299.c
+++ b/drivers/media/dvb/frontends/stv0299.c
@@ -579,7 +579,7 @@ static int stv0299_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_par
stv0299_writeregI(state, 0x0c, (stv0299_readreg(state, 0x0c) & 0xfe) | invval);
if (fe->ops.tuner_ops.set_params) {
- fe->ops.tuner_ops.set_params(fe, p);
+ fe->ops.tuner_ops.set_params(fe);
if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0);
}
diff --git a/drivers/media/dvb/frontends/stv0367.c b/drivers/media/dvb/frontends/stv0367.c
index e57ab53..586295d 100644
--- a/drivers/media/dvb/frontends/stv0367.c
+++ b/drivers/media/dvb/frontends/stv0367.c
@@ -1822,7 +1822,7 @@ static int stv0367ter_set_frontend(struct dvb_frontend *fe,
if (fe->ops.tuner_ops.set_params) {
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1);
- fe->ops.tuner_ops.set_params(fe, param);
+ fe->ops.tuner_ops.set_params(fe);
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0);
}
@@ -3120,7 +3120,7 @@ static int stv0367cab_set_frontend(struct dvb_frontend *fe,
if (fe->ops.tuner_ops.set_params) {
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1);
- fe->ops.tuner_ops.set_params(fe, param);
+ fe->ops.tuner_ops.set_params(fe);
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0);
}
diff --git a/drivers/media/dvb/frontends/stv6110.c b/drivers/media/dvb/frontends/stv6110.c
index 2dca7c8..20b5fa9 100644
--- a/drivers/media/dvb/frontends/stv6110.c
+++ b/drivers/media/dvb/frontends/stv6110.c
@@ -347,8 +347,7 @@ static int stv6110_set_frequency(struct dvb_frontend *fe, u32 frequency)
return 0;
}
-static int stv6110_set_params(struct dvb_frontend *fe,
- struct dvb_frontend_parameters *params)
+static int stv6110_set_params(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
u32 bandwidth = carrier_width(c->symbol_rate, c->rolloff);
diff --git a/drivers/media/dvb/frontends/tda10021.c b/drivers/media/dvb/frontends/tda10021.c
index 2518c5a..a1629d1 100644
--- a/drivers/media/dvb/frontends/tda10021.c
+++ b/drivers/media/dvb/frontends/tda10021.c
@@ -283,7 +283,7 @@ static int tda10021_set_parameters (struct dvb_frontend *fe,
//printk("tda10021: set frequency to %d qam=%d symrate=%d\n", p->frequency,qam,p->u.qam.symbol_rate);
if (fe->ops.tuner_ops.set_params) {
- fe->ops.tuner_ops.set_params(fe, p);
+ fe->ops.tuner_ops.set_params(fe);
if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0);
}
diff --git a/drivers/media/dvb/frontends/tda10023.c b/drivers/media/dvb/frontends/tda10023.c
index af7f1b8..ecc4b55 100644
--- a/drivers/media/dvb/frontends/tda10023.c
+++ b/drivers/media/dvb/frontends/tda10023.c
@@ -351,7 +351,7 @@ static int tda10023_set_parameters (struct dvb_frontend *fe,
}
if (fe->ops.tuner_ops.set_params) {
- fe->ops.tuner_ops.set_params(fe, p);
+ fe->ops.tuner_ops.set_params(fe);
if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0);
}
diff --git a/drivers/media/dvb/frontends/tda10048.c b/drivers/media/dvb/frontends/tda10048.c
index 7f10594..d450385 100644
--- a/drivers/media/dvb/frontends/tda10048.c
+++ b/drivers/media/dvb/frontends/tda10048.c
@@ -756,7 +756,7 @@ static int tda10048_set_frontend(struct dvb_frontend *fe,
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1);
- fe->ops.tuner_ops.set_params(fe, p);
+ fe->ops.tuner_ops.set_params(fe);
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0);
diff --git a/drivers/media/dvb/frontends/tda1004x.c b/drivers/media/dvb/frontends/tda1004x.c
index ea485d9..dbac35b 100644
--- a/drivers/media/dvb/frontends/tda1004x.c
+++ b/drivers/media/dvb/frontends/tda1004x.c
@@ -718,7 +718,7 @@ static int tda1004x_set_fe(struct dvb_frontend* fe,
// set frequency
if (fe->ops.tuner_ops.set_params) {
- fe->ops.tuner_ops.set_params(fe, fe_params);
+ fe->ops.tuner_ops.set_params(fe);
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0);
}
diff --git a/drivers/media/dvb/frontends/tda10086.c b/drivers/media/dvb/frontends/tda10086.c
index f2c8faa..7656ff7 100644
--- a/drivers/media/dvb/frontends/tda10086.c
+++ b/drivers/media/dvb/frontends/tda10086.c
@@ -425,7 +425,7 @@ static int tda10086_set_frontend(struct dvb_frontend* fe,
/* set params */
if (fe->ops.tuner_ops.set_params) {
- fe->ops.tuner_ops.set_params(fe, fe_params);
+ fe->ops.tuner_ops.set_params(fe);
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0);
diff --git a/drivers/media/dvb/frontends/tda18271c2dd.c b/drivers/media/dvb/frontends/tda18271c2dd.c
index 0f8e962..ea6df8e 100644
--- a/drivers/media/dvb/frontends/tda18271c2dd.c
+++ b/drivers/media/dvb/frontends/tda18271c2dd.c
@@ -1124,8 +1124,7 @@ static int release(struct dvb_frontend *fe)
}
-static int set_params(struct dvb_frontend *fe,
- struct dvb_frontend_parameters *params)
+static int set_params(struct dvb_frontend *fe)
{
struct tda_state *state = fe->tuner_priv;
int status = 0;
diff --git a/drivers/media/dvb/frontends/tda8083.c b/drivers/media/dvb/frontends/tda8083.c
index 9369f74..3f2b1b8 100644
--- a/drivers/media/dvb/frontends/tda8083.c
+++ b/drivers/media/dvb/frontends/tda8083.c
@@ -320,7 +320,7 @@ static int tda8083_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_par
struct tda8083_state* state = fe->demodulator_priv;
if (fe->ops.tuner_ops.set_params) {
- fe->ops.tuner_ops.set_params(fe, p);
+ fe->ops.tuner_ops.set_params(fe);
if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0);
}
diff --git a/drivers/media/dvb/frontends/tda826x.c b/drivers/media/dvb/frontends/tda826x.c
index ab9122a..04bbcc2 100644
--- a/drivers/media/dvb/frontends/tda826x.c
+++ b/drivers/media/dvb/frontends/tda826x.c
@@ -71,7 +71,7 @@ static int tda826x_sleep(struct dvb_frontend *fe)
return (ret == 1) ? 0 : ret;
}
-static int tda826x_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
+static int tda826x_set_params(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct tda826x_priv *priv = fe->tuner_priv;
diff --git a/drivers/media/dvb/frontends/tdhd1.h b/drivers/media/dvb/frontends/tdhd1.h
index 9db221b..1775098 100644
--- a/drivers/media/dvb/frontends/tdhd1.h
+++ b/drivers/media/dvb/frontends/tdhd1.h
@@ -40,7 +40,7 @@ static struct tda1004x_config alps_tdhd1_204a_config = {
.request_firmware = alps_tdhd1_204_request_firmware
};
-static int alps_tdhd1_204a_tuner_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
+static int alps_tdhd1_204a_tuner_set_params(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct i2c_adapter *i2c = fe->tuner_priv;
diff --git a/drivers/media/dvb/frontends/tua6100.c b/drivers/media/dvb/frontends/tua6100.c
index 621d750..aebe260 100644
--- a/drivers/media/dvb/frontends/tua6100.c
+++ b/drivers/media/dvb/frontends/tua6100.c
@@ -67,8 +67,7 @@ static int tua6100_sleep(struct dvb_frontend *fe)
return (ret == 1) ? 0 : ret;
}
-static int tua6100_set_params(struct dvb_frontend *fe,
- struct dvb_frontend_parameters *params)
+static int tua6100_set_params(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct tua6100_priv *priv = fe->tuner_priv;
diff --git a/drivers/media/dvb/frontends/ves1820.c b/drivers/media/dvb/frontends/ves1820.c
index 550a07a..270c7f9 100644
--- a/drivers/media/dvb/frontends/ves1820.c
+++ b/drivers/media/dvb/frontends/ves1820.c
@@ -219,7 +219,7 @@ static int ves1820_set_parameters(struct dvb_frontend* fe, struct dvb_frontend_p
return -EINVAL;
if (fe->ops.tuner_ops.set_params) {
- fe->ops.tuner_ops.set_params(fe, p);
+ fe->ops.tuner_ops.set_params(fe);
if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0);
}
diff --git a/drivers/media/dvb/frontends/ves1x93.c b/drivers/media/dvb/frontends/ves1x93.c
index 8d7854c..5ffbf5e 100644
--- a/drivers/media/dvb/frontends/ves1x93.c
+++ b/drivers/media/dvb/frontends/ves1x93.c
@@ -389,7 +389,7 @@ static int ves1x93_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_par
struct ves1x93_state* state = fe->demodulator_priv;
if (fe->ops.tuner_ops.set_params) {
- fe->ops.tuner_ops.set_params(fe, p);
+ fe->ops.tuner_ops.set_params(fe);
if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0);
}
ves1x93_set_inversion (state, p->inversion);
diff --git a/drivers/media/dvb/frontends/zl10036.c b/drivers/media/dvb/frontends/zl10036.c
index 129d0f2..0903d46 100644
--- a/drivers/media/dvb/frontends/zl10036.c
+++ b/drivers/media/dvb/frontends/zl10036.c
@@ -305,8 +305,7 @@ static int zl10036_set_gain_params(struct zl10036_state *state,
return zl10036_write(state, buf, sizeof(buf));
}
-static int zl10036_set_params(struct dvb_frontend *fe,
- struct dvb_frontend_parameters *params)
+static int zl10036_set_params(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct zl10036_state *state = fe->tuner_priv;
diff --git a/drivers/media/dvb/frontends/zl10039.c b/drivers/media/dvb/frontends/zl10039.c
index 7fc8cef..eff9c5f 100644
--- a/drivers/media/dvb/frontends/zl10039.c
+++ b/drivers/media/dvb/frontends/zl10039.c
@@ -176,8 +176,7 @@ static int zl10039_sleep(struct dvb_frontend *fe)
return 0;
}
-static int zl10039_set_params(struct dvb_frontend *fe,
- struct dvb_frontend_parameters *params)
+static int zl10039_set_params(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct zl10039_state *state = fe->tuner_priv;
diff --git a/drivers/media/dvb/frontends/zl10353.c b/drivers/media/dvb/frontends/zl10353.c
index 9caccc0..0945aa0 100644
--- a/drivers/media/dvb/frontends/zl10353.c
+++ b/drivers/media/dvb/frontends/zl10353.c
@@ -362,7 +362,7 @@ static int zl10353_set_parameters(struct dvb_frontend *fe,
*/
if (state->config.no_tuner) {
if (fe->ops.tuner_ops.set_params) {
- fe->ops.tuner_ops.set_params(fe, param);
+ fe->ops.tuner_ops.set_params(fe);
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0);
}
diff --git a/drivers/media/dvb/mantis/mantis_vp1033.c b/drivers/media/dvb/mantis/mantis_vp1033.c
index dfaca2a..ad013e9 100644
--- a/drivers/media/dvb/mantis/mantis_vp1033.c
+++ b/drivers/media/dvb/mantis/mantis_vp1033.c
@@ -83,8 +83,7 @@ u8 lgtdqcs001f_inittab[] = {
#define MANTIS_MODEL_NAME "VP-1033"
#define MANTIS_DEV_TYPE "DVB-S/DSS"
-int lgtdqcs001f_tuner_set(struct dvb_frontend *fe,
- struct dvb_frontend_parameters *params)
+int lgtdqcs001f_tuner_set(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct mantis_pci *mantis = fe->dvb->priv;
diff --git a/drivers/media/dvb/mantis/mantis_vp2033.c b/drivers/media/dvb/mantis/mantis_vp2033.c
index f58ce60..1ca6837 100644
--- a/drivers/media/dvb/mantis/mantis_vp2033.c
+++ b/drivers/media/dvb/mantis/mantis_vp2033.c
@@ -65,7 +65,7 @@ static u8 read_pwm(struct mantis_pci *mantis)
return pwm;
}
-static int tda1002x_cu1216_tuner_set(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
+static int tda1002x_cu1216_tuner_set(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct mantis_pci *mantis = fe->dvb->priv;
diff --git a/drivers/media/dvb/mantis/mantis_vp2040.c b/drivers/media/dvb/mantis/mantis_vp2040.c
index beadfea..d480741 100644
--- a/drivers/media/dvb/mantis/mantis_vp2040.c
+++ b/drivers/media/dvb/mantis/mantis_vp2040.c
@@ -47,7 +47,7 @@ struct tda10023_config vp2040_tda10023_cu1216_config = {
.invert = 1,
};
-static int tda1002x_cu1216_tuner_set(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
+static int tda1002x_cu1216_tuner_set(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct mantis_pci *mantis = fe->dvb->priv;
diff --git a/drivers/media/dvb/pluto2/pluto2.c b/drivers/media/dvb/pluto2/pluto2.c
index 027da57..e1f20c2 100644
--- a/drivers/media/dvb/pluto2/pluto2.c
+++ b/drivers/media/dvb/pluto2/pluto2.c
@@ -445,8 +445,7 @@ static inline u32 divide(u32 numerator, u32 denominator)
}
/* LG Innotek TDTE-E001P (Infineon TUA6034) */
-static int lg_tdtpe001p_tuner_set_params(struct dvb_frontend *fe,
- struct dvb_frontend_parameters *foo)
+static int lg_tdtpe001p_tuner_set_params(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct pluto *pluto = frontend_to_pluto(fe);
diff --git a/drivers/media/dvb/ttpci/av7110.c b/drivers/media/dvb/ttpci/av7110.c
index 37eb4ac..371fb29 100644
--- a/drivers/media/dvb/ttpci/av7110.c
+++ b/drivers/media/dvb/ttpci/av7110.c
@@ -1568,7 +1568,7 @@ static int get_firmware(struct av7110* av7110)
return ret;
}
-static int alps_bsrv2_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters *params)
+static int alps_bsrv2_tuner_set_params(struct dvb_frontend* fe)
{
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct av7110* av7110 = fe->dvb->priv;
@@ -1605,7 +1605,7 @@ static struct ves1x93_config alps_bsrv2_config = {
.invert_pwm = 0,
};
-static int alps_tdbe2_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters *params)
+static int alps_tdbe2_tuner_set_params(struct dvb_frontend* fe)
{
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct av7110* av7110 = fe->dvb->priv;
@@ -1637,7 +1637,7 @@ static struct ves1820_config alps_tdbe2_config = {
-static int grundig_29504_451_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters *params)
+static int grundig_29504_451_tuner_set_params(struct dvb_frontend* fe)
{
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct av7110* av7110 = fe->dvb->priv;
@@ -1664,7 +1664,7 @@ static struct tda8083_config grundig_29504_451_config = {
-static int philips_cd1516_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters *params)
+static int philips_cd1516_tuner_set_params(struct dvb_frontend* fe)
{
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct av7110* av7110 = fe->dvb->priv;
@@ -1696,7 +1696,7 @@ static struct ves1820_config philips_cd1516_config = {
-static int alps_tdlb7_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters *params)
+static int alps_tdlb7_tuner_set_params(struct dvb_frontend* fe)
{
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct av7110* av7110 = fe->dvb->priv;
@@ -1834,7 +1834,7 @@ static u8 nexusca_stv0297_inittab[] = {
0xff, 0xff,
};
-static int nexusca_stv0297_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters *params)
+static int nexusca_stv0297_tuner_set_params(struct dvb_frontend* fe)
{
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct av7110* av7110 = fe->dvb->priv;
@@ -1890,7 +1890,7 @@ static struct stv0297_config nexusca_stv0297_config = {
-static int grundig_29504_401_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters *params)
+static int grundig_29504_401_tuner_set_params(struct dvb_frontend* fe)
{
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct av7110* av7110 = fe->dvb->priv;
diff --git a/drivers/media/dvb/ttpci/budget-av.c b/drivers/media/dvb/ttpci/budget-av.c
index ef03777..d6a083b 100644
--- a/drivers/media/dvb/ttpci/budget-av.c
+++ b/drivers/media/dvb/ttpci/budget-av.c
@@ -502,8 +502,7 @@ static int philips_su1278_ty_ci_set_symbol_rate(struct dvb_frontend *fe, u32 sra
return 0;
}
-static int philips_su1278_ty_ci_tuner_set_params(struct dvb_frontend *fe,
- struct dvb_frontend_parameters *params)
+static int philips_su1278_ty_ci_tuner_set_params(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
u32 div;
@@ -618,7 +617,7 @@ static struct stv0299_config cinergy_1200s_1894_0010_config = {
.set_symbol_rate = philips_su1278_ty_ci_set_symbol_rate,
};
-static int philips_cu1216_tuner_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
+static int philips_cu1216_tuner_set_params(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct budget *budget = (struct budget *) fe->dvb->priv;
@@ -699,7 +698,7 @@ static int philips_tu1216_tuner_init(struct dvb_frontend *fe)
return 0;
}
-static int philips_tu1216_tuner_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
+static int philips_tu1216_tuner_set_params(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct budget *budget = (struct budget *) fe->dvb->priv;
diff --git a/drivers/media/dvb/ttpci/budget-ci.c b/drivers/media/dvb/ttpci/budget-ci.c
index 9807968..9a2d3a0 100644
--- a/drivers/media/dvb/ttpci/budget-ci.c
+++ b/drivers/media/dvb/ttpci/budget-ci.c
@@ -660,8 +660,7 @@ static int philips_su1278_tt_set_symbol_rate(struct dvb_frontend *fe, u32 srate,
return 0;
}
-static int philips_su1278_tt_tuner_set_params(struct dvb_frontend *fe,
- struct dvb_frontend_parameters *params)
+static int philips_su1278_tt_tuner_set_params(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct budget_ci *budget_ci = (struct budget_ci *) fe->dvb->priv;
@@ -742,7 +741,7 @@ static int philips_tdm1316l_tuner_init(struct dvb_frontend *fe)
return 0;
}
-static int philips_tdm1316l_tuner_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
+static int philips_tdm1316l_tuner_set_params(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct budget_ci *budget_ci = (struct budget_ci *) fe->dvb->priv;
@@ -858,7 +857,7 @@ static struct tda1004x_config philips_tdm1316l_config_invert = {
.request_firmware = philips_tdm1316l_request_firmware,
};
-static int dvbc_philips_tdm1316l_tuner_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
+static int dvbc_philips_tdm1316l_tuner_set_params(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct budget_ci *budget_ci = (struct budget_ci *) fe->dvb->priv;
diff --git a/drivers/media/dvb/ttpci/budget-patch.c b/drivers/media/dvb/ttpci/budget-patch.c
index 1f14a7f..1dda7ed 100644
--- a/drivers/media/dvb/ttpci/budget-patch.c
+++ b/drivers/media/dvb/ttpci/budget-patch.c
@@ -261,7 +261,7 @@ static int budget_patch_diseqc_send_burst(struct dvb_frontend* fe, fe_sec_mini_c
return 0;
}
-static int alps_bsrv2_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters* params)
+static int alps_bsrv2_tuner_set_params(struct dvb_frontend* fe)
{
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct budget_patch* budget = (struct budget_patch*) fe->dvb->priv;
@@ -298,7 +298,7 @@ static struct ves1x93_config alps_bsrv2_config = {
.invert_pwm = 0,
};
-static int grundig_29504_451_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters* params)
+static int grundig_29504_451_tuner_set_params(struct dvb_frontend* fe)
{
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct budget_patch* budget = (struct budget_patch*) fe->dvb->priv;
diff --git a/drivers/media/dvb/ttpci/budget.c b/drivers/media/dvb/ttpci/budget.c
index 719b965..10fcc02 100644
--- a/drivers/media/dvb/ttpci/budget.c
+++ b/drivers/media/dvb/ttpci/budget.c
@@ -200,7 +200,7 @@ static int budget_diseqc_send_burst(struct dvb_frontend* fe, fe_sec_mini_cmd_t m
return 0;
}
-static int alps_bsrv2_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters* params)
+static int alps_bsrv2_tuner_set_params(struct dvb_frontend* fe)
{
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct budget* budget = (struct budget*) fe->dvb->priv;
@@ -237,7 +237,7 @@ static struct ves1x93_config alps_bsrv2_config =
.invert_pwm = 0,
};
-static int alps_tdbe2_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters* params)
+static int alps_tdbe2_tuner_set_params(struct dvb_frontend* fe)
{
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct budget* budget = (struct budget*) fe->dvb->priv;
@@ -265,7 +265,7 @@ static struct ves1820_config alps_tdbe2_config = {
.selagc = VES1820_SELAGC_SIGNAMPERR,
};
-static int grundig_29504_401_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters* params)
+static int grundig_29504_401_tuner_set_params(struct dvb_frontend* fe)
{
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct budget *budget = fe->dvb->priv;
@@ -315,7 +315,7 @@ static struct l64781_config grundig_29504_401_config_activy = {
static u8 tuner_address_grundig_29504_401_activy = 0x60;
-static int grundig_29504_451_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters* params)
+static int grundig_29504_451_tuner_set_params(struct dvb_frontend* fe)
{
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct budget* budget = (struct budget*) fe->dvb->priv;
@@ -339,7 +339,7 @@ static struct tda8083_config grundig_29504_451_config = {
.demod_address = 0x68,
};
-static int s5h1420_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters* params)
+static int s5h1420_tuner_set_params(struct dvb_frontend* fe)
{
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct budget* budget = (struct budget*) fe->dvb->priv;
diff --git a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
index 2379f38..514eff0 100644
--- a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
+++ b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
@@ -1017,7 +1017,7 @@ static u32 functionality(struct i2c_adapter *adapter)
-static int alps_tdmb7_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters* params)
+static int alps_tdmb7_tuner_set_params(struct dvb_frontend* fe)
{
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct ttusb* ttusb = (struct ttusb*) fe->dvb->priv;
@@ -1072,7 +1072,7 @@ static int philips_tdm1316l_tuner_init(struct dvb_frontend* fe)
return 0;
}
-static int philips_tdm1316l_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters* params)
+static int philips_tdm1316l_tuner_set_params(struct dvb_frontend* fe)
{
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct ttusb* ttusb = (struct ttusb*) fe->dvb->priv;
@@ -1279,7 +1279,7 @@ static int alps_stv0299_set_symbol_rate(struct dvb_frontend *fe, u32 srate, u32
return 0;
}
-static int philips_tsa5059_tuner_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
+static int philips_tsa5059_tuner_set_params(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct ttusb* ttusb = (struct ttusb*) fe->dvb->priv;
@@ -1323,7 +1323,7 @@ static struct stv0299_config alps_stv0299_config = {
.set_symbol_rate = alps_stv0299_set_symbol_rate,
};
-static int ttusb_novas_grundig_29504_491_tuner_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
+static int ttusb_novas_grundig_29504_491_tuner_set_params(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct ttusb* ttusb = (struct ttusb*) fe->dvb->priv;
@@ -1351,7 +1351,7 @@ static struct tda8083_config ttusb_novas_grundig_29504_491_config = {
.demod_address = 0x68,
};
-static int alps_tdbe2_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters* params)
+static int alps_tdbe2_tuner_set_params(struct dvb_frontend* fe)
{
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct ttusb* ttusb = fe->dvb->priv;
@@ -1396,7 +1396,7 @@ static u8 read_pwm(struct ttusb* ttusb)
}
-static int dvbc_philips_tdm1316l_tuner_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
+static int dvbc_philips_tdm1316l_tuner_set_params(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct ttusb *ttusb = (struct ttusb *) fe->dvb->priv;
diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c
index 1311af0..91c02de 100644
--- a/drivers/media/video/cx88/cx88-dvb.c
+++ b/drivers/media/video/cx88/cx88-dvb.c
@@ -815,8 +815,7 @@ static const u8 samsung_smt_7020_inittab[] = {
};
-static int samsung_smt_7020_tuner_set_params(struct dvb_frontend *fe,
- struct dvb_frontend_parameters *params)
+static int samsung_smt_7020_tuner_set_params(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct cx8802_dev *dev = fe->dvb->priv;
diff --git a/drivers/media/video/saa7134/saa7134-dvb.c b/drivers/media/video/saa7134/saa7134-dvb.c
index 5fdb845..2bfc866 100644
--- a/drivers/media/video/saa7134/saa7134-dvb.c
+++ b/drivers/media/video/saa7134/saa7134-dvb.c
@@ -183,8 +183,7 @@ static int mt352_avermedia_xc3028_init(struct dvb_frontend *fe)
return 0;
}
-static int mt352_pinnacle_tuner_set_params(struct dvb_frontend* fe,
- struct dvb_frontend_parameters* params)
+static int mt352_pinnacle_tuner_set_params(struct dvb_frontend* fe)
{
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
u8 off[] = { 0x00, 0xf1};
@@ -288,7 +287,7 @@ static int philips_tda1004x_request_firmware(struct dvb_frontend *fe,
* these tuners are tu1216, td1316(a)
*/
-static int philips_tda6651_pll_set(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
+static int philips_tda6651_pll_set(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct saa7134_dev *dev = fe->dvb->priv;
@@ -438,9 +437,9 @@ static int philips_td1316_tuner_init(struct dvb_frontend *fe)
return 0;
}
-static int philips_td1316_tuner_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
+static int philips_td1316_tuner_set_params(struct dvb_frontend *fe)
{
- return philips_tda6651_pll_set(fe, params);
+ return philips_tda6651_pll_set(fe);
}
static int philips_td1316_tuner_sleep(struct dvb_frontend *fe)
--
1.7.8.352.g876a6
^ permalink raw reply related [flat|nested] 51+ messages in thread
* Re: [PATCH v4 16/47] [media] tuner-xc2028: use DVBv5 parameters on set_params()
2011-12-24 15:50 ` [PATCH v4 16/47] [media] tuner-xc2028: " Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 17/47] [media] xc4000: " Mauro Carvalho Chehab
@ 2012-01-02 19:32 ` Gianluca Gennari
2012-01-04 18:50 ` Mauro Carvalho Chehab
1 sibling, 1 reply; 51+ messages in thread
From: Gianluca Gennari @ 2012-01-02 19:32 UTC (permalink / raw)
To: Mauro Carvalho Chehab, linux-media
Il 24/12/2011 16:50, Mauro Carvalho Chehab ha scritto:
> Instead of using DVBv3 parameters, rely on DVBv5 parameters to
> set the tuner.
>
> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
> ---
> drivers/media/common/tuners/tuner-xc2028.c | 83 ++++++++++++----------------
> 1 files changed, 36 insertions(+), 47 deletions(-)
>
> diff --git a/drivers/media/common/tuners/tuner-xc2028.c b/drivers/media/common/tuners/tuner-xc2028.c
> index e531267..8c0dc6a1 100644
> --- a/drivers/media/common/tuners/tuner-xc2028.c
> +++ b/drivers/media/common/tuners/tuner-xc2028.c
> @@ -1087,65 +1087,26 @@ static int xc2028_set_analog_freq(struct dvb_frontend *fe,
> static int xc2028_set_params(struct dvb_frontend *fe,
> struct dvb_frontend_parameters *p)
> {
> + struct dtv_frontend_properties *c = &fe->dtv_property_cache;
> + u32 delsys = c->delivery_system;
> + u32 bw = c->bandwidth_hz;
> struct xc2028_data *priv = fe->tuner_priv;
> unsigned int type=0;
> - fe_bandwidth_t bw = BANDWIDTH_8_MHZ;
> u16 demod = 0;
>
> tuner_dbg("%s called\n", __func__);
>
> - switch(fe->ops.info.type) {
> - case FE_OFDM:
> - bw = p->u.ofdm.bandwidth;
> + switch (delsys) {
> + case SYS_DVBT:
> + case SYS_DVBT2:
> /*
> * The only countries with 6MHz seem to be Taiwan/Uruguay.
> * Both seem to require QAM firmware for OFDM decoding
> * Tested in Taiwan by Terry Wu <terrywu2009@gmail.com>
> */
> - if (bw == BANDWIDTH_6_MHZ)
> + if (bw <= 6000000)
> type |= QAM;
> - break;
> - case FE_ATSC:
> - bw = BANDWIDTH_6_MHZ;
> - /* The only ATSC firmware (at least on v2.7) is D2633 */
> - type |= ATSC | D2633;
> - break;
> - /* DVB-S and pure QAM (FE_QAM) are not supported */
> - default:
> - return -EINVAL;
> - }
> -
> - switch (bw) {
> - case BANDWIDTH_8_MHZ:
> - if (p->frequency < 470000000)
> - priv->ctrl.vhfbw7 = 0;
> - else
> - priv->ctrl.uhfbw8 = 1;
> - type |= (priv->ctrl.vhfbw7 && priv->ctrl.uhfbw8) ? DTV78 : DTV8;
> - type |= F8MHZ;
> - break;
> - case BANDWIDTH_7_MHZ:
> - if (p->frequency < 470000000)
> - priv->ctrl.vhfbw7 = 1;
> - else
> - priv->ctrl.uhfbw8 = 0;
> - type |= (priv->ctrl.vhfbw7 && priv->ctrl.uhfbw8) ? DTV78 : DTV7;
> - type |= F8MHZ;
> - break;
> - case BANDWIDTH_6_MHZ:
> - type |= DTV6;
> - priv->ctrl.vhfbw7 = 0;
> - priv->ctrl.uhfbw8 = 0;
> - break;
> - default:
> - tuner_err("error: bandwidth not supported.\n");
> - };
>
> - /*
> - Selects between D2633 or D2620 firmware.
> - It doesn't make sense for ATSC, since it should be D2633 on all cases
> - */
> - if (fe->ops.info.type != FE_ATSC) {
> switch (priv->ctrl.type) {
> case XC2028_D2633:
> type |= D2633;
> @@ -1161,6 +1122,34 @@ static int xc2028_set_params(struct dvb_frontend *fe,
> else
> type |= D2620;
> }
> + break;
> + case SYS_ATSC:
> + /* The only ATSC firmware (at least on v2.7) is D2633 */
> + type |= ATSC | D2633;
> + break;
> + /* DVB-S and pure QAM (FE_QAM) are not supported */
> + default:
> + return -EINVAL;
> + }
> +
> + if (bw <= 6000000) {
> + type |= DTV6;
> + priv->ctrl.vhfbw7 = 0;
> + priv->ctrl.uhfbw8 = 0;
> + } else if (bw <= 7000000) {
> + if (c->frequency < 470000000)
> + priv->ctrl.vhfbw7 = 1;
> + else
> + priv->ctrl.uhfbw8 = 0;
> + type |= (priv->ctrl.vhfbw7 && priv->ctrl.uhfbw8) ? DTV78 : DTV7;
> + type |= F8MHZ;
> + } else {
> + if (c->frequency < 470000000)
> + priv->ctrl.vhfbw7 = 0;
> + else
> + priv->ctrl.uhfbw8 = 1;
> + type |= (priv->ctrl.vhfbw7 && priv->ctrl.uhfbw8) ? DTV78 : DTV8;
> + type |= F8MHZ;
> }
>
> /* All S-code tables need a 200kHz shift */
> @@ -1185,7 +1174,7 @@ static int xc2028_set_params(struct dvb_frontend *fe,
> */
> }
>
> - return generic_set_freq(fe, p->frequency,
> + return generic_set_freq(fe, c->frequency,
> V4L2_TUNER_DIGITAL_TV, type, 0, demod);
> }
>
Hi Mauro,
I've tested the new media_build tree with the DVBv5 modifications on my
Terratec Cinergy Hybrid T USB XS (0ccd:0042).
The card works fine, but there is small issue: with the old code the
BASE firmware was loaded only 1 time, now it seems to be loaded each
time a new frequency is tuned (forcing reload of the other firmwares too).
This is a log of the firmware loads after some channel surfing:
OLD CODE:
[ 8701.753768] xc2028 0-0061: Loading firmware for type=BASE F8MHZ MTS
(7), id 0000000000000000.
[ 8702.804153] xc2028 0-0061: Loading firmware for type=D2633 DTV7 (90),
id 0000000000000000.
[ 8702.819274] xc2028 0-0061: Loading SCODE for type=DTV6 QAM DTV7 DTV78
DTV8 ZARLINK456 SCODE HAS_IF_4760 (620003e0), id 0000000000000000.
[ 8758.361730] xc2028 0-0061: Loading firmware for type=D2633 DTV78
(110), id 0000000000000000.
[ 8758.376951] xc2028 0-0061: Loading SCODE for type=DTV6 QAM DTV7 DTV78
DTV8 ZARLINK456 SCODE HAS_IF_4760 (620003e0), id 0000000000000000.
(note that the first frequency was in VHF band, then I switched to a new
frequency in UHF band, so the DTV78 firmware was loaded)
NEW CODE:
[19398.450453] xc2028 0-0061: Loading firmware for type=BASE F8MHZ MTS
(7), id 0000000000000000.
[19399.563210] xc2028 0-0061: Loading firmware for type=D2633 DTV8
(210), id 0000000000000000.
[19399.579467] xc2028 0-0061: Loading SCODE for type=DTV6 QAM DTV7 DTV78
DTV8 ZARLINK456 SCODE HAS_IF_4760 (620003e0), id 0000000000000000.
[19458.001144] xc2028 0-0061: Loading firmware for type=BASE F8MHZ MTS
(7), id 0000000000000000.
[19459.084473] xc2028 0-0061: Loading firmware for type=D2633 DTV8
(210), id 0000000000000000.
[19459.100183] xc2028 0-0061: Loading SCODE for type=DTV6 QAM DTV7 DTV78
DTV8 ZARLINK456 SCODE HAS_IF_4760 (620003e0), id 0000000000000000.
[19471.695347] xc2028 0-0061: Loading firmware for type=BASE F8MHZ MTS
(7), id 0000000000000000.
[19472.763449] xc2028 0-0061: Loading firmware for type=D2633 DTV8
(210), id 0000000000000000.
[19472.780660] xc2028 0-0061: Loading SCODE for type=DTV6 QAM DTV7 DTV78
DTV8 ZARLINK456 SCODE HAS_IF_4760 (620003e0), id 0000000000000000.
[19497.928003] xc2028 0-0061: Loading firmware for type=BASE F8MHZ MTS
(7), id 0000000000000000.
[19498.999729] xc2028 0-0061: Loading firmware for type=D2633 DTV8
(210), id 0000000000000000.
[19499.015212] xc2028 0-0061: Loading SCODE for type=DTV6 QAM DTV7 DTV78
DTV8 ZARLINK456 SCODE HAS_IF_4760 (620003e0), id 0000000000000000.
[19510.258833] xc2028 0-0061: Loading firmware for type=BASE F8MHZ MTS
(7), id 0000000000000000.
[19511.346135] xc2028 0-0061: Loading firmware for type=D2633 DTV78
(110), id 0000000000000000.
[19511.361506] xc2028 0-0061: Loading SCODE for type=DTV6 QAM DTV7 DTV78
DTV8 ZARLINK456 SCODE HAS_IF_4760 (620003e0), id 0000000000000000.
[19523.956877] xc2028 0-0061: Loading firmware for type=BASE F8MHZ MTS
(7), id 0000000000000000.
[19525.028394] xc2028 0-0061: Loading firmware for type=D2633 DTV78
(110), id 0000000000000000.
[19525.044622] xc2028 0-0061: Loading SCODE for type=DTV6 QAM DTV7 DTV78
DTV8 ZARLINK456 SCODE HAS_IF_4760 (620003e0), id 0000000000000000.
[19538.526806] xc2028 0-0061: Loading firmware for type=BASE F8MHZ MTS
(7), id 0000000000000000.
[19539.602083] xc2028 0-0061: Loading firmware for type=D2633 DTV78
(110), id 0000000000000000.
[19539.617613] xc2028 0-0061: Loading SCODE for type=DTV6 QAM DTV7 DTV78
DTV8 ZARLINK456 SCODE HAS_IF_4760 (620003e0), id 0000000000000000.
(here I started with a UHF frequency, but each time a new frequency is
requested all firmwares are loaded anyway, starting from the BASE one).
Best regards,
Gianluca Gennari
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: [PATCH v4 16/47] [media] tuner-xc2028: use DVBv5 parameters on set_params()
2012-01-02 19:32 ` [PATCH v4 16/47] [media] tuner-xc2028: use DVBv5 parameters on set_params() Gianluca Gennari
@ 2012-01-04 18:50 ` Mauro Carvalho Chehab
2012-01-04 19:10 ` Gianluca Gennari
0 siblings, 1 reply; 51+ messages in thread
From: Mauro Carvalho Chehab @ 2012-01-04 18:50 UTC (permalink / raw)
To: gennarone; +Cc: linux-media
On 02-01-2012 17:32, Gianluca Gennari wrote:
> Il 24/12/2011 16:50, Mauro Carvalho Chehab ha scritto:
>> Instead of using DVBv3 parameters, rely on DVBv5 parameters to
>> set the tuner.
>>
>> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
>> ---
>> drivers/media/common/tuners/tuner-xc2028.c | 83 ++++++++++++----------------
>> 1 files changed, 36 insertions(+), 47 deletions(-)
>>
>> diff --git a/drivers/media/common/tuners/tuner-xc2028.c b/drivers/media/common/tuners/tuner-xc2028.c
>> index e531267..8c0dc6a1 100644
>> --- a/drivers/media/common/tuners/tuner-xc2028.c
>> +++ b/drivers/media/common/tuners/tuner-xc2028.c
>> @@ -1087,65 +1087,26 @@ static int xc2028_set_analog_freq(struct dvb_frontend *fe,
>> static int xc2028_set_params(struct dvb_frontend *fe,
>> struct dvb_frontend_parameters *p)
>> {
>> + struct dtv_frontend_properties *c = &fe->dtv_property_cache;
>> + u32 delsys = c->delivery_system;
>> + u32 bw = c->bandwidth_hz;
>> struct xc2028_data *priv = fe->tuner_priv;
>> unsigned int type=0;
>> - fe_bandwidth_t bw = BANDWIDTH_8_MHZ;
>> u16 demod = 0;
>>
>> tuner_dbg("%s called\n", __func__);
>>
>> - switch(fe->ops.info.type) {
>> - case FE_OFDM:
>> - bw = p->u.ofdm.bandwidth;
>> + switch (delsys) {
>> + case SYS_DVBT:
>> + case SYS_DVBT2:
>> /*
>> * The only countries with 6MHz seem to be Taiwan/Uruguay.
>> * Both seem to require QAM firmware for OFDM decoding
>> * Tested in Taiwan by Terry Wu <terrywu2009@gmail.com>
>> */
>> - if (bw == BANDWIDTH_6_MHZ)
>> + if (bw <= 6000000)
>> type |= QAM;
>> - break;
>> - case FE_ATSC:
>> - bw = BANDWIDTH_6_MHZ;
>> - /* The only ATSC firmware (at least on v2.7) is D2633 */
>> - type |= ATSC | D2633;
>> - break;
>> - /* DVB-S and pure QAM (FE_QAM) are not supported */
>> - default:
>> - return -EINVAL;
>> - }
>> -
>> - switch (bw) {
>> - case BANDWIDTH_8_MHZ:
>> - if (p->frequency < 470000000)
>> - priv->ctrl.vhfbw7 = 0;
>> - else
>> - priv->ctrl.uhfbw8 = 1;
>> - type |= (priv->ctrl.vhfbw7 && priv->ctrl.uhfbw8) ? DTV78 : DTV8;
>> - type |= F8MHZ;
>> - break;
>> - case BANDWIDTH_7_MHZ:
>> - if (p->frequency < 470000000)
>> - priv->ctrl.vhfbw7 = 1;
>> - else
>> - priv->ctrl.uhfbw8 = 0;
>> - type |= (priv->ctrl.vhfbw7 && priv->ctrl.uhfbw8) ? DTV78 : DTV7;
>> - type |= F8MHZ;
>> - break;
>> - case BANDWIDTH_6_MHZ:
>> - type |= DTV6;
>> - priv->ctrl.vhfbw7 = 0;
>> - priv->ctrl.uhfbw8 = 0;
>> - break;
>> - default:
>> - tuner_err("error: bandwidth not supported.\n");
>> - };
>>
>> - /*
>> - Selects between D2633 or D2620 firmware.
>> - It doesn't make sense for ATSC, since it should be D2633 on all cases
>> - */
>> - if (fe->ops.info.type != FE_ATSC) {
>> switch (priv->ctrl.type) {
>> case XC2028_D2633:
>> type |= D2633;
>> @@ -1161,6 +1122,34 @@ static int xc2028_set_params(struct dvb_frontend *fe,
>> else
>> type |= D2620;
>> }
>> + break;
>> + case SYS_ATSC:
>> + /* The only ATSC firmware (at least on v2.7) is D2633 */
>> + type |= ATSC | D2633;
>> + break;
>> + /* DVB-S and pure QAM (FE_QAM) are not supported */
>> + default:
>> + return -EINVAL;
>> + }
>> +
>> + if (bw <= 6000000) {
>> + type |= DTV6;
>> + priv->ctrl.vhfbw7 = 0;
>> + priv->ctrl.uhfbw8 = 0;
>> + } else if (bw <= 7000000) {
>> + if (c->frequency < 470000000)
>> + priv->ctrl.vhfbw7 = 1;
>> + else
>> + priv->ctrl.uhfbw8 = 0;
>> + type |= (priv->ctrl.vhfbw7 && priv->ctrl.uhfbw8) ? DTV78 : DTV7;
>> + type |= F8MHZ;
>> + } else {
>> + if (c->frequency < 470000000)
>> + priv->ctrl.vhfbw7 = 0;
>> + else
>> + priv->ctrl.uhfbw8 = 1;
>> + type |= (priv->ctrl.vhfbw7 && priv->ctrl.uhfbw8) ? DTV78 : DTV8;
>> + type |= F8MHZ;
>> }
>>
>> /* All S-code tables need a 200kHz shift */
>> @@ -1185,7 +1174,7 @@ static int xc2028_set_params(struct dvb_frontend *fe,
>> */
>> }
>>
>> - return generic_set_freq(fe, p->frequency,
>> + return generic_set_freq(fe, c->frequency,
>> V4L2_TUNER_DIGITAL_TV, type, 0, demod);
>> }
>>
>
> Hi Mauro,
> I've tested the new media_build tree with the DVBv5 modifications on my
> Terratec Cinergy Hybrid T USB XS (0ccd:0042).
>
> The card works fine, but there is small issue: with the old code the
> BASE firmware was loaded only 1 time, now it seems to be loaded each
> time a new frequency is tuned (forcing reload of the other firmwares too).
>
> This is a log of the firmware loads after some channel surfing:
>
> OLD CODE:
>
> [ 8701.753768] xc2028 0-0061: Loading firmware for type=BASE F8MHZ MTS
> (7), id 0000000000000000.
> [ 8702.804153] xc2028 0-0061: Loading firmware for type=D2633 DTV7 (90),
> id 0000000000000000.
> [ 8702.819274] xc2028 0-0061: Loading SCODE for type=DTV6 QAM DTV7 DTV78
> DTV8 ZARLINK456 SCODE HAS_IF_4760 (620003e0), id 0000000000000000.
> [ 8758.361730] xc2028 0-0061: Loading firmware for type=D2633 DTV78
> (110), id 0000000000000000.
> [ 8758.376951] xc2028 0-0061: Loading SCODE for type=DTV6 QAM DTV7 DTV78
> DTV8 ZARLINK456 SCODE HAS_IF_4760 (620003e0), id 0000000000000000.
>
> (note that the first frequency was in VHF band, then I switched to a new
> frequency in UHF band, so the DTV78 firmware was loaded)
>
> NEW CODE:
>
> [19398.450453] xc2028 0-0061: Loading firmware for type=BASE F8MHZ MTS
> (7), id 0000000000000000.
> [19399.563210] xc2028 0-0061: Loading firmware for type=D2633 DTV8
> (210), id 0000000000000000.
> [19399.579467] xc2028 0-0061: Loading SCODE for type=DTV6 QAM DTV7 DTV78
> DTV8 ZARLINK456 SCODE HAS_IF_4760 (620003e0), id 0000000000000000.
> [19458.001144] xc2028 0-0061: Loading firmware for type=BASE F8MHZ MTS
> (7), id 0000000000000000.
> [19459.084473] xc2028 0-0061: Loading firmware for type=D2633 DTV8
> (210), id 0000000000000000.
> [19459.100183] xc2028 0-0061: Loading SCODE for type=DTV6 QAM DTV7 DTV78
> DTV8 ZARLINK456 SCODE HAS_IF_4760 (620003e0), id 0000000000000000.
> [19471.695347] xc2028 0-0061: Loading firmware for type=BASE F8MHZ MTS
> (7), id 0000000000000000.
> [19472.763449] xc2028 0-0061: Loading firmware for type=D2633 DTV8
> (210), id 0000000000000000.
> [19472.780660] xc2028 0-0061: Loading SCODE for type=DTV6 QAM DTV7 DTV78
> DTV8 ZARLINK456 SCODE HAS_IF_4760 (620003e0), id 0000000000000000.
> [19497.928003] xc2028 0-0061: Loading firmware for type=BASE F8MHZ MTS
> (7), id 0000000000000000.
> [19498.999729] xc2028 0-0061: Loading firmware for type=D2633 DTV8
> (210), id 0000000000000000.
> [19499.015212] xc2028 0-0061: Loading SCODE for type=DTV6 QAM DTV7 DTV78
> DTV8 ZARLINK456 SCODE HAS_IF_4760 (620003e0), id 0000000000000000.
> [19510.258833] xc2028 0-0061: Loading firmware for type=BASE F8MHZ MTS
> (7), id 0000000000000000.
> [19511.346135] xc2028 0-0061: Loading firmware for type=D2633 DTV78
> (110), id 0000000000000000.
> [19511.361506] xc2028 0-0061: Loading SCODE for type=DTV6 QAM DTV7 DTV78
> DTV8 ZARLINK456 SCODE HAS_IF_4760 (620003e0), id 0000000000000000.
> [19523.956877] xc2028 0-0061: Loading firmware for type=BASE F8MHZ MTS
> (7), id 0000000000000000.
> [19525.028394] xc2028 0-0061: Loading firmware for type=D2633 DTV78
> (110), id 0000000000000000.
> [19525.044622] xc2028 0-0061: Loading SCODE for type=DTV6 QAM DTV7 DTV78
> DTV8 ZARLINK456 SCODE HAS_IF_4760 (620003e0), id 0000000000000000.
> [19538.526806] xc2028 0-0061: Loading firmware for type=BASE F8MHZ MTS
> (7), id 0000000000000000.
> [19539.602083] xc2028 0-0061: Loading firmware for type=D2633 DTV78
> (110), id 0000000000000000.
> [19539.617613] xc2028 0-0061: Loading SCODE for type=DTV6 QAM DTV7 DTV78
> DTV8 ZARLINK456 SCODE HAS_IF_4760 (620003e0), id 0000000000000000.
>
> (here I started with a UHF frequency, but each time a new frequency is
> requested all firmwares are loaded anyway, starting from the BASE one).
Weird. This patch preserves the logic that decides what firmware should be
used.
That's said, maybe the driver should just use DTV78 firmwwares on all cases.
On what Country do you live?
>
> Best regards,
> Gianluca Gennari
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: [PATCH v4 16/47] [media] tuner-xc2028: use DVBv5 parameters on set_params()
2012-01-04 18:50 ` Mauro Carvalho Chehab
@ 2012-01-04 19:10 ` Gianluca Gennari
0 siblings, 0 replies; 51+ messages in thread
From: Gianluca Gennari @ 2012-01-04 19:10 UTC (permalink / raw)
To: Mauro Carvalho Chehab, linux-media
Il 04/01/2012 19:50, Mauro Carvalho Chehab ha scritto:
> On 02-01-2012 17:32, Gianluca Gennari wrote:
>> Il 24/12/2011 16:50, Mauro Carvalho Chehab ha scritto:
>>> Instead of using DVBv3 parameters, rely on DVBv5 parameters to
>>> set the tuner.
>>>
>>> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
>>> ---
>>> drivers/media/common/tuners/tuner-xc2028.c | 83 ++++++++++++----------------
>>> 1 files changed, 36 insertions(+), 47 deletions(-)
>>>
>>> diff --git a/drivers/media/common/tuners/tuner-xc2028.c b/drivers/media/common/tuners/tuner-xc2028.c
>>> index e531267..8c0dc6a1 100644
>>> --- a/drivers/media/common/tuners/tuner-xc2028.c
>>> +++ b/drivers/media/common/tuners/tuner-xc2028.c
>>> @@ -1087,65 +1087,26 @@ static int xc2028_set_analog_freq(struct dvb_frontend *fe,
>>> static int xc2028_set_params(struct dvb_frontend *fe,
>>> struct dvb_frontend_parameters *p)
>>> {
>>> + struct dtv_frontend_properties *c = &fe->dtv_property_cache;
>>> + u32 delsys = c->delivery_system;
>>> + u32 bw = c->bandwidth_hz;
>>> struct xc2028_data *priv = fe->tuner_priv;
>>> unsigned int type=0;
>>> - fe_bandwidth_t bw = BANDWIDTH_8_MHZ;
>>> u16 demod = 0;
>>>
>>> tuner_dbg("%s called\n", __func__);
>>>
>>> - switch(fe->ops.info.type) {
>>> - case FE_OFDM:
>>> - bw = p->u.ofdm.bandwidth;
>>> + switch (delsys) {
>>> + case SYS_DVBT:
>>> + case SYS_DVBT2:
>>> /*
>>> * The only countries with 6MHz seem to be Taiwan/Uruguay.
>>> * Both seem to require QAM firmware for OFDM decoding
>>> * Tested in Taiwan by Terry Wu <terrywu2009@gmail.com>
>>> */
>>> - if (bw == BANDWIDTH_6_MHZ)
>>> + if (bw <= 6000000)
>>> type |= QAM;
>>> - break;
>>> - case FE_ATSC:
>>> - bw = BANDWIDTH_6_MHZ;
>>> - /* The only ATSC firmware (at least on v2.7) is D2633 */
>>> - type |= ATSC | D2633;
>>> - break;
>>> - /* DVB-S and pure QAM (FE_QAM) are not supported */
>>> - default:
>>> - return -EINVAL;
>>> - }
>>> -
>>> - switch (bw) {
>>> - case BANDWIDTH_8_MHZ:
>>> - if (p->frequency < 470000000)
>>> - priv->ctrl.vhfbw7 = 0;
>>> - else
>>> - priv->ctrl.uhfbw8 = 1;
>>> - type |= (priv->ctrl.vhfbw7 && priv->ctrl.uhfbw8) ? DTV78 : DTV8;
>>> - type |= F8MHZ;
>>> - break;
>>> - case BANDWIDTH_7_MHZ:
>>> - if (p->frequency < 470000000)
>>> - priv->ctrl.vhfbw7 = 1;
>>> - else
>>> - priv->ctrl.uhfbw8 = 0;
>>> - type |= (priv->ctrl.vhfbw7 && priv->ctrl.uhfbw8) ? DTV78 : DTV7;
>>> - type |= F8MHZ;
>>> - break;
>>> - case BANDWIDTH_6_MHZ:
>>> - type |= DTV6;
>>> - priv->ctrl.vhfbw7 = 0;
>>> - priv->ctrl.uhfbw8 = 0;
>>> - break;
>>> - default:
>>> - tuner_err("error: bandwidth not supported.\n");
>>> - };
>>>
>>> - /*
>>> - Selects between D2633 or D2620 firmware.
>>> - It doesn't make sense for ATSC, since it should be D2633 on all cases
>>> - */
>>> - if (fe->ops.info.type != FE_ATSC) {
>>> switch (priv->ctrl.type) {
>>> case XC2028_D2633:
>>> type |= D2633;
>>> @@ -1161,6 +1122,34 @@ static int xc2028_set_params(struct dvb_frontend *fe,
>>> else
>>> type |= D2620;
>>> }
>>> + break;
>>> + case SYS_ATSC:
>>> + /* The only ATSC firmware (at least on v2.7) is D2633 */
>>> + type |= ATSC | D2633;
>>> + break;
>>> + /* DVB-S and pure QAM (FE_QAM) are not supported */
>>> + default:
>>> + return -EINVAL;
>>> + }
>>> +
>>> + if (bw <= 6000000) {
>>> + type |= DTV6;
>>> + priv->ctrl.vhfbw7 = 0;
>>> + priv->ctrl.uhfbw8 = 0;
>>> + } else if (bw <= 7000000) {
>>> + if (c->frequency < 470000000)
>>> + priv->ctrl.vhfbw7 = 1;
>>> + else
>>> + priv->ctrl.uhfbw8 = 0;
>>> + type |= (priv->ctrl.vhfbw7 && priv->ctrl.uhfbw8) ? DTV78 : DTV7;
>>> + type |= F8MHZ;
>>> + } else {
>>> + if (c->frequency < 470000000)
>>> + priv->ctrl.vhfbw7 = 0;
>>> + else
>>> + priv->ctrl.uhfbw8 = 1;
>>> + type |= (priv->ctrl.vhfbw7 && priv->ctrl.uhfbw8) ? DTV78 : DTV8;
>>> + type |= F8MHZ;
>>> }
>>>
>>> /* All S-code tables need a 200kHz shift */
>>> @@ -1185,7 +1174,7 @@ static int xc2028_set_params(struct dvb_frontend *fe,
>>> */
>>> }
>>>
>>> - return generic_set_freq(fe, p->frequency,
>>> + return generic_set_freq(fe, c->frequency,
>>> V4L2_TUNER_DIGITAL_TV, type, 0, demod);
>>> }
>>>
>>
>> Hi Mauro,
>> I've tested the new media_build tree with the DVBv5 modifications on my
>> Terratec Cinergy Hybrid T USB XS (0ccd:0042).
>>
>> The card works fine, but there is small issue: with the old code the
>> BASE firmware was loaded only 1 time, now it seems to be loaded each
>> time a new frequency is tuned (forcing reload of the other firmwares too).
>>
>> This is a log of the firmware loads after some channel surfing:
>>
>> OLD CODE:
>>
>> [ 8701.753768] xc2028 0-0061: Loading firmware for type=BASE F8MHZ MTS
>> (7), id 0000000000000000.
>> [ 8702.804153] xc2028 0-0061: Loading firmware for type=D2633 DTV7 (90),
>> id 0000000000000000.
>> [ 8702.819274] xc2028 0-0061: Loading SCODE for type=DTV6 QAM DTV7 DTV78
>> DTV8 ZARLINK456 SCODE HAS_IF_4760 (620003e0), id 0000000000000000.
>> [ 8758.361730] xc2028 0-0061: Loading firmware for type=D2633 DTV78
>> (110), id 0000000000000000.
>> [ 8758.376951] xc2028 0-0061: Loading SCODE for type=DTV6 QAM DTV7 DTV78
>> DTV8 ZARLINK456 SCODE HAS_IF_4760 (620003e0), id 0000000000000000.
>>
>> (note that the first frequency was in VHF band, then I switched to a new
>> frequency in UHF band, so the DTV78 firmware was loaded)
>>
>> NEW CODE:
>>
>> [19398.450453] xc2028 0-0061: Loading firmware for type=BASE F8MHZ MTS
>> (7), id 0000000000000000.
>> [19399.563210] xc2028 0-0061: Loading firmware for type=D2633 DTV8
>> (210), id 0000000000000000.
>> [19399.579467] xc2028 0-0061: Loading SCODE for type=DTV6 QAM DTV7 DTV78
>> DTV8 ZARLINK456 SCODE HAS_IF_4760 (620003e0), id 0000000000000000.
>> [19458.001144] xc2028 0-0061: Loading firmware for type=BASE F8MHZ MTS
>> (7), id 0000000000000000.
>> [19459.084473] xc2028 0-0061: Loading firmware for type=D2633 DTV8
>> (210), id 0000000000000000.
>> [19459.100183] xc2028 0-0061: Loading SCODE for type=DTV6 QAM DTV7 DTV78
>> DTV8 ZARLINK456 SCODE HAS_IF_4760 (620003e0), id 0000000000000000.
>> [19471.695347] xc2028 0-0061: Loading firmware for type=BASE F8MHZ MTS
>> (7), id 0000000000000000.
>> [19472.763449] xc2028 0-0061: Loading firmware for type=D2633 DTV8
>> (210), id 0000000000000000.
>> [19472.780660] xc2028 0-0061: Loading SCODE for type=DTV6 QAM DTV7 DTV78
>> DTV8 ZARLINK456 SCODE HAS_IF_4760 (620003e0), id 0000000000000000.
>> [19497.928003] xc2028 0-0061: Loading firmware for type=BASE F8MHZ MTS
>> (7), id 0000000000000000.
>> [19498.999729] xc2028 0-0061: Loading firmware for type=D2633 DTV8
>> (210), id 0000000000000000.
>> [19499.015212] xc2028 0-0061: Loading SCODE for type=DTV6 QAM DTV7 DTV78
>> DTV8 ZARLINK456 SCODE HAS_IF_4760 (620003e0), id 0000000000000000.
>> [19510.258833] xc2028 0-0061: Loading firmware for type=BASE F8MHZ MTS
>> (7), id 0000000000000000.
>> [19511.346135] xc2028 0-0061: Loading firmware for type=D2633 DTV78
>> (110), id 0000000000000000.
>> [19511.361506] xc2028 0-0061: Loading SCODE for type=DTV6 QAM DTV7 DTV78
>> DTV8 ZARLINK456 SCODE HAS_IF_4760 (620003e0), id 0000000000000000.
>> [19523.956877] xc2028 0-0061: Loading firmware for type=BASE F8MHZ MTS
>> (7), id 0000000000000000.
>> [19525.028394] xc2028 0-0061: Loading firmware for type=D2633 DTV78
>> (110), id 0000000000000000.
>> [19525.044622] xc2028 0-0061: Loading SCODE for type=DTV6 QAM DTV7 DTV78
>> DTV8 ZARLINK456 SCODE HAS_IF_4760 (620003e0), id 0000000000000000.
>> [19538.526806] xc2028 0-0061: Loading firmware for type=BASE F8MHZ MTS
>> (7), id 0000000000000000.
>> [19539.602083] xc2028 0-0061: Loading firmware for type=D2633 DTV78
>> (110), id 0000000000000000.
>> [19539.617613] xc2028 0-0061: Loading SCODE for type=DTV6 QAM DTV7 DTV78
>> DTV8 ZARLINK456 SCODE HAS_IF_4760 (620003e0), id 0000000000000000.
>>
>> (here I started with a UHF frequency, but each time a new frequency is
>> requested all firmwares are loaded anyway, starting from the BASE one).
>
> Weird. This patch preserves the logic that decides what firmware should be
> used.
>
> That's said, maybe the driver should just use DTV78 firmwwares on all cases.
>
> On what Country do you live?
>
>
>>
>> Best regards,
>> Gianluca Gennari
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-media" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
Hi Mauro,
I live in Italy, but this is not the cause of the problem.
In fact I've run further tests with debugging enabled and I found out
that the cause of the problem is the call of xc2028_sleep() when
xc2028_set_params() is called to tune a new channel:
[27103.741563] xc2028 0-0061: Putting xc2028/3028 into poweroff mode.
[27147.169281] xc2028 0-0061: xc2028_set_params called
this resets the firmware and forces a reload:
priv->cur_fw.type = 0; /* need firmware reload */
A workaround is to use the no_poweroff option:
modprobe tuner-xc2028 no_poweroff=1
this disables sleep mode for the xc2028 tuner and then the firmware is
loaded only when the first channel is tuned, just like the old code.
I have no idea where this call to xc2028_sleep() comes from.
I reproduced this bug with the latest media_build drivers on both Ubuntu
10.04 (kernel 2.6.32 - old Kaffeine) and Ubuntu 11.10 (kernel 3.0.0 -
new Kaffeine).
This is a log with debugging enabled:
[27103.741147] xc2028: Xcv2028/3028 init called!
[27103.741154] xc2028 0-0061: attaching existing instance
[27103.741158] xc2028 0-0061: type set to XCeive xc2028/xc3028 tuner
[27103.741161] em28xx #0: em28xx #0/2: xc3028 attached
[27103.741165] DVB: registering new adapter (em28xx #0)
[27103.741169] DVB: registering adapter 0 frontend 0 (Zarlink ZL10353
DVB-T)...
[27103.741446] em28xx #0: Successfully loaded em28xx-dvb
[27103.741450] Em28xx: Initialized (Em28xx dvb Extension) extension
[27103.741563] xc2028 0-0061: Putting xc2028/3028 into poweroff mode.
[27147.169281] xc2028 0-0061: xc2028_set_params called
[27147.169287] xc2028 0-0061: generic_set_freq called
[27147.169290] xc2028 0-0061: should set frequency 198500 kHz
[27147.169293] xc2028 0-0061: check_firmware called
[27147.169297] xc2028 0-0061: checking firmware, user requested
type=F8MHZ MTS D2633 DTV7 (96), id 0000000000000000, int_freq 4760,
scode_nr 0
[27147.227134] xc2028 0-0061: load_firmware called
[27147.227139] xc2028 0-0061: seek_firmware called, want type=BASE F8MHZ
MTS D2633 DTV7 (97), id 0000000000000000.
[27147.227148] xc2028 0-0061: Found firmware for type=BASE F8MHZ MTS
(7), id 0000000000000000.
[27147.227154] xc2028 0-0061: Loading firmware for type=BASE F8MHZ MTS
(7), id 0000000000000000.
[27148.326674] xc2028 0-0061: Load init1 firmware, if exists
[27148.326679] xc2028 0-0061: load_firmware called
[27148.326683] xc2028 0-0061: seek_firmware called, want type=BASE INIT1
F8MHZ MTS D2633 DTV7 (4097), id 0000000000000000.
[27148.326694] xc2028 0-0061: Can't find firmware for type=BASE INIT1
F8MHZ MTS (4007), id 0000000000000000.
[27148.326702] xc2028 0-0061: load_firmware called
[27148.326706] xc2028 0-0061: seek_firmware called, want type=BASE INIT1
MTS D2633 DTV7 (4095), id 0000000000000000.
[27148.326714] xc2028 0-0061: Can't find firmware for type=BASE INIT1
MTS (4005), id 0000000000000000.
[27148.326721] xc2028 0-0061: load_firmware called
[27148.326724] xc2028 0-0061: seek_firmware called, want type=F8MHZ MTS
D2633 DTV7 (96), id 0000000000000000.
[27148.326732] xc2028 0-0061: Found firmware for type=D2633 DTV7 (90),
id 0000000000000000.
[27148.326738] xc2028 0-0061: Loading firmware for type=D2633 DTV7 (90),
id 0000000000000000.
[27148.342787] xc2028 0-0061: Trying to load scode 0
[27148.342791] xc2028 0-0061: load_scode called
[27148.342795] xc2028 0-0061: Loading SCODE for type=DTV6 QAM DTV7 DTV78
DTV8 ZARLINK456 SCODE HAS_IF_4760 (620003e0), id 0000000000000000.
[27148.345282] xc2028 0-0061: xc2028_get_reg 0004 called
[27148.346404] xc2028 0-0061: xc2028_get_reg 0008 called
[27148.347433] xc2028 0-0061: Device is Xceive 3028 version 1.0,
firmware version 2.7
[27148.466633] xc2028 0-0061: divisor= 00 00 30 f0 (freq=198.500)
[27149.475929] xc2028 0-0061: xc2028_set_params called
[27149.475935] xc2028 0-0061: generic_set_freq called
[27149.475940] xc2028 0-0061: should set frequency 198500 kHz
[27149.475943] xc2028 0-0061: check_firmware called
[27149.475946] xc2028 0-0061: checking firmware, user requested
type=F8MHZ MTS D2633 DTV7 (96), id 0000000000000000, int_freq 4760,
scode_nr 0
[27149.475957] xc2028 0-0061: BASE firmware not changed.
[27149.475961] xc2028 0-0061: Std-specific firmware already loaded.
[27149.475964] xc2028 0-0061: SCODE firmware already loaded.
[27149.475968] xc2028 0-0061: xc2028_get_reg 0004 called
[27149.476932] xc2028 0-0061: xc2028_get_reg 0008 called
[27149.477929] xc2028 0-0061: Device is Xceive 3028 version 1.0,
firmware version 2.7
[27149.598130] xc2028 0-0061: divisor= 00 00 30 f0 (freq=198.500)
[27150.607986] xc2028 0-0061: xc2028_set_params called
[27150.607993] xc2028 0-0061: generic_set_freq called
[27150.607997] xc2028 0-0061: should set frequency 198500 kHz
[27150.608000] xc2028 0-0061: check_firmware called
[27150.608004] xc2028 0-0061: checking firmware, user requested
type=F8MHZ MTS D2633 DTV7 (96), id 0000000000000000, int_freq 4760,
scode_nr 0
[27150.608015] xc2028 0-0061: BASE firmware not changed.
[27150.608018] xc2028 0-0061: Std-specific firmware already loaded.
[27150.608022] xc2028 0-0061: SCODE firmware already loaded.
[27150.608025] xc2028 0-0061: xc2028_get_reg 0004 called
[27150.609082] xc2028 0-0061: xc2028_get_reg 0008 called
[27150.610100] xc2028 0-0061: Device is Xceive 3028 version 1.0,
firmware version 2.7
[27150.729780] xc2028 0-0061: divisor= 00 00 30 f0 (freq=198.500)
[27151.739507] xc2028 0-0061: xc2028_set_params called
[27151.739513] xc2028 0-0061: generic_set_freq called
[27151.739517] xc2028 0-0061: should set frequency 198500 kHz
[27151.739521] xc2028 0-0061: check_firmware called
[27151.739524] xc2028 0-0061: checking firmware, user requested
type=F8MHZ MTS D2633 DTV7 (96), id 0000000000000000, int_freq 4760,
scode_nr 0
[27151.739535] xc2028 0-0061: BASE firmware not changed.
[27151.739538] xc2028 0-0061: Std-specific firmware already loaded.
[27151.739542] xc2028 0-0061: SCODE firmware already loaded.
[27151.739546] xc2028 0-0061: xc2028_get_reg 0004 called
[27151.740601] xc2028 0-0061: xc2028_get_reg 0008 called
[27151.741758] xc2028 0-0061: Device is Xceive 3028 version 1.0,
firmware version 2.7
[27151.861124] xc2028 0-0061: divisor= 00 00 30 f0 (freq=198.500)
[27152.107733] xc2028 0-0061: Putting xc2028/3028 into poweroff mode.
[27152.181882] xc2028 0-0061: xc2028_set_params called
[27152.181890] xc2028 0-0061: generic_set_freq called
[27152.181896] xc2028 0-0061: should set frequency 658000 kHz
[27152.181901] xc2028 0-0061: check_firmware called
[27152.181905] xc2028 0-0061: checking firmware, user requested
type=F8MHZ MTS D2633 DTV78 (116), id 0000000000000000, int_freq 4760,
scode_nr 0
[27152.240972] xc2028 0-0061: load_firmware called
[27152.240977] xc2028 0-0061: seek_firmware called, want type=BASE F8MHZ
MTS D2633 DTV78 (117), id 0000000000000000.
[27152.240988] xc2028 0-0061: Found firmware for type=BASE F8MHZ MTS
(7), id 0000000000000000.
[27152.240994] xc2028 0-0061: Loading firmware for type=BASE F8MHZ MTS
(7), id 0000000000000000.
[27153.317092] xc2028 0-0061: Load init1 firmware, if exists
[27153.317098] xc2028 0-0061: load_firmware called
[27153.317102] xc2028 0-0061: seek_firmware called, want type=BASE INIT1
F8MHZ MTS D2633 DTV78 (4117), id 0000000000000000.
[27153.317113] xc2028 0-0061: Can't find firmware for type=BASE INIT1
F8MHZ MTS (4007), id 0000000000000000.
[27153.317121] xc2028 0-0061: load_firmware called
[27153.317124] xc2028 0-0061: seek_firmware called, want type=BASE INIT1
MTS D2633 DTV78 (4115), id 0000000000000000.
[27153.317133] xc2028 0-0061: Can't find firmware for type=BASE INIT1
MTS (4005), id 0000000000000000.
[27153.317140] xc2028 0-0061: load_firmware called
[27153.317143] xc2028 0-0061: seek_firmware called, want type=F8MHZ MTS
D2633 DTV78 (116), id 0000000000000000.
[27153.317151] xc2028 0-0061: Found firmware for type=D2633 DTV78 (110),
id 0000000000000000.
[27153.317157] xc2028 0-0061: Loading firmware for type=D2633 DTV78
(110), id 0000000000000000.
[27153.332685] xc2028 0-0061: Trying to load scode 0
[27153.332692] xc2028 0-0061: load_scode called
[27153.332697] xc2028 0-0061: Loading SCODE for type=DTV6 QAM DTV7 DTV78
DTV8 ZARLINK456 SCODE HAS_IF_4760 (620003e0), id 0000000000000000.
[27153.335181] xc2028 0-0061: xc2028_get_reg 0004 called
[27153.336185] xc2028 0-0061: xc2028_get_reg 0008 called
[27153.337174] xc2028 0-0061: Device is Xceive 3028 version 1.0,
firmware version 2.7
[27153.456509] xc2028 0-0061: divisor= 00 00 a3 d0 (freq=658.000)
Best regards,
Gianluca Gennari
^ permalink raw reply [flat|nested] 51+ messages in thread
end of thread, other threads:[~2012-01-04 19:10 UTC | newest]
Thread overview: 51+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-24 15:50 [PATCH v4 00/47] DVB tuners: remove dvb_frontend_parameters from set_params() Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 01/47] [media] dvb: replace SYS_DVBC_ANNEX_AC by the right delsys Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 02/47] [media] dvb_core: estimate bw for all non-terrestial systems Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 03/47] [media] qt1010: remove fake implementaion of get_bandwidth() Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 04/47] [media] mt2060: " Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 05/47] [media] mt2031: " Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 06/47] [media] mc44s803: use DVBv5 parameters on set_params() Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 07/47] [media] max2165: " Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 08/47] [media] mt2266: use DVBv5 parameters for set_params() Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 09/47] [media] mxl5005s: use DVBv5 parameters on set_params() Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 10/47] [media] mxl5005s: fix: don't discard bandwidth changes Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 11/47] [media] mxl5007t: use DVBv5 parameters on set_params() Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 12/47] [media] tda18218: " Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 13/47] [media] tda18271: add support for QAM 7 MHz map Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 14/47] [media] tda18271-fe: use DVBv5 parameters on set_params() Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 15/47] [media] tda827x: " Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 16/47] [media] tuner-xc2028: " Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 17/47] [media] xc4000: " Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 18/47] [media] cx24113: " Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 19/47] [media] zl10039: " Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 20/47] [media] av7110: " Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 21/47] [media] budget-ci: " Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 22/47] [media] budget-patch: " Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 23/47] [media] saa7134: " Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 24/47] [media] cx88: " Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 25/47] [media] tua6100: " Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 26/47] [media] itd1000: " Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 27/47] [media] bsbe1, bsru6, tdh1: " Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 28/47] [media] ix2505v: " Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 29/47] [media] stb6000: " Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 30/47] [media] tda826x: " Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 31/47] [media] mxl111sf-tuner: " Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 32/47] [media] mantis_vp1033: " Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 33/47] [media] mantis_vp2033: " Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 34/47] [media] mantis_vp2040: " Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 35/47] [media] pluto2: " Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 36/47] [media] dvb-ttusb-budget: " Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 37/47] [media] tuner-simple: " Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 38/47] [media] dvb-bt8xx: " Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 39/47] [media] dvb-pll: " Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 40/47] [media] zl10036: " Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 41/47] [media] dib0070: Remove unused dvb_frontend_parameters Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 42/47] [media] cxusb: use DVBv5 parameters on set_params() Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 43/47] [media] dib0700_devices: " Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 44/47] [media] budget-av: " Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 45/47] [media] budget: " Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 46/47] [media] dvb: remove dvb_frontend_parameters from calc_regs() Mauro Carvalho Chehab
2011-12-24 15:50 ` [PATCH v4 47/47] [media] tuners: remove dvb_frontend_parameters from set_params() Mauro Carvalho Chehab
2012-01-02 19:32 ` [PATCH v4 16/47] [media] tuner-xc2028: use DVBv5 parameters on set_params() Gianluca Gennari
2012-01-04 18:50 ` Mauro Carvalho Chehab
2012-01-04 19:10 ` Gianluca Gennari
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.