[media] cxd2820r: sleep on DVB-T/T2 delivery system switch
authorAntti Palosaari <crope@iki.fi>
Fri, 20 Jan 2012 22:48:28 +0000 (19:48 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 23 Jan 2012 20:10:52 +0000 (18:10 -0200)
Fix bug introduced by multi-frontend to single-frontend change.
It is safer to put DVB-T parts sleeping when auto-switching to DVB-T2
and vice versa. That was original behaviour.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb/frontends/cxd2820r_core.c

index bdfa207a883e2278a2e496ae8dcfa720e9b3da3e..5c7c2aaf9bf58583eb52ed6f3ba7b4d48df6d29b 100644 (file)
@@ -482,10 +482,19 @@ static enum dvbfe_search cxd2820r_search(struct dvb_frontend *fe)
 
        /* switch between DVB-T and DVB-T2 when tune fails */
        if (priv->last_tune_failed) {
-               if (priv->delivery_system == SYS_DVBT)
+               if (priv->delivery_system == SYS_DVBT) {
+                       ret = cxd2820r_sleep_t(fe);
+                       if (ret)
+                               goto error;
+
                        c->delivery_system = SYS_DVBT2;
-               else if (priv->delivery_system == SYS_DVBT2)
+               } else if (priv->delivery_system == SYS_DVBT2) {
+                       ret = cxd2820r_sleep_t2(fe);
+                       if (ret)
+                               goto error;
+
                        c->delivery_system = SYS_DVBT;
+               }
        }
 
        /* set frontend */