V4L/DVB (12838): tm6000: Fix color support on tm6010
authorMauro Carvalho Chehab <mchehab@redhat.com>
Sat, 25 Oct 2008 11:56:16 +0000 (08:56 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 18 May 2010 03:40:16 +0000 (00:40 -0300)
TM6010 uses some different registers for format support.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/staging/tm6000/tm6000-core.c

index 179885a193e6e26336f4f414d897bd333e374c7b..c4e1aeb0195bcd35786054430056af355a69b940 100644 (file)
@@ -140,12 +140,16 @@ int tm6000_get_reg16 (struct tm6000_core *dev, u8 req, u16 value, u16 index)
 
 void tm6000_set_fourcc_format(struct tm6000_core *dev)
 {
-       if (dev->fourcc==V4L2_PIX_FMT_UYVY) {
-               /* Sets driver to UYUV */
-               tm6000_set_reg (dev, REQ_07_SET_GET_AVREG, 0xc1, 0xd0);
+       if (dev->dev_type == TM6010) {
+               if (dev->fourcc == V4L2_PIX_FMT_UYVY)
+                       tm6000_set_reg (dev, REQ_07_SET_GET_AVREG, 0xc1, 0xfc);
+               else
+                       tm6000_set_reg (dev, REQ_07_SET_GET_AVREG, 0xc1, 0xfd);
        } else {
-               /* Sets driver to YUV2 */
-               tm6000_set_reg (dev, REQ_07_SET_GET_AVREG, 0xc1, 0x90);
+               if (dev->fourcc == V4L2_PIX_FMT_UYVY)
+                       tm6000_set_reg (dev, REQ_07_SET_GET_AVREG, 0xc1, 0xd0);
+               else
+                       tm6000_set_reg (dev, REQ_07_SET_GET_AVREG, 0xc1, 0x90);
        }
 }