diff options
Diffstat (limited to 'drivers/media/dvb/frontends/dib3000mc.c')
-rw-r--r-- | drivers/media/dvb/frontends/dib3000mc.c | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/drivers/media/dvb/frontends/dib3000mc.c b/drivers/media/dvb/frontends/dib3000mc.c index 66b30edad2e4..41710f43975a 100644 --- a/drivers/media/dvb/frontends/dib3000mc.c +++ b/drivers/media/dvb/frontends/dib3000mc.c | |||
@@ -558,7 +558,7 @@ static int dib3000mc_set_frontend(struct dvb_frontend* fe, | |||
558 | static int dib3000mc_fe_init(struct dvb_frontend* fe, int mobile_mode) | 558 | static int dib3000mc_fe_init(struct dvb_frontend* fe, int mobile_mode) |
559 | { | 559 | { |
560 | struct dib3000_state *state = fe->demodulator_priv; | 560 | struct dib3000_state *state = fe->demodulator_priv; |
561 | int AGCtuner=(int)fe->misc_priv; | 561 | const struct dib3000p_agc_config *agc = state->config.agc; |
562 | deb_info("init start\n"); | 562 | deb_info("init start\n"); |
563 | 563 | ||
564 | state->timing_offset = 0; | 564 | state->timing_offset = 0; |
@@ -584,11 +584,24 @@ static int dib3000mc_fe_init(struct dvb_frontend* fe, int mobile_mode) | |||
584 | /* mobile mode - portable reception */ | 584 | /* mobile mode - portable reception */ |
585 | wr_foreach(dib3000mc_reg_mobile_mode,dib3000mc_mobile_mode[1]); | 585 | wr_foreach(dib3000mc_reg_mobile_mode,dib3000mc_mobile_mode[1]); |
586 | 586 | ||
587 | /* TUNER_PANASONIC_ENV57H12D5 or TUNER_MICROTUNE_MT2060. Sets agc_tuner accordingly */ | 587 | /* AGC settings for all tuners */ |
588 | wr_foreach(dib3000mc_reg_agc_bandwidth,dib3000mc_agc_bandwidth); | 588 | wr_foreach(dib3000mc_reg_agc_bandwidth,dib3000mc_agc_bandwidth); |
589 | wr_foreach(dib3000mc_reg_agc_bandwidth_general,dib3000mc_agc_bandwidth_general); | 589 | wr_foreach(dib3000mc_reg_agc_bandwidth_general,dib3000mc_agc_bandwidth_general); |
590 | if (AGCtuner<0 || AGCtuner>=DIB3000MC_AGC_TUNER_COUNT) AGCtuner=1; | 590 | |
591 | wr_foreach(dib3000mc_reg_agc,dib3000mc_agc_tuner[AGCtuner]); | 591 | /* AGC setting - specific to the tuners */ |
592 | wr(36, agc->val[0]); | ||
593 | wr(37, agc->val[1]); | ||
594 | wr(38, agc->val[2]); | ||
595 | wr(39, agc->val[3]); | ||
596 | |||
597 | wr(42, agc->val[4]); | ||
598 | wr(43, agc->val[5]); | ||
599 | wr(44, agc->val[6]); | ||
600 | wr(45, agc->val[7]); | ||
601 | wr(46, agc->val[8]); | ||
602 | wr(47, agc->val[9]); | ||
603 | wr(48, agc->val[10]); | ||
604 | wr(49, agc->val[11]); | ||
592 | 605 | ||
593 | wr(DIB3000MC_REG_UNK_110,DIB3000MC_UNK_110); | 606 | wr(DIB3000MC_REG_UNK_110,DIB3000MC_UNK_110); |
594 | wr(26,0x6680); | 607 | wr(26,0x6680); |
@@ -824,6 +837,13 @@ static int dib3000mc_demod_init(struct dib3000_state *state) | |||
824 | return 0; | 837 | return 0; |
825 | } | 838 | } |
826 | 839 | ||
840 | int dib3000mc_set_agc_config(struct dvb_frontend *fe, const struct dib3000p_agc_config *agc) | ||
841 | { | ||
842 | struct dib3000_state *st = fe->demodulator_priv; | ||
843 | st->config.agc = agc; | ||
844 | return 0; | ||
845 | } | ||
846 | EXPORT_SYMBOL(dib3000mc_set_agc_config); | ||
827 | 847 | ||
828 | static struct dvb_frontend_ops dib3000mc_ops; | 848 | static struct dvb_frontend_ops dib3000mc_ops; |
829 | 849 | ||
@@ -878,6 +898,7 @@ error: | |||
878 | kfree(state); | 898 | kfree(state); |
879 | return NULL; | 899 | return NULL; |
880 | } | 900 | } |
901 | EXPORT_SYMBOL(dib3000mc_attach); | ||
881 | 902 | ||
882 | static struct dvb_frontend_ops dib3000mc_ops = { | 903 | static struct dvb_frontend_ops dib3000mc_ops = { |
883 | 904 | ||
@@ -916,5 +937,3 @@ static struct dvb_frontend_ops dib3000mc_ops = { | |||
916 | MODULE_AUTHOR(DRIVER_AUTHOR); | 937 | MODULE_AUTHOR(DRIVER_AUTHOR); |
917 | MODULE_DESCRIPTION(DRIVER_DESC); | 938 | MODULE_DESCRIPTION(DRIVER_DESC); |
918 | MODULE_LICENSE("GPL"); | 939 | MODULE_LICENSE("GPL"); |
919 | |||
920 | EXPORT_SYMBOL(dib3000mc_attach); | ||