diff options
-rw-r--r-- | drivers/media/dvb/frontends/ves1820.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/drivers/media/dvb/frontends/ves1820.c b/drivers/media/dvb/frontends/ves1820.c index 796123124cbe..ecc685b3ab3c 100644 --- a/drivers/media/dvb/frontends/ves1820.c +++ b/drivers/media/dvb/frontends/ves1820.c | |||
@@ -205,15 +205,16 @@ static int ves1820_init(struct dvb_frontend* fe) | |||
205 | return 0; | 205 | return 0; |
206 | } | 206 | } |
207 | 207 | ||
208 | static int ves1820_set_parameters(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) | 208 | static int ves1820_set_parameters(struct dvb_frontend *fe) |
209 | { | 209 | { |
210 | struct dtv_frontend_properties *p = &fe->dtv_property_cache; | ||
210 | struct ves1820_state* state = fe->demodulator_priv; | 211 | struct ves1820_state* state = fe->demodulator_priv; |
211 | static const u8 reg0x00[] = { 0x00, 0x04, 0x08, 0x0c, 0x10 }; | 212 | static const u8 reg0x00[] = { 0x00, 0x04, 0x08, 0x0c, 0x10 }; |
212 | static const u8 reg0x01[] = { 140, 140, 106, 100, 92 }; | 213 | static const u8 reg0x01[] = { 140, 140, 106, 100, 92 }; |
213 | static const u8 reg0x05[] = { 135, 100, 70, 54, 38 }; | 214 | static const u8 reg0x05[] = { 135, 100, 70, 54, 38 }; |
214 | static const u8 reg0x08[] = { 162, 116, 67, 52, 35 }; | 215 | static const u8 reg0x08[] = { 162, 116, 67, 52, 35 }; |
215 | static const u8 reg0x09[] = { 145, 150, 106, 126, 107 }; | 216 | static const u8 reg0x09[] = { 145, 150, 106, 126, 107 }; |
216 | int real_qam = p->u.qam.modulation - QAM_16; | 217 | int real_qam = p->modulation - QAM_16; |
217 | 218 | ||
218 | if (real_qam < 0 || real_qam > 4) | 219 | if (real_qam < 0 || real_qam > 4) |
219 | return -EINVAL; | 220 | return -EINVAL; |
@@ -223,7 +224,7 @@ static int ves1820_set_parameters(struct dvb_frontend* fe, struct dvb_frontend_p | |||
223 | if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0); | 224 | if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0); |
224 | } | 225 | } |
225 | 226 | ||
226 | ves1820_set_symbolrate(state, p->u.qam.symbol_rate); | 227 | ves1820_set_symbolrate(state, p->symbol_rate); |
227 | ves1820_writereg(state, 0x34, state->pwm); | 228 | ves1820_writereg(state, 0x34, state->pwm); |
228 | 229 | ||
229 | ves1820_writereg(state, 0x01, reg0x01[real_qam]); | 230 | ves1820_writereg(state, 0x01, reg0x01[real_qam]); |
@@ -309,7 +310,7 @@ static int ves1820_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) | |||
309 | return 0; | 310 | return 0; |
310 | } | 311 | } |
311 | 312 | ||
312 | static int ves1820_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) | 313 | static int ves1820_get_frontend(struct dvb_frontend *fe, struct dtv_frontend_properties *p) |
313 | { | 314 | { |
314 | struct ves1820_state* state = fe->demodulator_priv; | 315 | struct ves1820_state* state = fe->demodulator_priv; |
315 | int sync; | 316 | int sync; |
@@ -320,7 +321,7 @@ static int ves1820_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_par | |||
320 | if (verbose) { | 321 | if (verbose) { |
321 | /* AFC only valid when carrier has been recovered */ | 322 | /* AFC only valid when carrier has been recovered */ |
322 | printk(sync & 2 ? "ves1820: AFC (%d) %dHz\n" : | 323 | printk(sync & 2 ? "ves1820: AFC (%d) %dHz\n" : |
323 | "ves1820: [AFC (%d) %dHz]\n", afc, -((s32) p->u.qam.symbol_rate * afc) >> 10); | 324 | "ves1820: [AFC (%d) %dHz]\n", afc, -((s32) p->symbol_rate * afc) >> 10); |
324 | } | 325 | } |
325 | 326 | ||
326 | if (!state->config->invert) { | 327 | if (!state->config->invert) { |
@@ -329,13 +330,13 @@ static int ves1820_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_par | |||
329 | p->inversion = (!(state->reg0 & 0x20)) ? INVERSION_ON : INVERSION_OFF; | 330 | p->inversion = (!(state->reg0 & 0x20)) ? INVERSION_ON : INVERSION_OFF; |
330 | } | 331 | } |
331 | 332 | ||
332 | p->u.qam.modulation = ((state->reg0 >> 2) & 7) + QAM_16; | 333 | p->modulation = ((state->reg0 >> 2) & 7) + QAM_16; |
333 | 334 | ||
334 | p->u.qam.fec_inner = FEC_NONE; | 335 | p->fec_inner = FEC_NONE; |
335 | 336 | ||
336 | p->frequency = ((p->frequency + 31250) / 62500) * 62500; | 337 | p->frequency = ((p->frequency + 31250) / 62500) * 62500; |
337 | if (sync & 2) | 338 | if (sync & 2) |
338 | p->frequency -= ((s32) p->u.qam.symbol_rate * afc) >> 10; | 339 | p->frequency -= ((s32) p->symbol_rate * afc) >> 10; |
339 | 340 | ||
340 | return 0; | 341 | return 0; |
341 | } | 342 | } |
@@ -405,7 +406,7 @@ error: | |||
405 | } | 406 | } |
406 | 407 | ||
407 | static struct dvb_frontend_ops ves1820_ops = { | 408 | static struct dvb_frontend_ops ves1820_ops = { |
408 | 409 | .delsys = { SYS_DVBC_ANNEX_A }, | |
409 | .info = { | 410 | .info = { |
410 | .name = "VLSI VES1820 DVB-C", | 411 | .name = "VLSI VES1820 DVB-C", |
411 | .type = FE_QAM, | 412 | .type = FE_QAM, |
@@ -425,8 +426,8 @@ static struct dvb_frontend_ops ves1820_ops = { | |||
425 | .init = ves1820_init, | 426 | .init = ves1820_init, |
426 | .sleep = ves1820_sleep, | 427 | .sleep = ves1820_sleep, |
427 | 428 | ||
428 | .set_frontend_legacy = ves1820_set_parameters, | 429 | .set_frontend = ves1820_set_parameters, |
429 | .get_frontend_legacy = ves1820_get_frontend, | 430 | .get_frontend = ves1820_get_frontend, |
430 | .get_tune_settings = ves1820_get_tune_settings, | 431 | .get_tune_settings = ves1820_get_tune_settings, |
431 | 432 | ||
432 | .read_status = ves1820_read_status, | 433 | .read_status = ves1820_read_status, |