aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/zoran_device.c
diff options
context:
space:
mode:
authorTrent Piepho <xyzzy@speakeasy.org>2007-07-17 17:29:44 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-07-30 15:26:26 -0400
commit603d6f2c8f9f3604f9c6c1f8903efc2df30a000f (patch)
tree4391bd4db78094e118b2d4da08c115b4f5638ae0 /drivers/media/video/zoran_device.c
parentbb2e033913f14b2f9f6745e206c3ea5df481b4fd (diff)
V4L/DVB (5890): zr36067: Add UYVY, RGB555X, RGB565X, and RGB32 formats
Add support for the UYVY and the other big endian output formats. The driver was naming formats based on the host endianess. This is different that all the other drivers appear to work and not what software appears to expect. Use ARRAY_SIZE() to find the the size of the zoran_formats array. Change the way the driver handles setting the video format register. Rather than use some if and switch statements to set to register by looking at the format id, the format list simply has a field with the proper bits to set. Adds a bit of ifdef to make a driver without V4L1 support more possible. Also create a macro for defining formats that handles vl41 and/or vl42 support to avoid repeated ifdefs in the format list. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org> Acked-by: Ronald S. Bultje <rbultje@ronald.bitfreak.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/zoran_device.c')
-rw-r--r--drivers/media/video/zoran_device.c33
1 files changed, 1 insertions, 32 deletions
diff --git a/drivers/media/video/zoran_device.c b/drivers/media/video/zoran_device.c
index b0752767ee4f..d9640ec4b9b0 100644
--- a/drivers/media/video/zoran_device.c
+++ b/drivers/media/video/zoran_device.c
@@ -429,8 +429,6 @@ zr36057_set_vfe (struct zoran *zr,
429 reg |= (HorDcm << ZR36057_VFESPFR_HorDcm); 429 reg |= (HorDcm << ZR36057_VFESPFR_HorDcm);
430 reg |= (VerDcm << ZR36057_VFESPFR_VerDcm); 430 reg |= (VerDcm << ZR36057_VFESPFR_VerDcm);
431 reg |= (DispMode << ZR36057_VFESPFR_DispMode); 431 reg |= (DispMode << ZR36057_VFESPFR_DispMode);
432 if (format->palette != VIDEO_PALETTE_YUV422 && format->palette != VIDEO_PALETTE_YUYV)
433 reg |= ZR36057_VFESPFR_LittleEndian;
434 /* RJ: I don't know, why the following has to be the opposite 432 /* RJ: I don't know, why the following has to be the opposite
435 * of the corresponding ZR36060 setting, but only this way 433 * of the corresponding ZR36060 setting, but only this way
436 * we get the correct colors when uncompressing to the screen */ 434 * we get the correct colors when uncompressing to the screen */
@@ -439,36 +437,6 @@ zr36057_set_vfe (struct zoran *zr,
439 if (zr->norm != VIDEO_MODE_NTSC) 437 if (zr->norm != VIDEO_MODE_NTSC)
440 reg |= ZR36057_VFESPFR_ExtFl; // NEEDED!!!!!!! Wolfgang 438 reg |= ZR36057_VFESPFR_ExtFl; // NEEDED!!!!!!! Wolfgang
441 reg |= ZR36057_VFESPFR_TopField; 439 reg |= ZR36057_VFESPFR_TopField;
442 switch (format->palette) {
443
444 case VIDEO_PALETTE_YUYV:
445 case VIDEO_PALETTE_YUV422:
446 reg |= ZR36057_VFESPFR_YUV422;
447 break;
448
449 case VIDEO_PALETTE_RGB555:
450 reg |= ZR36057_VFESPFR_RGB555 | ZR36057_VFESPFR_ErrDif;
451 break;
452
453 case VIDEO_PALETTE_RGB565:
454 reg |= ZR36057_VFESPFR_RGB565 | ZR36057_VFESPFR_ErrDif;
455 break;
456
457 case VIDEO_PALETTE_RGB24:
458 reg |= ZR36057_VFESPFR_RGB888 | ZR36057_VFESPFR_Pack24;
459 break;
460
461 case VIDEO_PALETTE_RGB32:
462 reg |= ZR36057_VFESPFR_RGB888;
463 break;
464
465 default:
466 dprintk(1,
467 KERN_INFO "%s: set_vfe() - unknown color_fmt=%x\n",
468 ZR_DEVNAME(zr), format->palette);
469 return;
470
471 }
472 if (HorDcm >= 48) { 440 if (HorDcm >= 48) {
473 reg |= 3 << ZR36057_VFESPFR_HFilter; /* 5 tap filter */ 441 reg |= 3 << ZR36057_VFESPFR_HFilter; /* 5 tap filter */
474 } else if (HorDcm >= 32) { 442 } else if (HorDcm >= 32) {
@@ -476,6 +444,7 @@ zr36057_set_vfe (struct zoran *zr,
476 } else if (HorDcm >= 16) { 444 } else if (HorDcm >= 16) {
477 reg |= 1 << ZR36057_VFESPFR_HFilter; /* 3 tap filter */ 445 reg |= 1 << ZR36057_VFESPFR_HFilter; /* 3 tap filter */
478 } 446 }
447 reg |= format->vfespfr;
479 btwrite(reg, ZR36057_VFESPFR); 448 btwrite(reg, ZR36057_VFESPFR);
480 449
481 /* display configuration */ 450 /* display configuration */