]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
[media] dvb-core: Don't pass DVBv3 parameters on tune() fops
authorMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 26 Dec 2011 20:48:33 +0000 (17:48 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sat, 31 Dec 2011 12:08:46 +0000 (10:08 -0200)
As all parameters are passed via DVBv5 to the frontends, there's
no need to pass them again via fops. Also, most drivers weren't using
it anyway. So, instead, just pass a parameter to indicate if the
hardware algorithm wants the driver to re-tune or not.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb/bt8xx/dst.c
drivers/media/dvb/dvb-core/dvb_frontend.c
drivers/media/dvb/dvb-core/dvb_frontend.h
drivers/media/dvb/frontends/cx24116.c
drivers/media/dvb/frontends/cx24123.c
drivers/media/dvb/frontends/ds3000.c
drivers/media/dvb/frontends/mb86a20s.c
drivers/media/dvb/frontends/s921.c
drivers/media/dvb/pt1/va1j5jf8007s.c
drivers/media/dvb/pt1/va1j5jf8007t.c

index 7d60893108b02c5b8c075dcfc0a1f62c68f36fb6..80b1f2a2a90c4905640d6d9d4af92a05412103b0 100644 (file)
@@ -1643,31 +1643,32 @@ static int dst_set_frontend(struct dvb_frontend *fe)
 }
 
 static int dst_tune_frontend(struct dvb_frontend* fe,
-                           struct dvb_frontend_parameters* p,
+                           bool re_tune,
                            unsigned int mode_flags,
                            unsigned int *delay,
                            fe_status_t *status)
 {
        struct dst_state *state = fe->demodulator_priv;
+       struct dtv_frontend_properties *p = &fe->dtv_property_cache;
 
-       if (p != NULL) {
+       if (re_tune) {
                dst_set_freq(state, p->frequency);
                dprintk(verbose, DST_DEBUG, 1, "Set Frequency=[%d]", p->frequency);
 
                if (state->dst_type == DST_TYPE_IS_SAT) {
                        if (state->type_flags & DST_TYPE_HAS_OBS_REGS)
                                dst_set_inversion(state, p->inversion);
-                       dst_set_fec(state, p->u.qpsk.fec_inner);
-                       dst_set_symbolrate(state, p->u.qpsk.symbol_rate);
+                       dst_set_fec(state, p->fec_inner);
+                       dst_set_symbolrate(state, p->symbol_rate);
                        dst_set_polarization(state);
-                       dprintk(verbose, DST_DEBUG, 1, "Set Symbolrate=[%d]", p->u.qpsk.symbol_rate);
+                       dprintk(verbose, DST_DEBUG, 1, "Set Symbolrate=[%d]", p->symbol_rate);
 
                } else if (state->dst_type == DST_TYPE_IS_TERR)
-                       dst_set_bandwidth(state, p->u.ofdm.bandwidth);
+                       dst_set_bandwidth(state, p->bandwidth_hz);
                else if (state->dst_type == DST_TYPE_IS_CABLE) {
-                       dst_set_fec(state, p->u.qam.fec_inner);
-                       dst_set_symbolrate(state, p->u.qam.symbol_rate);
-                       dst_set_modulation(state, p->u.qam.modulation);
+                       dst_set_fec(state, p->fec_inner);
+                       dst_set_symbolrate(state, p->symbol_rate);
+                       dst_set_modulation(state, p->modulation);
                }
                dst_write_tuna(fe);
        }
index 239f762b9cdbb0e328cddc3b6b5400236a382a94..caed27532ed5652e813ca263fca34b2f3ea23d7d 100644 (file)
@@ -547,7 +547,7 @@ static int dvb_frontend_thread(void *data)
        fe_status_t s;
        enum dvbfe_algo algo;
 
-       struct dvb_frontend_parameters *params;
+       bool re_tune = false;
 
        dprintk("%s\n", __func__);
 
@@ -596,18 +596,15 @@ restart:
                        switch (algo) {
                        case DVBFE_ALGO_HW:
                                dprintk("%s: Frontend ALGO = DVBFE_ALGO_HW\n", __func__);
-                               params = NULL; /* have we been asked to RETUNE ? */
 
                                if (fepriv->state & FESTATE_RETUNE) {
                                        dprintk("%s: Retune requested, FESTATE_RETUNE\n", __func__);
-                                       params = &fepriv->parameters_in;
+                                       re_tune = true;
                                        fepriv->state = FESTATE_TUNED;
                                }
 
                                if (fe->ops.tune)
-                                       fe->ops.tune(fe, params, fepriv->tune_mode_flags, &fepriv->delay, &s);
-                               if (params)
-                                       fepriv->parameters_out = *params;
+                                       fe->ops.tune(fe, re_tune, fepriv->tune_mode_flags, &fepriv->delay, &s);
 
                                if (s != fepriv->status && !(fepriv->tune_mode_flags & FE_TUNE_MODE_ONESHOT)) {
                                        dprintk("%s: state changed, adding current state\n", __func__);
index fb985021664a84d8958d97852e1066736f9f45ae..c77100b21d2f50855d59e59a3db53b9af299cdac 100644 (file)
@@ -273,7 +273,7 @@ struct dvb_frontend_ops {
 
        /* if this is set, it overrides the default swzigzag */
        int (*tune)(struct dvb_frontend* fe,
-                   struct dvb_frontend_parameters* params,
+                   bool re_tune,
                    unsigned int mode_flags,
                    unsigned int *delay,
                    fe_status_t *status);
index f24819a04b0ae058ea959ce413bed02484144b73..e29de1ca98550bb5d035f2f052bfb8a40f5cfe7a 100644 (file)
@@ -1440,7 +1440,7 @@ tuned:  /* Set/Reset B/W */
        return cx24116_cmd_execute(fe, &cmd);
 }
 
-static int cx24116_tune(struct dvb_frontend *fe, struct dvb_frontend_parameters *params,
+static int cx24116_tune(struct dvb_frontend *fe, bool re_tune,
        unsigned int mode_flags, unsigned int *delay, fe_status_t *status)
 {
        /*
@@ -1452,7 +1452,7 @@ static int cx24116_tune(struct dvb_frontend *fe, struct dvb_frontend_parameters
         */
 
        *delay = HZ / 5;
-       if (params) {
+       if (re_tune) {
                int ret = cx24116_set_frontend(fe);
                if (ret)
                        return ret;
index a8af0bd20d77d9ab4d6acc4b64e8c00506c52df0..faafb1fc6c05e6417377dd91f46b5c9b0acf54a2 100644 (file)
@@ -1006,14 +1006,14 @@ static int cx24123_set_tone(struct dvb_frontend *fe, fe_sec_tone_mode_t tone)
 }
 
 static int cx24123_tune(struct dvb_frontend *fe,
-                       struct dvb_frontend_parameters *params,
+                       bool re_tune,
                        unsigned int mode_flags,
                        unsigned int *delay,
                        fe_status_t *status)
 {
        int retval = 0;
 
-       if (params != NULL)
+       if (re_tune)
                retval = cx24123_set_frontend(fe);
 
        if (!(mode_flags & FE_TUNE_MODE_ONESHOT))
index f8fa80ab31a141ecabea8e063ba803dcf7ec80e3..c6a43c49e72814b3ab7f4e70eeb001d4317f657a 100644 (file)
@@ -1205,12 +1205,12 @@ static int ds3000_set_frontend(struct dvb_frontend *fe)
 }
 
 static int ds3000_tune(struct dvb_frontend *fe,
-                       struct dvb_frontend_parameters *p,
+                       bool re_tune,
                        unsigned int mode_flags,
                        unsigned int *delay,
                        fe_status_t *status)
 {
-       if (p) {
+       if (re_tune) {
                int ret = ds3000_set_frontend(fe);
                if (ret)
                        return ret;
index a67d7ef7712b38f5e283c0b9a5ed0a603537219b..d71d6ee2bfd59780e0e4f463732d5e697bed1b26 100644 (file)
@@ -540,7 +540,7 @@ static int mb86a20s_get_frontend(struct dvb_frontend *fe,
 }
 
 static int mb86a20s_tune(struct dvb_frontend *fe,
-                       struct dvb_frontend_parameters *params,
+                       bool re_tune,
                        unsigned int mode_flags,
                        unsigned int *delay,
                        fe_status_t *status)
@@ -549,7 +549,7 @@ static int mb86a20s_tune(struct dvb_frontend *fe,
 
        dprintk("\n");
 
-       if (params != NULL)
+       if (re_tune)
                rc = mb86a20s_set_frontend(fe);
 
        if (!(mode_flags & FE_TUNE_MODE_ONESHOT))
index 4c452f487cd1b400044dc284047d8e15823ee96d..2e15f92a9a9edd46332c4f51a77b2aa6c91e1672 100644 (file)
@@ -445,7 +445,7 @@ static int s921_get_frontend(struct dvb_frontend *fe,
 }
 
 static int s921_tune(struct dvb_frontend *fe,
-                       struct dvb_frontend_parameters *params,
+                       bool re_tune,
                        unsigned int mode_flags,
                        unsigned int *delay,
                        fe_status_t *status)
@@ -454,7 +454,7 @@ static int s921_tune(struct dvb_frontend *fe,
 
        dprintk("\n");
 
-       if (params != NULL)
+       if (re_tune)
                rc = s921_set_frontend(fe);
 
        if (!(mode_flags & FE_TUNE_MODE_ONESHOT))
index 451641c0c1d2d41ec6bf0ad54183c8511157ddb9..78344e3a5c7a8969e453f02f79ed50c5143ec26f 100644 (file)
@@ -385,7 +385,7 @@ va1j5jf8007s_check_ts_id(struct va1j5jf8007s_state *state, int *lock)
 
 static int
 va1j5jf8007s_tune(struct dvb_frontend *fe,
-                 struct dvb_frontend_parameters *params,
+                 bool re_tune,
                  unsigned int mode_flags,  unsigned int *delay,
                  fe_status_t *status)
 {
@@ -395,7 +395,7 @@ va1j5jf8007s_tune(struct dvb_frontend *fe,
 
        state = fe->demodulator_priv;
 
-       if (params != NULL)
+       if (re_tune)
                state->tune_state = VA1J5JF8007S_SET_FREQUENCY_1;
 
        switch (state->tune_state) {
index 0f085c3e571b71904fbdc37401bd4d3c63bb724e..c64282002c5df76dca590e1ce2ca72ecba4b9dee 100644 (file)
@@ -264,7 +264,7 @@ static int va1j5jf8007t_check_modulation(struct va1j5jf8007t_state *state,
 
 static int
 va1j5jf8007t_tune(struct dvb_frontend *fe,
-                 struct dvb_frontend_parameters *params,
+                 bool re_tune,
                  unsigned int mode_flags,  unsigned int *delay,
                  fe_status_t *status)
 {
@@ -274,7 +274,7 @@ va1j5jf8007t_tune(struct dvb_frontend *fe,
 
        state = fe->demodulator_priv;
 
-       if (params != NULL)
+       if (re_tune)
                state->tune_state = VA1J5JF8007T_SET_FREQUENCY;
 
        switch (state->tune_state) {