Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / drivers / media / dvb / frontends / dib3000mb.c
index 6f52d64..ae589ad 100644 (file)
 
 #include <linux/config.h>
 #include <linux/kernel.h>
-#include <linux/version.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/init.h>
 #include <linux/delay.h>
+#include <linux/string.h>
+#include <linux/slab.h>
 
 #include "dib3000-common.h"
 #include "dib3000mb_priv.h"
@@ -48,8 +49,6 @@ MODULE_PARM_DESC(debug, "set debugging level (1=info,2=xfer,4=setfe,8=getfe (|-a
 #define deb_setf(args...) dprintk(0x04,args)
 #define deb_getf(args...) dprintk(0x08,args)
 
-static int dib3000mb_tuner_pass_ctrl(struct dvb_frontend *fe, int onoff, u8 pll_addr);
-
 static int dib3000mb_get_frontend(struct dvb_frontend* fe,
                                  struct dvb_frontend_parameters *fep);
 
@@ -61,10 +60,8 @@ static int dib3000mb_set_frontend(struct dvb_frontend* fe,
        fe_code_rate_t fe_cr = FEC_NONE;
        int search_state, seq;
 
-       if (tuner && state->config.pll_addr && state->config.pll_set) {
-               dib3000mb_tuner_pass_ctrl(fe,1,state->config.pll_addr(fe));
-               state->config.pll_set(fe, fep, NULL);
-               dib3000mb_tuner_pass_ctrl(fe,0,state->config.pll_addr(fe));
+       if (tuner && state->config.pll_set) {
+               state->config.pll_set(fe, fep);
 
                deb_setf("bandwidth: ");
                switch (ofdm->bandwidth) {
@@ -389,11 +386,8 @@ static int dib3000mb_fe_init(struct dvb_frontend* fe, int mobile_mode)
 
        wr(DIB3000MB_REG_DATA_IN_DIVERSITY, DIB3000MB_DATA_DIVERSITY_IN_OFF);
 
-       if (state->config.pll_init) {
-               dib3000mb_tuner_pass_ctrl(fe,1,state->config.pll_addr(fe));
-               state->config.pll_init(fe,NULL);
-               dib3000mb_tuner_pass_ctrl(fe,0,state->config.pll_addr(fe));
-       }
+       if (state->config.pll_init)
+               state->config.pll_init(fe);
 
        return 0;
 }
@@ -623,7 +617,7 @@ static int dib3000mb_read_unc_blocks(struct dvb_frontend* fe, u32 *unc)
 {
        struct dib3000_state* state = fe->demodulator_priv;
 
-       *unc = rd(DIB3000MB_REG_UNC);
+       *unc = rd(DIB3000MB_REG_PACKET_ERROR_RATE);
        return 0;
 }
 
@@ -638,9 +632,6 @@ static int dib3000mb_sleep(struct dvb_frontend* fe)
 static int dib3000mb_fe_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend_tune_settings *tune)
 {
        tune->min_delay_ms = 800;
-       tune->step_size = 166667;
-       tune->max_drift = 166667 * 2;
-
        return 0;
 }
 
@@ -709,10 +700,9 @@ struct dvb_frontend* dib3000mb_attach(const struct dib3000_config* config,
        struct dib3000_state* state = NULL;
 
        /* allocate memory for the internal state */
-       state = kmalloc(sizeof(struct dib3000_state), GFP_KERNEL);
+       state = kzalloc(sizeof(struct dib3000_state), GFP_KERNEL);
        if (state == NULL)
                goto error;
-       memset(state,0,sizeof(struct dib3000_state));
 
        /* setup the state */
        state->i2c = i2c;