diff options
-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, | |||
113 | struct dvb_frontend_parameters *params) | 113 | struct dvb_frontend_parameters *params) |
114 | { | 114 | { |
115 | struct tda18218_priv *priv = fe->tuner_priv; | 115 | struct tda18218_priv *priv = fe->tuner_priv; |
116 | struct dtv_frontend_properties *c = &fe->dtv_property_cache; | ||
117 | u32 bw = c->bandwidth_hz; | ||
116 | int ret; | 118 | int ret; |
117 | u8 buf[3], i, BP_Filter, LP_Fc; | 119 | u8 buf[3], i, BP_Filter, LP_Fc; |
118 | u32 LO_Frac; | 120 | u32 LO_Frac; |
@@ -138,23 +140,18 @@ static int tda18218_set_params(struct dvb_frontend *fe, | |||
138 | fe->ops.i2c_gate_ctrl(fe, 1); /* open I2C-gate */ | 140 | fe->ops.i2c_gate_ctrl(fe, 1); /* open I2C-gate */ |
139 | 141 | ||
140 | /* low-pass filter cut-off frequency */ | 142 | /* low-pass filter cut-off frequency */ |
141 | switch (params->u.ofdm.bandwidth) { | 143 | if (bw <= 6000000) { |
142 | case BANDWIDTH_6_MHZ: | ||
143 | LP_Fc = 0; | 144 | LP_Fc = 0; |
144 | priv->if_frequency = 3000000; | 145 | priv->if_frequency = 3000000; |
145 | break; | 146 | } else if (bw <= 7000000) { |
146 | case BANDWIDTH_7_MHZ: | ||
147 | LP_Fc = 1; | 147 | LP_Fc = 1; |
148 | priv->if_frequency = 3500000; | 148 | priv->if_frequency = 3500000; |
149 | break; | 149 | } else { |
150 | case BANDWIDTH_8_MHZ: | ||
151 | default: | ||
152 | LP_Fc = 2; | 150 | LP_Fc = 2; |
153 | priv->if_frequency = 4000000; | 151 | priv->if_frequency = 4000000; |
154 | break; | ||
155 | } | 152 | } |
156 | 153 | ||
157 | LO_Frac = params->frequency + priv->if_frequency; | 154 | LO_Frac = c->frequency + priv->if_frequency; |
158 | 155 | ||
159 | /* band-pass filter */ | 156 | /* band-pass filter */ |
160 | if (LO_Frac < 188000000) | 157 | if (LO_Frac < 188000000) |