]> git.karo-electronics.de Git - linux-beck.git/commitdiff
V4L/DVB (12825): tm6000: I2C reading operations is not reliable on tm6000
authorMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 14 Sep 2009 13:23:20 +0000 (10:23 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 18 May 2010 03:40:06 +0000 (00:40 -0300)
tm6000 sometimes can't read from i2c, but this is currently required for
tuner-xc2028 to work.

This patch adds an option to tuner-xc2028 to not rely on i2c reading.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/common/tuners/tuner-xc2028.c
drivers/media/common/tuners/tuner-xc2028.h
drivers/staging/tm6000/tm6000-cards.c

index 8d2907f38a9472bee9edfe6d70921fe0202b0462..53f0fbb33cc631a234b50716a36be14b48b79b26 100644 (file)
@@ -813,8 +813,14 @@ check_device:
 
        /* Check firmware version against what we downloaded. */
        if (priv->firm_version != ((version & 0xf0) << 4 | (version & 0x0f))) {
-               tuner_err("Incorrect readback of firmware version.\n");
-               goto fail;
+               if (!priv->ctrl.read_not_reliable) {
+                       tuner_err("Incorrect readback of firmware version.\n");
+                       goto fail;
+               } else {
+                       tuner_err("Returned an incorrect version. However, "
+                                 "read is not reliable enough. Ignoring it.\n");
+                       hwmodel = 3028;
+               }
        }
 
        /* Check that the tuner hardware model remains consistent over time. */
index e116071810e053099d8140637aeb70f76479228d..9778c96a5006b03f88b5659c2b043c3024f9698f 100644 (file)
@@ -40,6 +40,7 @@ struct xc2028_ctrl {
        unsigned int            vhfbw7:1;
        unsigned int            uhfbw8:1;
        unsigned int            disable_power_mgmt:1;
+       unsigned int            read_not_reliable:1;
        unsigned int            demod;
        enum firmware_type      type:2;
 };
index c0bb3ec35480ddcecbfd176c8418c83b1f878a4f..23f9672d6937f8f3f2a7b1256479cdd6e2bf2986 100644 (file)
@@ -189,6 +189,7 @@ static void tm6000_config_tuner (struct tm6000_core *dev)
                        ctl.fname = "tm6000-xc3028.fw";
 
                ctl.mts   = 1;
+               ctl.read_not_reliable = 1;
 
                xc2028_cfg.tuner = TUNER_XC2028;
                xc2028_cfg.priv  = &ctl;