Chris Kennedy wrote:
Merging them would be fine, or separate, either one works, I'll wait
for both till I include them so either way.
I've attached the merged version.
Have I mentioned how easy you make it to work on this project? So many
other open source projects I've got to chase revisions, constantly
merging and resolving conflicts before I can get my code in trunc.
Thanks for all your work!
Index: driver/cx25840-driver.c
===================================================================
--- driver/cx25840-driver.c (revision 287)
+++ driver/cx25840-driver.c (working copy)
@@ -165,6 +165,7 @@
{
struct decoder_state *state = i2c_get_clientdata(client);
int is_pal;
+ int is_secam = 0;
switch (state->norm) {
case VIDEO_MODE_NTSC:
@@ -175,24 +176,26 @@
break;
case VIDEO_MODE_SECAM:
is_pal = 1;
+ is_secam = 1;
break;
default:
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;
+ is_secam = 1;
break;
default:
is_pal = 1;
@@ -201,28 +204,33 @@
break;
}
-/* FIXME needs to be translated into code */
-/*
-nonNTSC, if (x & 0xff000)
-0x474 write4 0x28244024
-0x478 write4 0x0080021f (there's also and & and | of 2 unknown values
-against this number as well)
-0x470 write4 0x5d2d0084
-0x47c write4 0x010a425f
+ if (is_pal) {
+ cx25840_write(client, 0x0470, 0x84);
+ cx25840_write(client, 0x0471, 0x00);
+ cx25840_write(client, 0x0472, 0x2d);
+ cx25840_write(client, 0x0473, 0x5d);
-nonNTSC, else
-0x474 write4 0x28244024
-0x478 write4 0x2090021f (there's also and & and | of 2 unknown values
-against this number as well)
-0x470 write4 0x5d2d0084
-0x47c write4 0x010a8263
-*/
- if (is_pal) {
cx25840_write(client, 0x0474, 0x24);
cx25840_write(client, 0x0475, 0x40);
cx25840_write(client, 0x0476, 0x24);
cx25840_write(client, 0x0477, 0x28);
+ cx25840_write(client, 0x0478, 0x1f);
+ cx25840_write(client, 0x0479, 0x02);
+
+ if (is_secam) {
+ cx25840_write(client, 0x047a, 0x80);
+ cx25840_write(client, 0x047b, 0x00);
+ cx25840_write(client, 0x047c, 0x5f);
+ cx25840_write(client, 0x047d, 0xa4);
+ } else {
+ cx25840_write(client, 0x047a, 0x90);
+ cx25840_write(client, 0x047b, 0x20);
+ cx25840_write(client, 0x047c, 0x63);
+ cx25840_write(client, 0x047d, 0x82);
+ }
+
+ cx25840_write(client, 0x047d, 0x0a);
cx25840_write(client, 0x047f, 0x01);
} else {
cx25840_write(client, 0x0470, 0x7a);
@@ -632,18 +640,18 @@
default:
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
res |= DECODER_STATUS_NTSC;
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
res |= DECODER_STATUS_PAL;
break;
- case 0x044c: // SECAM
+ case 0x000c: // SECAM
res |= DECODER_STATUS_SECAM;
break;
}
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[] = {