]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[media] mb86a20s: fix ISDB-T mode handling
authorMauro Carvalho Chehab <m.chehab@samsung.com>
Mon, 21 Jul 2014 17:55:05 +0000 (14:55 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Wed, 23 Jul 2014 00:33:25 +0000 (21:33 -0300)
The driver was reporting an incorrect mode, when mode 2
is selected.

While testing it, noticed that neither mode 1 or guard
interval 1/32 is supported by this device. Document it,
and ensure that it will report _AUTO when it doesn't lock,
in order to not report a wrong detection to userspace.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/dvb-frontends/mb86a20s.c

index 2f458bb188c738756312ae898aaf5287531bf58b..79bc1c9d0fa9b4ace49a37505c0d50f42de40ff2 100644 (file)
@@ -721,11 +721,10 @@ static int mb86a20s_get_frontend(struct dvb_frontend *fe)
        rc = mb86a20s_readreg(state, 0x07);
        if (rc < 0)
                return rc;
+       c->transmission_mode = TRANSMISSION_MODE_AUTO;
        if ((rc & 0x60) == 0x20) {
-               switch (rc & 0x0c >> 2) {
-               case 0:
-                       c->transmission_mode = TRANSMISSION_MODE_2K;
-                       break;
+               /* Only modes 2 and 3 are supported */
+               switch ((rc >> 2) & 0x03) {
                case 1:
                        c->transmission_mode = TRANSMISSION_MODE_4K;
                        break;
@@ -734,7 +733,9 @@ static int mb86a20s_get_frontend(struct dvb_frontend *fe)
                        break;
                }
        }
+       c->guard_interval = GUARD_INTERVAL_AUTO;
        if (!(rc & 0x10)) {
+               /* Guard interval 1/32 is not supported */
                switch (rc & 0x3) {
                case 0:
                        c->guard_interval = GUARD_INTERVAL_1_4;