fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / drivers / media / video / cx25840 / cx25840-vbi.c
index 6cc8bf2..ced13fe 100644 (file)
@@ -111,6 +111,10 @@ void cx25840_vbi_setup(struct i2c_client *client)
                        uv_lpf=0;
                        comb=0;
                        sc=0x0a425f;
+               } else if (std == V4L2_STD_PAL_Nc) {
+                       uv_lpf=1;
+                       comb=0x20;
+                       sc=556453;
                } else {
                        uv_lpf=1;
                        comb=0x20;
@@ -124,7 +128,14 @@ void cx25840_vbi_setup(struct i2c_client *client)
                uv_lpf=1;
 
                src_decimation=0x21f;
-               if (std == V4L2_STD_PAL_M) {
+               if (std == V4L2_STD_PAL_60) {
+                       vblank=26;
+                       vblank656=26;
+                       burst=0x5b;
+                       luma_lpf=2;
+                       comb=0x20;
+                       sc=0x0a8263;
+               } else if (std == V4L2_STD_PAL_M) {
                        vblank=20;
                        vblank656=24;
                        burst=0x61;
@@ -231,6 +242,7 @@ int cx25840_vbi(struct i2c_client *client, unsigned int cmd, void *arg)
                        0, 0, V4L2_SLICED_VPS, 0, 0,    /* 9 */
                        0, 0, 0, 0
                };
+               int is_pal = !(cx25840_get_v4lstd(client) & V4L2_STD_525_60);
                int i;
 
                fmt = arg;
@@ -242,13 +254,25 @@ int cx25840_vbi(struct i2c_client *client, unsigned int cmd, void *arg)
                if ((cx25840_read(client, 0x404) & 0x10) == 0)
                        break;
 
-               for (i = 7; i <= 23; i++) {
-                       u8 v = cx25840_read(client, 0x424 + i - 7);
+               if (is_pal) {
+                       for (i = 7; i <= 23; i++) {
+                               u8 v = cx25840_read(client, 0x424 + i - 7);
 
-                       svbi->service_lines[0][i] = lcr2vbi[v >> 4];
-                       svbi->service_lines[1][i] = lcr2vbi[v & 0xf];
-                       svbi->service_set |=
-                                svbi->service_lines[0][i] | svbi->service_lines[1][i];
+                               svbi->service_lines[0][i] = lcr2vbi[v >> 4];
+                               svbi->service_lines[1][i] = lcr2vbi[v & 0xf];
+                               svbi->service_set |=
+                                       svbi->service_lines[0][i] | svbi->service_lines[1][i];
+                       }
+               }
+               else {
+                       for (i = 10; i <= 21; i++) {
+                               u8 v = cx25840_read(client, 0x424 + i - 10);
+
+                               svbi->service_lines[0][i] = lcr2vbi[v >> 4];
+                               svbi->service_lines[1][i] = lcr2vbi[v & 0xf];
+                               svbi->service_set |=
+                                       svbi->service_lines[0][i] | svbi->service_lines[1][i];
+                       }
                }
                break;
        }