]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
V4L/DVB (6542): Fix S-video mode on tvp5150
authorMauro Carvalho Chehab <mchehab@infradead.org>
Sun, 4 Nov 2007 01:40:24 +0000 (22:40 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Tue, 11 Dec 2007 20:08:03 +0000 (18:08 -0200)
Thanks to Markus Reichberger to point this.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/tvp5150.c

index 25d0aef88ef51392c69e15992cbc0fbcb93414f9..445eba4174d75b3c48b694fcf3dea2e769e9e541 100644 (file)
@@ -290,6 +290,7 @@ static inline void tvp5150_selmux(struct i2c_client *c)
        int opmode=0;
        struct tvp5150 *decoder = i2c_get_clientdata(c);
        int input = 0;
+       unsigned char val;
 
        if ((decoder->route.output & TVP5150_BLACK_SCREEN) || !decoder->enable)
                input = 8;
@@ -315,6 +316,16 @@ static inline void tvp5150_selmux(struct i2c_client *c)
 
        tvp5150_write(c, TVP5150_OP_MODE_CTL, opmode);
        tvp5150_write(c, TVP5150_VD_IN_SRC_SEL_1, input);
+
+       /* Svideo should enable YCrCb output and disable GPCL output
+        * For Composite and TV, it should be the reverse
+        */
+       val = tvp5150_read(c, TVP5150_MISC_CTL);
+       if (decoder->route.input == TVP5150_SVIDEO)
+               val = (val & ~0x40) | 0x10;
+       else
+               val = (val & ~0x10) | 0x40;
+       tvp5150_write(c, TVP5150_MISC_CTL, val);
 };
 
 struct i2c_reg_value {