aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/frontends/dib3000mb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb/frontends/dib3000mb.c')
-rw-r--r--drivers/media/dvb/frontends/dib3000mb.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/media/dvb/frontends/dib3000mb.c b/drivers/media/dvb/frontends/dib3000mb.c
index a853d12a26f1..6f52d649e97e 100644
--- a/drivers/media/dvb/frontends/dib3000mb.c
+++ b/drivers/media/dvb/frontends/dib3000mb.c
@@ -56,12 +56,12 @@ static int dib3000mb_get_frontend(struct dvb_frontend* fe,
56static int dib3000mb_set_frontend(struct dvb_frontend* fe, 56static int dib3000mb_set_frontend(struct dvb_frontend* fe,
57 struct dvb_frontend_parameters *fep, int tuner) 57 struct dvb_frontend_parameters *fep, int tuner)
58{ 58{
59 struct dib3000_state* state = (struct dib3000_state*) fe->demodulator_priv; 59 struct dib3000_state* state = fe->demodulator_priv;
60 struct dvb_ofdm_parameters *ofdm = &fep->u.ofdm; 60 struct dvb_ofdm_parameters *ofdm = &fep->u.ofdm;
61 fe_code_rate_t fe_cr = FEC_NONE; 61 fe_code_rate_t fe_cr = FEC_NONE;
62 int search_state, seq; 62 int search_state, seq;
63 63
64 if (tuner) { 64 if (tuner && state->config.pll_addr && state->config.pll_set) {
65 dib3000mb_tuner_pass_ctrl(fe,1,state->config.pll_addr(fe)); 65 dib3000mb_tuner_pass_ctrl(fe,1,state->config.pll_addr(fe));
66 state->config.pll_set(fe, fep, NULL); 66 state->config.pll_set(fe, fep, NULL);
67 dib3000mb_tuner_pass_ctrl(fe,0,state->config.pll_addr(fe)); 67 dib3000mb_tuner_pass_ctrl(fe,0,state->config.pll_addr(fe));
@@ -317,7 +317,7 @@ static int dib3000mb_set_frontend(struct dvb_frontend* fe,
317 317
318static int dib3000mb_fe_init(struct dvb_frontend* fe, int mobile_mode) 318static int dib3000mb_fe_init(struct dvb_frontend* fe, int mobile_mode)
319{ 319{
320 struct dib3000_state* state = (struct dib3000_state*) fe->demodulator_priv; 320 struct dib3000_state* state = fe->demodulator_priv;
321 321
322 deb_info("dib3000mb is getting up.\n"); 322 deb_info("dib3000mb is getting up.\n");
323 wr(DIB3000MB_REG_POWER_CONTROL, DIB3000MB_POWER_UP); 323 wr(DIB3000MB_REG_POWER_CONTROL, DIB3000MB_POWER_UP);
@@ -401,7 +401,7 @@ static int dib3000mb_fe_init(struct dvb_frontend* fe, int mobile_mode)
401static int dib3000mb_get_frontend(struct dvb_frontend* fe, 401static int dib3000mb_get_frontend(struct dvb_frontend* fe,
402 struct dvb_frontend_parameters *fep) 402 struct dvb_frontend_parameters *fep)
403{ 403{
404 struct dib3000_state* state = (struct dib3000_state*) fe->demodulator_priv; 404 struct dib3000_state* state = fe->demodulator_priv;
405 struct dvb_ofdm_parameters *ofdm = &fep->u.ofdm; 405 struct dvb_ofdm_parameters *ofdm = &fep->u.ofdm;
406 fe_code_rate_t *cr; 406 fe_code_rate_t *cr;
407 u16 tps_val; 407 u16 tps_val;
@@ -562,7 +562,7 @@ static int dib3000mb_get_frontend(struct dvb_frontend* fe,
562 562
563static int dib3000mb_read_status(struct dvb_frontend* fe, fe_status_t *stat) 563static int dib3000mb_read_status(struct dvb_frontend* fe, fe_status_t *stat)
564{ 564{
565 struct dib3000_state* state = (struct dib3000_state*) fe->demodulator_priv; 565 struct dib3000_state* state = fe->demodulator_priv;
566 566
567 *stat = 0; 567 *stat = 0;
568 568
@@ -594,7 +594,7 @@ static int dib3000mb_read_status(struct dvb_frontend* fe, fe_status_t *stat)
594 594
595static int dib3000mb_read_ber(struct dvb_frontend* fe, u32 *ber) 595static int dib3000mb_read_ber(struct dvb_frontend* fe, u32 *ber)
596{ 596{
597 struct dib3000_state* state = (struct dib3000_state*) fe->demodulator_priv; 597 struct dib3000_state* state = fe->demodulator_priv;
598 598
599 *ber = ((rd(DIB3000MB_REG_BER_MSB) << 16) | rd(DIB3000MB_REG_BER_LSB)); 599 *ber = ((rd(DIB3000MB_REG_BER_MSB) << 16) | rd(DIB3000MB_REG_BER_LSB));
600 return 0; 600 return 0;
@@ -603,7 +603,7 @@ static int dib3000mb_read_ber(struct dvb_frontend* fe, u32 *ber)
603/* see dib3000-watch dvb-apps for exact calcuations of signal_strength and snr */ 603/* see dib3000-watch dvb-apps for exact calcuations of signal_strength and snr */
604static int dib3000mb_read_signal_strength(struct dvb_frontend* fe, u16 *strength) 604static int dib3000mb_read_signal_strength(struct dvb_frontend* fe, u16 *strength)
605{ 605{
606 struct dib3000_state* state = (struct dib3000_state*) fe->demodulator_priv; 606 struct dib3000_state* state = fe->demodulator_priv;
607 607
608 *strength = rd(DIB3000MB_REG_SIGNAL_POWER) * 0xffff / 0x170; 608 *strength = rd(DIB3000MB_REG_SIGNAL_POWER) * 0xffff / 0x170;
609 return 0; 609 return 0;
@@ -611,7 +611,7 @@ static int dib3000mb_read_signal_strength(struct dvb_frontend* fe, u16 *strength
611 611
612static int dib3000mb_read_snr(struct dvb_frontend* fe, u16 *snr) 612static int dib3000mb_read_snr(struct dvb_frontend* fe, u16 *snr)
613{ 613{
614 struct dib3000_state* state = (struct dib3000_state*) fe->demodulator_priv; 614 struct dib3000_state* state = fe->demodulator_priv;
615 short sigpow = rd(DIB3000MB_REG_SIGNAL_POWER); 615 short sigpow = rd(DIB3000MB_REG_SIGNAL_POWER);
616 int icipow = ((rd(DIB3000MB_REG_NOISE_POWER_MSB) & 0xff) << 16) | 616 int icipow = ((rd(DIB3000MB_REG_NOISE_POWER_MSB) & 0xff) << 16) |
617 rd(DIB3000MB_REG_NOISE_POWER_LSB); 617 rd(DIB3000MB_REG_NOISE_POWER_LSB);
@@ -621,7 +621,7 @@ static int dib3000mb_read_snr(struct dvb_frontend* fe, u16 *snr)
621 621
622static int dib3000mb_read_unc_blocks(struct dvb_frontend* fe, u32 *unc) 622static int dib3000mb_read_unc_blocks(struct dvb_frontend* fe, u32 *unc)
623{ 623{
624 struct dib3000_state* state = (struct dib3000_state*) fe->demodulator_priv; 624 struct dib3000_state* state = fe->demodulator_priv;
625 625
626 *unc = rd(DIB3000MB_REG_UNC); 626 *unc = rd(DIB3000MB_REG_UNC);
627 return 0; 627 return 0;
@@ -629,7 +629,7 @@ static int dib3000mb_read_unc_blocks(struct dvb_frontend* fe, u32 *unc)
629 629
630static int dib3000mb_sleep(struct dvb_frontend* fe) 630static int dib3000mb_sleep(struct dvb_frontend* fe)
631{ 631{
632 struct dib3000_state* state = (struct dib3000_state*) fe->demodulator_priv; 632 struct dib3000_state* state = fe->demodulator_priv;
633 deb_info("dib3000mb is going to bed.\n"); 633 deb_info("dib3000mb is going to bed.\n");
634 wr(DIB3000MB_REG_POWER_CONTROL, DIB3000MB_POWER_DOWN); 634 wr(DIB3000MB_REG_POWER_CONTROL, DIB3000MB_POWER_DOWN);
635 return 0; 635 return 0;
@@ -656,7 +656,7 @@ static int dib3000mb_set_frontend_and_tuner(struct dvb_frontend* fe, struct dvb_
656 656
657static void dib3000mb_release(struct dvb_frontend* fe) 657static void dib3000mb_release(struct dvb_frontend* fe)
658{ 658{
659 struct dib3000_state *state = (struct dib3000_state*) fe->demodulator_priv; 659 struct dib3000_state *state = fe->demodulator_priv;
660 kfree(state); 660 kfree(state);
661} 661}
662 662
@@ -671,7 +671,7 @@ static int dib3000mb_pid_control(struct dvb_frontend *fe,int index, int pid,int
671 671
672static int dib3000mb_fifo_control(struct dvb_frontend *fe, int onoff) 672static int dib3000mb_fifo_control(struct dvb_frontend *fe, int onoff)
673{ 673{
674 struct dib3000_state *state = (struct dib3000_state*) fe->demodulator_priv; 674 struct dib3000_state *state = fe->demodulator_priv;
675 675
676 deb_xfer("%s fifo\n",onoff ? "enabling" : "disabling"); 676 deb_xfer("%s fifo\n",onoff ? "enabling" : "disabling");
677 if (onoff) { 677 if (onoff) {
@@ -692,7 +692,7 @@ static int dib3000mb_pid_parse(struct dvb_frontend *fe, int onoff)
692 692
693static int dib3000mb_tuner_pass_ctrl(struct dvb_frontend *fe, int onoff, u8 pll_addr) 693static int dib3000mb_tuner_pass_ctrl(struct dvb_frontend *fe, int onoff, u8 pll_addr)
694{ 694{
695 struct dib3000_state *state = (struct dib3000_state*) fe->demodulator_priv; 695 struct dib3000_state *state = fe->demodulator_priv;
696 if (onoff) { 696 if (onoff) {
697 wr(DIB3000MB_REG_TUNER, DIB3000_TUNER_WRITE_ENABLE(pll_addr)); 697 wr(DIB3000MB_REG_TUNER, DIB3000_TUNER_WRITE_ENABLE(pll_addr));
698 } else { 698 } else {
@@ -709,7 +709,7 @@ struct dvb_frontend* dib3000mb_attach(const struct dib3000_config* config,
709 struct dib3000_state* state = NULL; 709 struct dib3000_state* state = NULL;
710 710
711 /* allocate memory for the internal state */ 711 /* allocate memory for the internal state */
712 state = (struct dib3000_state*) kmalloc(sizeof(struct dib3000_state), GFP_KERNEL); 712 state = kmalloc(sizeof(struct dib3000_state), GFP_KERNEL);
713 if (state == NULL) 713 if (state == NULL)
714 goto error; 714 goto error;
715 memset(state,0,sizeof(struct dib3000_state)); 715 memset(state,0,sizeof(struct dib3000_state));