]> err.no Git - linux-2.6/blobdiff - drivers/media/dvb/frontends/dib7000m.c
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
[linux-2.6] / drivers / media / dvb / frontends / dib7000m.c
index 608156a691de98dacf2f9f99beedee0ea6d90164..5f1375e30dfc25e3bff127b8bf6ebbf4ef2e420e 100644 (file)
@@ -42,9 +42,9 @@ struct dib7000m_state {
        u32 timf_default;
        u32 internal_clk;
 
-       uint8_t div_force_off : 1;
-       uint8_t div_state : 1;
-       uint16_t div_sync_wait;
+       u8 div_force_off : 1;
+       u8 div_state : 1;
+       u16 div_sync_wait;
 
        u16 revision;
 
@@ -302,7 +302,7 @@ static int dib7000m_set_diversity_in(struct dvb_frontend *demod, int onoff)
                dprintk( "diversity combination deactivated - forced by COFDM parameters");
                onoff = 0;
        }
-       state->div_state = (uint8_t)onoff;
+       state->div_state = (u8)onoff;
 
        if (onoff) {
                dib7000m_write_word(state, 263 + state->reg_offs, 6);
@@ -620,7 +620,7 @@ static int dib7000m_update_lna(struct dib7000m_state *state)
        u16 dyn_gain;
 
        if (state->cfg.update_lna) {
-               // read dyn_gain here (because it is demod-dependent and not tuner)
+               // read dyn_gain here (because it is demod-dependent and not fe)
                dyn_gain = dib7000m_read_word(state, 390);
 
                if (state->cfg.update_lna(&state->demod,dyn_gain)) { // LNA has changed
@@ -754,7 +754,7 @@ static int dib7000m_agc_startup(struct dvb_frontend *demod, struct dvb_frontend_
                        break;
 
        case 3: /* split search ended */
-                       agc_split = (uint8_t)dib7000m_read_word(state, 392); /* store the split value for the next time */
+                       agc_split = (u8)dib7000m_read_word(state, 392); /* store the split value for the next time */
                        dib7000m_write_word(state, 75, dib7000m_read_word(state, 390)); /* set AGC gain start value */
 
                        dib7000m_write_word(state, 72,  cfg_72 & ~(1 << 4));   /* std AGC loop */
@@ -1171,7 +1171,9 @@ static int dib7000m_set_frontend(struct dvb_frontend* fe,
                                struct dvb_frontend_parameters *fep)
 {
        struct dib7000m_state *state = fe->demodulator_priv;
-       int time;
+       int time, ret;
+
+    dib7000m_set_output_mode(state, OUTMODE_HIGH_Z);
 
        state->current_bandwidth = fep->u.ofdm.bandwidth;
        dib7000m_set_bandwidth(state, BANDWIDTH_TO_KHZ(fep->u.ofdm.bandwidth));
@@ -1206,10 +1208,11 @@ static int dib7000m_set_frontend(struct dvb_frontend* fe,
                dib7000m_get_frontend(fe, fep);
        }
 
+       ret = dib7000m_tune(fe, fep);
+
        /* make this a config parameter */
        dib7000m_set_output_mode(state, OUTMODE_MPEG2_FIFO);
-
-       return dib7000m_tune(fe, fep);
+       return ret;
 }
 
 static int dib7000m_read_status(struct dvb_frontend *fe, fe_status_t *stat)
@@ -1344,6 +1347,8 @@ struct dvb_frontend * dib7000m_attach(struct i2c_adapter *i2c_adap, u8 i2c_addr,
        demod->demodulator_priv = st;
        memcpy(&st->demod.ops, &dib7000m_ops, sizeof(struct dvb_frontend_ops));
 
+       st->timf_default = cfg->bw->timf;
+
        if (dib7000m_identify(st) != 0)
                goto error;