MT2050 fixes...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Just downloaded the 20031204 snapshot of video4linux and noticed that the
part number check seems to be in error. Earlier code suggests that during
initialisation of the tuner, the part number is returned at offset 0x13 in
the buffer, but the later code looks at offset 13 (ie. 0x0d) and always
fails. If I change it to 0x13, it works as expected with my MSI TV @nywhere
Master. I've included a patch, below. It also includes code to look for
multiple company codes, as the MSI card returns 0x3cbf for the company code,
rather than 0x4d54, which I assume is for some other card that uses an
MT2050.

Regards,
Brettski :)

--

--- video4linux/tuner.c 2003-12-01 08:04:37.000000000 -0500
+++ video4linux.blg/tuner.c     2003-12-05 22:51:56.125123400 -0500
@@ -721,6 +721,7 @@
        struct tuner *t = i2c_get_clientdata(c);
        char *name;
         unsigned char buf[21];
+        int company_code;

         buf[0] = 0;
        t->tv_freq = NULL;
@@ -739,17 +740,23 @@
                 }
                 printk("\n ");
         }
-        printk("tuner: microtune: companycode=%02x%02x part=%02x
rev=%02x\n",
-              buf[0x11],buf[0x12],buf[0x13],buf[0x14]);
-        if ((buf[0x11] != 0x4d) || (buf[0x12] != 0x54)) {
-               printk("tuner: microtune: unknown companycode\n");
-               return 0;
-       }
+        company_code = buf[0x11] << 8 | buf[0x12];
+        printk("tuner: microtune: companycode=%04x part=%02x rev=%02x\n",
+              company_code,buf[0x13],buf[0x14]);
+
+        switch(company_code) {
+                case 0x4d54:
+                case 0x3cbf:
+                        break;
+                default:
+                        printk("tuner: microtune: unknown companycode\n");
+                        return 0;
+        }

-       if (buf[13] < ARRAY_SIZE(microtune_part) &&
-           NULL != microtune_part[buf[13]])
-               name = microtune_part[buf[13]];
-       switch (buf[13]) {
+       if (buf[0x13] < ARRAY_SIZE(microtune_part) &&
+           NULL != microtune_part[buf[0x13]])
+               name = microtune_part[buf[0x13]];
+       switch (buf[0x13]) {
        case MT2032:
                mt2032_init(c);
                break;




[Index of Archives]     [Linux DVB]     [Video Disk Recorder]     [Asterisk]     [Photo]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Free Photo Albums]     [Fedora Users]     [Fedora Women]     [ALSA Users]     [ALSA Devel]     [Linux USB]

Powered by Linux