aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2009-03-13 05:08:20 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-03-30 11:43:21 -0400
commite802967c7079d2b4cfbd107dc90812605dbcad5a (patch)
tree1e0a4d7c5a8ad1b7220b0d9d280c6cac389a1ce4
parentdf2ed07025fc83f3b36470cf06d1816a5e07c90b (diff)
V4L/DVB (11026): sh-mobile-ceu-camera: set field to the value, configured at open()
For the case, that we have to capture with a default format, i.e., when the user doesn't call S_FMT, we have to use the field value according to the default, configured at open() time. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/video/sh_mobile_ceu_camera.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/media/video/sh_mobile_ceu_camera.c b/drivers/media/video/sh_mobile_ceu_camera.c
index 3f71cb809652..55a5eae77bab 100644
--- a/drivers/media/video/sh_mobile_ceu_camera.c
+++ b/drivers/media/video/sh_mobile_ceu_camera.c
@@ -94,7 +94,7 @@ struct sh_mobile_ceu_dev {
94 spinlock_t lock; 94 spinlock_t lock;
95 struct list_head capture; 95 struct list_head capture;
96 struct videobuf_buffer *active; 96 struct videobuf_buffer *active;
97 int is_interlace; 97 int is_interlaced;
98 98
99 struct sh_mobile_ceu_info *pdata; 99 struct sh_mobile_ceu_info *pdata;
100 100
@@ -205,7 +205,7 @@ static void sh_mobile_ceu_capture(struct sh_mobile_ceu_dev *pcdev)
205 205
206 phys_addr_top = videobuf_to_dma_contig(pcdev->active); 206 phys_addr_top = videobuf_to_dma_contig(pcdev->active);
207 ceu_write(pcdev, CDAYR, phys_addr_top); 207 ceu_write(pcdev, CDAYR, phys_addr_top);
208 if (pcdev->is_interlace) { 208 if (pcdev->is_interlaced) {
209 phys_addr_bottom = phys_addr_top + icd->width; 209 phys_addr_bottom = phys_addr_top + icd->width;
210 ceu_write(pcdev, CDBYR, phys_addr_bottom); 210 ceu_write(pcdev, CDBYR, phys_addr_bottom);
211 } 211 }
@@ -217,7 +217,7 @@ static void sh_mobile_ceu_capture(struct sh_mobile_ceu_dev *pcdev)
217 case V4L2_PIX_FMT_NV61: 217 case V4L2_PIX_FMT_NV61:
218 phys_addr_top += icd->width * icd->height; 218 phys_addr_top += icd->width * icd->height;
219 ceu_write(pcdev, CDACR, phys_addr_top); 219 ceu_write(pcdev, CDACR, phys_addr_top);
220 if (pcdev->is_interlace) { 220 if (pcdev->is_interlaced) {
221 phys_addr_bottom = phys_addr_top + icd->width; 221 phys_addr_bottom = phys_addr_top + icd->width;
222 ceu_write(pcdev, CDBCR, phys_addr_bottom); 222 ceu_write(pcdev, CDBCR, phys_addr_bottom);
223 } 223 }
@@ -481,7 +481,7 @@ static int sh_mobile_ceu_set_bus_param(struct soc_camera_device *icd,
481 ceu_write(pcdev, CAMCR, value); 481 ceu_write(pcdev, CAMCR, value);
482 482
483 ceu_write(pcdev, CAPCR, 0x00300000); 483 ceu_write(pcdev, CAPCR, 0x00300000);
484 ceu_write(pcdev, CAIFR, (pcdev->is_interlace) ? 0x101 : 0); 484 ceu_write(pcdev, CAIFR, pcdev->is_interlaced ? 0x101 : 0);
485 485
486 mdelay(1); 486 mdelay(1);
487 487
@@ -497,7 +497,7 @@ static int sh_mobile_ceu_set_bus_param(struct soc_camera_device *icd,
497 } 497 }
498 498
499 height = icd->height; 499 height = icd->height;
500 if (pcdev->is_interlace) { 500 if (pcdev->is_interlaced) {
501 height /= 2; 501 height /= 2;
502 cdwdr_width *= 2; 502 cdwdr_width *= 2;
503 } 503 }
@@ -711,13 +711,13 @@ static int sh_mobile_ceu_try_fmt(struct soc_camera_device *icd,
711 711
712 switch (f->fmt.pix.field) { 712 switch (f->fmt.pix.field) {
713 case V4L2_FIELD_INTERLACED: 713 case V4L2_FIELD_INTERLACED:
714 pcdev->is_interlace = 1; 714 pcdev->is_interlaced = 1;
715 break; 715 break;
716 case V4L2_FIELD_ANY: 716 case V4L2_FIELD_ANY:
717 f->fmt.pix.field = V4L2_FIELD_NONE; 717 f->fmt.pix.field = V4L2_FIELD_NONE;
718 /* fall-through */ 718 /* fall-through */
719 case V4L2_FIELD_NONE: 719 case V4L2_FIELD_NONE:
720 pcdev->is_interlace = 0; 720 pcdev->is_interlaced = 0;
721 break; 721 break;
722 default: 722 default:
723 ret = -EINVAL; 723 ret = -EINVAL;
@@ -783,7 +783,8 @@ static void sh_mobile_ceu_init_videobuf(struct videobuf_queue *q,
783 &sh_mobile_ceu_videobuf_ops, 783 &sh_mobile_ceu_videobuf_ops,
784 &ici->dev, &pcdev->lock, 784 &ici->dev, &pcdev->lock,
785 V4L2_BUF_TYPE_VIDEO_CAPTURE, 785 V4L2_BUF_TYPE_VIDEO_CAPTURE,
786 V4L2_FIELD_ANY, 786 pcdev->is_interlaced ?
787 V4L2_FIELD_INTERLACED : V4L2_FIELD_NONE,
787 sizeof(struct sh_mobile_ceu_buffer), 788 sizeof(struct sh_mobile_ceu_buffer),
788 icd); 789 icd);
789} 790}