diff options
Diffstat (limited to 'drivers/media/dvb/frontends/mt312.c')
-rw-r--r-- | drivers/media/dvb/frontends/mt312.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/drivers/media/dvb/frontends/mt312.c b/drivers/media/dvb/frontends/mt312.c index 46e12a8acf72..1ef821825641 100644 --- a/drivers/media/dvb/frontends/mt312.c +++ b/drivers/media/dvb/frontends/mt312.c | |||
@@ -39,7 +39,6 @@ | |||
39 | 39 | ||
40 | struct mt312_state { | 40 | struct mt312_state { |
41 | struct i2c_adapter* i2c; | 41 | struct i2c_adapter* i2c; |
42 | struct dvb_frontend_ops ops; | ||
43 | /* configuration settings */ | 42 | /* configuration settings */ |
44 | const struct mt312_config* config; | 43 | const struct mt312_config* config; |
45 | struct dvb_frontend frontend; | 44 | struct dvb_frontend frontend; |
@@ -471,16 +470,16 @@ static int mt312_set_frontend(struct dvb_frontend* fe, | |||
471 | 470 | ||
472 | dprintk("%s: Freq %d\n", __FUNCTION__, p->frequency); | 471 | dprintk("%s: Freq %d\n", __FUNCTION__, p->frequency); |
473 | 472 | ||
474 | if ((p->frequency < fe->ops->info.frequency_min) | 473 | if ((p->frequency < fe->ops.info.frequency_min) |
475 | || (p->frequency > fe->ops->info.frequency_max)) | 474 | || (p->frequency > fe->ops.info.frequency_max)) |
476 | return -EINVAL; | 475 | return -EINVAL; |
477 | 476 | ||
478 | if ((p->inversion < INVERSION_OFF) | 477 | if ((p->inversion < INVERSION_OFF) |
479 | || (p->inversion > INVERSION_ON)) | 478 | || (p->inversion > INVERSION_ON)) |
480 | return -EINVAL; | 479 | return -EINVAL; |
481 | 480 | ||
482 | if ((p->u.qpsk.symbol_rate < fe->ops->info.symbol_rate_min) | 481 | if ((p->u.qpsk.symbol_rate < fe->ops.info.symbol_rate_min) |
483 | || (p->u.qpsk.symbol_rate > fe->ops->info.symbol_rate_max)) | 482 | || (p->u.qpsk.symbol_rate > fe->ops.info.symbol_rate_max)) |
484 | return -EINVAL; | 483 | return -EINVAL; |
485 | 484 | ||
486 | if ((p->u.qpsk.fec_inner < FEC_NONE) | 485 | if ((p->u.qpsk.fec_inner < FEC_NONE) |
@@ -523,9 +522,9 @@ static int mt312_set_frontend(struct dvb_frontend* fe, | |||
523 | return -EINVAL; | 522 | return -EINVAL; |
524 | } | 523 | } |
525 | 524 | ||
526 | if (fe->ops->tuner_ops.set_params) { | 525 | if (fe->ops.tuner_ops.set_params) { |
527 | fe->ops->tuner_ops.set_params(fe, p); | 526 | fe->ops.tuner_ops.set_params(fe, p); |
528 | if (fe->ops->i2c_gate_ctrl) fe->ops->i2c_gate_ctrl(fe, 0); | 527 | if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0); |
529 | } | 528 | } |
530 | 529 | ||
531 | /* sr = (u16)(sr * 256.0 / 1000000.0) */ | 530 | /* sr = (u16)(sr * 256.0 / 1000000.0) */ |
@@ -670,19 +669,22 @@ struct dvb_frontend* vp310_mt312_attach(const struct mt312_config* config, | |||
670 | /* setup the state */ | 669 | /* setup the state */ |
671 | state->config = config; | 670 | state->config = config; |
672 | state->i2c = i2c; | 671 | state->i2c = i2c; |
673 | memcpy(&state->ops, &vp310_mt312_ops, sizeof(struct dvb_frontend_ops)); | ||
674 | 672 | ||
675 | /* check if the demod is there */ | 673 | /* check if the demod is there */ |
676 | if (mt312_readreg(state, ID, &state->id) < 0) | 674 | if (mt312_readreg(state, ID, &state->id) < 0) |
677 | goto error; | 675 | goto error; |
678 | 676 | ||
677 | /* create dvb_frontend */ | ||
678 | memcpy(&state->frontend.ops, &vp310_mt312_ops, sizeof(struct dvb_frontend_ops)); | ||
679 | state->frontend.demodulator_priv = state; | ||
680 | |||
679 | switch (state->id) { | 681 | switch (state->id) { |
680 | case ID_VP310: | 682 | case ID_VP310: |
681 | strcpy(state->ops.info.name, "Zarlink VP310 DVB-S"); | 683 | strcpy(state->frontend.ops.info.name, "Zarlink VP310 DVB-S"); |
682 | state->frequency = 90; | 684 | state->frequency = 90; |
683 | break; | 685 | break; |
684 | case ID_MT312: | 686 | case ID_MT312: |
685 | strcpy(state->ops.info.name, "Zarlink MT312 DVB-S"); | 687 | strcpy(state->frontend.ops.info.name, "Zarlink MT312 DVB-S"); |
686 | state->frequency = 60; | 688 | state->frequency = 60; |
687 | break; | 689 | break; |
688 | default: | 690 | default: |
@@ -690,9 +692,6 @@ struct dvb_frontend* vp310_mt312_attach(const struct mt312_config* config, | |||
690 | goto error; | 692 | goto error; |
691 | } | 693 | } |
692 | 694 | ||
693 | /* create dvb_frontend */ | ||
694 | state->frontend.ops = &state->ops; | ||
695 | state->frontend.demodulator_priv = state; | ||
696 | return &state->frontend; | 695 | return &state->frontend; |
697 | 696 | ||
698 | error: | 697 | error: |