]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/media/dvb/frontends/cxd2820r_core.c
Merge tag 'for-3.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb...
[karo-tx-linux.git] / drivers / media / dvb / frontends / cxd2820r_core.c
index 93e1b12e79077ddc851ffd5fd85c8240c795eed7..5c7c2aaf9bf58583eb52ed6f3ba7b4d48df6d29b 100644 (file)
@@ -309,9 +309,14 @@ static int cxd2820r_read_status(struct dvb_frontend *fe, fe_status_t *status)
 
 static int cxd2820r_get_frontend(struct dvb_frontend *fe)
 {
+       struct cxd2820r_priv *priv = fe->demodulator_priv;
        int ret;
 
        dbg("%s: delsys=%d", __func__, fe->dtv_property_cache.delivery_system);
+
+       if (priv->delivery_system == SYS_UNDEFINED)
+               return 0;
+
        switch (fe->dtv_property_cache.delivery_system) {
        case SYS_DVBT:
                ret = cxd2820r_get_frontend_t(fe);
@@ -476,11 +481,20 @@ static enum dvbfe_search cxd2820r_search(struct dvb_frontend *fe)
        dbg("%s: delsys=%d", __func__, fe->dtv_property_cache.delivery_system);
 
        /* switch between DVB-T and DVB-T2 when tune fails */
-       if (priv->last_tune_failed && (priv->delivery_system != SYS_DVBC_ANNEX_A)) {
-               if (priv->delivery_system == SYS_DVBT)
+       if (priv->last_tune_failed) {
+               if (priv->delivery_system == SYS_DVBT) {
+                       ret = cxd2820r_sleep_t(fe);
+                       if (ret)
+                               goto error;
+
                        c->delivery_system = SYS_DVBT2;
-               else
+               } else if (priv->delivery_system == SYS_DVBT2) {
+                       ret = cxd2820r_sleep_t2(fe);
+                       if (ret)
+                               goto error;
+
                        c->delivery_system = SYS_DVBT;
+               }
        }
 
        /* set frontend */
@@ -492,6 +506,7 @@ static enum dvbfe_search cxd2820r_search(struct dvb_frontend *fe)
        /* frontend lock wait loop count */
        switch (priv->delivery_system) {
        case SYS_DVBT:
+       case SYS_DVBC_ANNEX_A:
                i = 20;
                break;
        case SYS_DVBT2:
@@ -556,7 +571,7 @@ static const struct dvb_frontend_ops cxd2820r_ops = {
        .delsys = { SYS_DVBT, SYS_DVBT2, SYS_DVBC_ANNEX_A },
        /* default: DVB-T/T2 */
        .info = {
-               .name = "Sony CXD2820R (DVB-T/T2)",
+               .name = "Sony CXD2820R",
 
                .caps = FE_CAN_FEC_1_2                  |
                        FE_CAN_FEC_2_3                  |
@@ -566,7 +581,9 @@ static const struct dvb_frontend_ops cxd2820r_ops = {
                        FE_CAN_FEC_AUTO                 |
                        FE_CAN_QPSK                     |
                        FE_CAN_QAM_16                   |
+                       FE_CAN_QAM_32                   |
                        FE_CAN_QAM_64                   |
+                       FE_CAN_QAM_128                  |
                        FE_CAN_QAM_256                  |
                        FE_CAN_QAM_AUTO                 |
                        FE_CAN_TRANSMISSION_MODE_AUTO   |
@@ -596,8 +613,7 @@ static const struct dvb_frontend_ops cxd2820r_ops = {
 };
 
 struct dvb_frontend *cxd2820r_attach(const struct cxd2820r_config *cfg,
-                                    struct i2c_adapter *i2c,
-                                    struct dvb_frontend *fe)
+               struct i2c_adapter *i2c)
 {
        struct cxd2820r_priv *priv = NULL;
        int ret;