[media] stv090x: add support for multistream
authorEvgeny Plehov <EvgenyPlehov@ukr.net>
Thu, 13 Sep 2012 13:19:39 +0000 (10:19 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 24 Sep 2012 00:27:19 +0000 (21:27 -0300)
Adds support for filtering multistream TS using stv090x hardware.

Signed-off-by: Evgeny Plehov <EvgenyPlehov@ukr.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb-frontends/stv090x.c

index ea86a5603e5756106a342a18668d3b8889ebdd1e..13caec013902b72839c473be7d1ba3f02e7aa96d 100644 (file)
@@ -3425,6 +3425,33 @@ err:
        return -1;
 }
 
+static int stv090x_set_mis(struct stv090x_state *state, int mis)
+{
+       u32 reg;
+
+       if (mis < 0 || mis > 255) {
+               dprintk(FE_DEBUG, 1, "Disable MIS filtering");
+               reg = STV090x_READ_DEMOD(state, PDELCTRL1);
+               STV090x_SETFIELD_Px(reg, FILTER_EN_FIELD, 0x00);
+               if (STV090x_WRITE_DEMOD(state, PDELCTRL1, reg) < 0)
+                       goto err;
+       } else {
+               dprintk(FE_DEBUG, 1, "Enable MIS filtering - %d", mis);
+               reg = STV090x_READ_DEMOD(state, PDELCTRL1);
+               STV090x_SETFIELD_Px(reg, FILTER_EN_FIELD, 0x01);
+               if (STV090x_WRITE_DEMOD(state, PDELCTRL1, reg) < 0)
+                       goto err;
+               if (STV090x_WRITE_DEMOD(state, ISIENTRY, mis) < 0)
+                       goto err;
+               if (STV090x_WRITE_DEMOD(state, ISIBITENA, 0xff) < 0)
+                       goto err;
+       }
+       return 0;
+err:
+       dprintk(FE_ERROR, 1, "I/O error");
+       return -1;
+}
+
 static enum dvbfe_search stv090x_search(struct dvb_frontend *fe)
 {
        struct stv090x_state *state = fe->demodulator_priv;
@@ -3447,6 +3474,8 @@ static enum dvbfe_search stv090x_search(struct dvb_frontend *fe)
                state->search_range = 5000000;
        }
 
+       stv090x_set_mis(state, props->stream_id);
+
        if (stv090x_algo(state) == STV090x_RANGEOK) {
                dprintk(FE_DEBUG, 1, "Search success!");
                return DVBFE_ALGO_SEARCH_SUCCESS;
@@ -4798,6 +4827,9 @@ struct dvb_frontend *stv090x_attach(const struct stv090x_config *config,
                }
        }
 
+       if (state->internal->dev_ver >= 0x30)
+               state->frontend.ops.info.caps |= FE_CAN_MULTISTREAM;
+
        /* workaround for stuck DiSEqC output */
        if (config->diseqc_envelope_mode)
                stv090x_send_diseqc_burst(&state->frontend, SEC_MINI_A);
This page took 0.033455 seconds and 5 git commands to generate.