I was going to change the FIXME in cx25840-driver.c, when I realized that it was using completely whacked constants when checking the return value of AFD_FMT_STAT. AFD_FMT_STAT is 4 bits, so even the first PAL entry is out of bounds, and only NTSC-M uses the right value. This patch fixes up both cx25840-registers.c and cx25840-driver.c with the proper constants from the data sheet. Yet another change that I don't think will make a difference (since I think most people force the standard), but is more accurate :)

Index: driver/cx25840-driver.c
===================================================================
--- driver/cx25840-driver.c     (revision 287)
+++ driver/cx25840-driver.c     (working copy)
@@ -180,18 +180,18 @@
 
         switch (cx25840_read_setting(client, AFD_FMT_STAT)) {
         case 0x0001:    // NTSC-M
-        case 0x0008:    // NTSC-J
-        case 0x0009:    // NTSC-4.43
+        case 0x0002:    // NTSC-J
+        case 0x0003:    // NTSC-4.43
                 is_pal = 0;
                 break;
-        case 0x0040:    // PAL-BDGHI
-        case 0x0041:    // PAL-M
-        case 0x0048:    // PAL-N
-        case 0x0049:    // PAL-NC
-        case 0x03e8:    // PAL-60
+        case 0x0004:    // PAL-BDGHI
+        case 0x0005:    // PAL-M
+        case 0x0006:    // PAL-N
+        case 0x0007:    // PAL-NC
+        case 0x0008:    // PAL-60
                 is_pal = 1;
                 break;
-        case 0x044c:    // SECAM
+        case 0x000c:    // SECAM
                 is_pal = 1;
                 break;
        default:
Index: driver/cx25840-registers.c
===================================================================
--- driver/cx25840-registers.c  (revision 287)
+++ driver/cx25840-registers.c  (working copy)
@@ -2262,14 +2262,14 @@
 };
 value_map AFD_FMT_STAT_value_map[] = {
        {0x0001, "NTSC-M"},
-       {0x0008, "NTSC-J"},
-       {0x0009, "NTSC-4.43"},
-       {0x0040, "PAL-BDGHI"},
-       {0x0041, "PAL-M"},
-       {0x0048, "PAL-N"},
-       {0x0049, "PAL-NC"},
-       {0x03e8, "PAL-60"},
-       {0x044c, "SECAM"},
+       {0x0002, "NTSC-J"},
+       {0x0003, "NTSC-4.43"},
+       {0x0004, "PAL-BDGHI"},
+       {0x0005, "PAL-M"},
+       {0x0006, "PAL-N"},
+       {0x0007, "PAL-NC"},
+       {0x0008, "PAL-60"},
+       {0x000c, "SECAM"},
        {0, 0}
 };
 value_map PEAK_SEL_value_map[] = {

Reply via email to