Commit e802967c authored by Guennadi Liakhovetski's avatar Guennadi Liakhovetski Committed by Mauro Carvalho Chehab

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: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent df2ed070
...@@ -94,7 +94,7 @@ struct sh_mobile_ceu_dev { ...@@ -94,7 +94,7 @@ struct sh_mobile_ceu_dev {
spinlock_t lock; spinlock_t lock;
struct list_head capture; struct list_head capture;
struct videobuf_buffer *active; struct videobuf_buffer *active;
int is_interlace; int is_interlaced;
struct sh_mobile_ceu_info *pdata; struct sh_mobile_ceu_info *pdata;
...@@ -205,7 +205,7 @@ static void sh_mobile_ceu_capture(struct sh_mobile_ceu_dev *pcdev) ...@@ -205,7 +205,7 @@ static void sh_mobile_ceu_capture(struct sh_mobile_ceu_dev *pcdev)
phys_addr_top = videobuf_to_dma_contig(pcdev->active); phys_addr_top = videobuf_to_dma_contig(pcdev->active);
ceu_write(pcdev, CDAYR, phys_addr_top); ceu_write(pcdev, CDAYR, phys_addr_top);
if (pcdev->is_interlace) { if (pcdev->is_interlaced) {
phys_addr_bottom = phys_addr_top + icd->width; phys_addr_bottom = phys_addr_top + icd->width;
ceu_write(pcdev, CDBYR, phys_addr_bottom); ceu_write(pcdev, CDBYR, phys_addr_bottom);
} }
...@@ -217,7 +217,7 @@ static void sh_mobile_ceu_capture(struct sh_mobile_ceu_dev *pcdev) ...@@ -217,7 +217,7 @@ static void sh_mobile_ceu_capture(struct sh_mobile_ceu_dev *pcdev)
case V4L2_PIX_FMT_NV61: case V4L2_PIX_FMT_NV61:
phys_addr_top += icd->width * icd->height; phys_addr_top += icd->width * icd->height;
ceu_write(pcdev, CDACR, phys_addr_top); ceu_write(pcdev, CDACR, phys_addr_top);
if (pcdev->is_interlace) { if (pcdev->is_interlaced) {
phys_addr_bottom = phys_addr_top + icd->width; phys_addr_bottom = phys_addr_top + icd->width;
ceu_write(pcdev, CDBCR, phys_addr_bottom); ceu_write(pcdev, CDBCR, phys_addr_bottom);
} }
...@@ -481,7 +481,7 @@ static int sh_mobile_ceu_set_bus_param(struct soc_camera_device *icd, ...@@ -481,7 +481,7 @@ static int sh_mobile_ceu_set_bus_param(struct soc_camera_device *icd,
ceu_write(pcdev, CAMCR, value); ceu_write(pcdev, CAMCR, value);
ceu_write(pcdev, CAPCR, 0x00300000); ceu_write(pcdev, CAPCR, 0x00300000);
ceu_write(pcdev, CAIFR, (pcdev->is_interlace) ? 0x101 : 0); ceu_write(pcdev, CAIFR, pcdev->is_interlaced ? 0x101 : 0);
mdelay(1); mdelay(1);
...@@ -497,7 +497,7 @@ static int sh_mobile_ceu_set_bus_param(struct soc_camera_device *icd, ...@@ -497,7 +497,7 @@ static int sh_mobile_ceu_set_bus_param(struct soc_camera_device *icd,
} }
height = icd->height; height = icd->height;
if (pcdev->is_interlace) { if (pcdev->is_interlaced) {
height /= 2; height /= 2;
cdwdr_width *= 2; cdwdr_width *= 2;
} }
...@@ -711,13 +711,13 @@ static int sh_mobile_ceu_try_fmt(struct soc_camera_device *icd, ...@@ -711,13 +711,13 @@ static int sh_mobile_ceu_try_fmt(struct soc_camera_device *icd,
switch (f->fmt.pix.field) { switch (f->fmt.pix.field) {
case V4L2_FIELD_INTERLACED: case V4L2_FIELD_INTERLACED:
pcdev->is_interlace = 1; pcdev->is_interlaced = 1;
break; break;
case V4L2_FIELD_ANY: case V4L2_FIELD_ANY:
f->fmt.pix.field = V4L2_FIELD_NONE; f->fmt.pix.field = V4L2_FIELD_NONE;
/* fall-through */ /* fall-through */
case V4L2_FIELD_NONE: case V4L2_FIELD_NONE:
pcdev->is_interlace = 0; pcdev->is_interlaced = 0;
break; break;
default: default:
ret = -EINVAL; ret = -EINVAL;
...@@ -783,7 +783,8 @@ static void sh_mobile_ceu_init_videobuf(struct videobuf_queue *q, ...@@ -783,7 +783,8 @@ static void sh_mobile_ceu_init_videobuf(struct videobuf_queue *q,
&sh_mobile_ceu_videobuf_ops, &sh_mobile_ceu_videobuf_ops,
&ici->dev, &pcdev->lock, &ici->dev, &pcdev->lock,
V4L2_BUF_TYPE_VIDEO_CAPTURE, V4L2_BUF_TYPE_VIDEO_CAPTURE,
V4L2_FIELD_ANY, pcdev->is_interlaced ?
V4L2_FIELD_INTERLACED : V4L2_FIELD_NONE,
sizeof(struct sh_mobile_ceu_buffer), sizeof(struct sh_mobile_ceu_buffer),
icd); icd);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment