diff options
author | Magnus Damm <damm@igel.co.jp> | 2008-12-18 10:45:33 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-12-30 06:40:23 -0500 |
commit | 9e4a56d27f6150b0c9f8c7cc33ea944749377104 (patch) | |
tree | 1202b85092fd3afbe056a057aaeca3f9894ffe25 /drivers/media | |
parent | 8be65dc59645d6ec9149fc26dfff7ca01e279e87 (diff) |
V4L/DVB (10085): sh_mobile_ceu: add NV16 and NV61 support
This patch adds NV16/NV61 support to the sh_mobile_ceu driver.
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/sh_mobile_ceu_camera.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/drivers/media/video/sh_mobile_ceu_camera.c b/drivers/media/video/sh_mobile_ceu_camera.c index 31a0a9769a3f..7d1a84426413 100644 --- a/drivers/media/video/sh_mobile_ceu_camera.c +++ b/drivers/media/video/sh_mobile_ceu_camera.c | |||
@@ -177,6 +177,8 @@ static void sh_mobile_ceu_capture(struct sh_mobile_ceu_dev *pcdev) | |||
177 | switch (icd->current_fmt->fourcc) { | 177 | switch (icd->current_fmt->fourcc) { |
178 | case V4L2_PIX_FMT_NV12: | 178 | case V4L2_PIX_FMT_NV12: |
179 | case V4L2_PIX_FMT_NV21: | 179 | case V4L2_PIX_FMT_NV21: |
180 | case V4L2_PIX_FMT_NV16: | ||
181 | case V4L2_PIX_FMT_NV61: | ||
180 | phys_addr += (icd->width * icd->height); | 182 | phys_addr += (icd->width * icd->height); |
181 | ceu_write(pcdev, CDACR, phys_addr); | 183 | ceu_write(pcdev, CDACR, phys_addr); |
182 | } | 184 | } |
@@ -407,6 +409,9 @@ static int sh_mobile_ceu_set_bus_param(struct soc_camera_device *icd, | |||
407 | case V4L2_PIX_FMT_NV12: | 409 | case V4L2_PIX_FMT_NV12: |
408 | case V4L2_PIX_FMT_NV21: | 410 | case V4L2_PIX_FMT_NV21: |
409 | yuv_lineskip = 1; /* skip for NV12/21, no skip for NV16/61 */ | 411 | yuv_lineskip = 1; /* skip for NV12/21, no skip for NV16/61 */ |
412 | /* fall-through */ | ||
413 | case V4L2_PIX_FMT_NV16: | ||
414 | case V4L2_PIX_FMT_NV61: | ||
410 | yuv_mode = 1; | 415 | yuv_mode = 1; |
411 | switch (pcdev->camera_fmt->fourcc) { | 416 | switch (pcdev->camera_fmt->fourcc) { |
412 | case V4L2_PIX_FMT_UYVY: | 417 | case V4L2_PIX_FMT_UYVY: |
@@ -426,8 +431,9 @@ static int sh_mobile_ceu_set_bus_param(struct soc_camera_device *icd, | |||
426 | } | 431 | } |
427 | } | 432 | } |
428 | 433 | ||
429 | if (icd->current_fmt->fourcc == V4L2_PIX_FMT_NV21) | 434 | if ((icd->current_fmt->fourcc == V4L2_PIX_FMT_NV21) || |
430 | value ^= 0x00000100; /* swap U, V to change from NV12->NV21 */ | 435 | (icd->current_fmt->fourcc == V4L2_PIX_FMT_NV61)) |
436 | value ^= 0x00000100; /* swap U, V to change from NV1x->NVx1 */ | ||
431 | 437 | ||
432 | value |= (common_flags & SOCAM_VSYNC_ACTIVE_LOW) ? (1 << 1) : 0; | 438 | value |= (common_flags & SOCAM_VSYNC_ACTIVE_LOW) ? (1 << 1) : 0; |
433 | value |= (common_flags & SOCAM_HSYNC_ACTIVE_LOW) ? (1 << 0) : 0; | 439 | value |= (common_flags & SOCAM_HSYNC_ACTIVE_LOW) ? (1 << 0) : 0; |
@@ -509,6 +515,18 @@ static const struct soc_camera_data_format sh_mobile_ceu_formats[] = { | |||
509 | .fourcc = V4L2_PIX_FMT_NV21, | 515 | .fourcc = V4L2_PIX_FMT_NV21, |
510 | .colorspace = V4L2_COLORSPACE_JPEG, | 516 | .colorspace = V4L2_COLORSPACE_JPEG, |
511 | }, | 517 | }, |
518 | { | ||
519 | .name = "NV16", | ||
520 | .depth = 16, | ||
521 | .fourcc = V4L2_PIX_FMT_NV16, | ||
522 | .colorspace = V4L2_COLORSPACE_JPEG, | ||
523 | }, | ||
524 | { | ||
525 | .name = "NV61", | ||
526 | .depth = 16, | ||
527 | .fourcc = V4L2_PIX_FMT_NV61, | ||
528 | .colorspace = V4L2_COLORSPACE_JPEG, | ||
529 | }, | ||
512 | }; | 530 | }; |
513 | 531 | ||
514 | static int sh_mobile_ceu_get_formats(struct soc_camera_device *icd, int idx, | 532 | static int sh_mobile_ceu_get_formats(struct soc_camera_device *icd, int idx, |