[media] drxk: Switch the delivery system on FE_SET_PROPERTY
authorMauro Carvalho Chehab <mchehab@redhat.com>
Fri, 9 Dec 2011 10:53:36 +0000 (08:53 -0200)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Fri, 9 Dec 2011 22:49:05 +0000 (20:49 -0200)
The DRX-K doesn't change the delivery system at set_properties,
but do it at frontend init. This causes problems on programs like
w_scan that, by default, opens both frontends.

Instead, explicitly set the format when set_parameters callback is
called.

Tested-by: Eddi De Pieri <eddi@depieri.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb/frontends/drxk_hard.c
drivers/media/dvb/frontends/drxk_hard.h
drivers/media/video/em28xx/em28xx-dvb.c

index 95cbc98176fafe0ad9de2cfd4d72f1a25b2dae87..038e470bf039366789bb7207478ef7c752fe95bd 100644 (file)
@@ -1847,6 +1847,7 @@ static int SetOperationMode(struct drxk_state *state,
                */
        switch (oMode) {
        case OM_DVBT:
+               dprintk(1, ": DVB-T\n");
                state->m_OperationMode = oMode;
                status = SetDVBTStandard(state, oMode);
                if (status < 0)
@@ -1854,6 +1855,8 @@ static int SetOperationMode(struct drxk_state *state,
                break;
        case OM_QAM_ITU_A:      /* fallthrough */
        case OM_QAM_ITU_C:
+               dprintk(1, ": DVB-C Annex %c\n",
+                       (state->m_OperationMode == OM_QAM_ITU_A) ? 'A' : 'C');
                state->m_OperationMode = oMode;
                status = SetQAMStandard(state, oMode);
                if (status < 0)
@@ -6183,7 +6186,10 @@ static int drxk_c_init(struct dvb_frontend *fe)
        dprintk(1, "\n");
        if (mutex_trylock(&state->ctlock) == 0)
                return -EBUSY;
-       SetOperationMode(state, OM_QAM_ITU_A);
+       if (state->m_itut_annex_c)
+               SetOperationMode(state, OM_QAM_ITU_C);
+       else
+               SetOperationMode(state, OM_QAM_ITU_A);
        return 0;
 }
 
@@ -6219,12 +6225,11 @@ static int drxk_set_parameters(struct dvb_frontend *fe,
                return -EINVAL;
        }
 
-       if (state->m_OperationMode == OM_QAM_ITU_A ||
-           state->m_OperationMode == OM_QAM_ITU_C) {
+       if (fe->ops.info.type == FE_QAM) {
                if (fe->dtv_property_cache.rolloff == ROLLOFF_13)
-                       state->m_OperationMode = OM_QAM_ITU_C;
+                       state->m_itut_annex_c = true;
                else
-                       state->m_OperationMode = OM_QAM_ITU_A;
+                       state->m_itut_annex_c = false;
        }
 
        if (fe->ops.i2c_gate_ctrl)
index a05c32eecdcc7de893a297c6faf53b54324a040c..85a423f91960b6e95f3e89158717922e5f51ced7 100644 (file)
@@ -263,6 +263,8 @@ struct drxk_state {
        u8     m_TSDataStrength;
        u8     m_TSClockkStrength;
 
+       bool   m_itut_annex_c;      /* If true, uses ITU-T DVB-C Annex C, instead of Annex A */
+
        enum DRXMPEGStrWidth_t  m_widthSTR;    /**< MPEG start width */
        u32    m_mpegTsStaticBitrate;          /**< Maximum bitrate in b/s in case
                                                    static clockrate is selected */
index 7f0592c50b2ce1c98542f1179ab0ea1a7899c8cf..3868c1e7359213d45cf7e2717a50bbd44eaabc63 100644 (file)
@@ -899,6 +899,8 @@ static int em28xx_dvb_init(struct em28xx *dev)
                       &dvb->fe[0]->ops.tuner_ops,
                       sizeof(dvb->fe[0]->ops.tuner_ops));
 
+               mfe_shared = 1;
+
                break;
        }
        case EM2884_BOARD_TERRATEC_H5:
@@ -935,6 +937,8 @@ static int em28xx_dvb_init(struct em28xx *dev)
                       &dvb->fe[0]->ops.tuner_ops,
                       sizeof(dvb->fe[0]->ops.tuner_ops));
 
+               mfe_shared = 1;
+
                break;
        case EM28174_BOARD_PCTV_460E:
                /* attach demod */