diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-12-21 14:47:27 +0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-12-31 14:27:22 +0400 |
commit | 67ccfe3b9ed5287363d01820a06e18f9376d3802 (patch) | |
tree | 1155c405cb4437addfd11d0bd30939d1e117c8d5 /drivers/media/common | |
parent | e12617e6f0586a336c76dd7b70e5a451ba5e7786 (diff) | |
download | linux-67ccfe3b9ed5287363d01820a06e18f9376d3802.tar.xz |
[media] tda18218: use DVBv5 parameters on set_params()
Instead of using DVBv3 parameters, rely on DVBv5 parameters to
set the tuner.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/common')
-rw-r--r-- | 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 d099501566a1..bcdd826dac38 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 = 3000000; - 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) |