Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 124561
b: refs/heads/master
c: 06daa1a
h: refs/heads/master
i:
  124559: 8dd1fba
v: v3
  • Loading branch information
Guennadi Liakhovetski authored and Mauro Carvalho Chehab committed Dec 30, 2008
1 parent 6bba390 commit 4a21dde
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ccab8a29040b4b57a45f2150c9b6e6115ebdbc44
refs/heads/master: 06daa1af4d207e93c9a8a3e54adef8635ba81c94
10 changes: 10 additions & 0 deletions trunk/drivers/media/video/pxa_camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -1215,6 +1215,7 @@ static int pxa_camera_try_fmt(struct soc_camera_device *icd,
const struct soc_camera_format_xlate *xlate;
struct v4l2_pix_format *pix = &f->fmt.pix;
__u32 pixfmt = pix->pixelformat;
enum v4l2_field field;
int ret;

xlate = soc_camera_xlate_by_fourcc(icd, pixfmt);
Expand Down Expand Up @@ -1244,6 +1245,15 @@ static int pxa_camera_try_fmt(struct soc_camera_device *icd,
ret = icd->ops->try_fmt(icd, f);
pix->pixelformat = xlate->host_fmt->fourcc;

field = pix->field;

if (field == V4L2_FIELD_ANY) {
pix->field = V4L2_FIELD_NONE;
} else if (field != V4L2_FIELD_NONE) {
dev_err(&icd->dev, "Field type %d unsupported.\n", field);
return -EINVAL;
}

return ret;
}

Expand Down
19 changes: 1 addition & 18 deletions trunk/drivers/media/video/soc_camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,28 +98,11 @@ static int soc_camera_try_fmt_vid_cap(struct file *file, void *priv,
struct soc_camera_file *icf = file->private_data;
struct soc_camera_device *icd = icf->icd;
struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
enum v4l2_field field;
int ret;

WARN_ON(priv != file->private_data);

/*
* TODO: this might also have to migrate to host-drivers, if anyone
* wishes to support other fields
*/
field = f->fmt.pix.field;

if (field == V4L2_FIELD_ANY) {
f->fmt.pix.field = V4L2_FIELD_NONE;
} else if (field != V4L2_FIELD_NONE) {
dev_err(&icd->dev, "Field type invalid.\n");
return -EINVAL;
}

/* limit format to hardware capabilities */
ret = ici->ops->try_fmt(icd, f);

return ret;
return ici->ops->try_fmt(icd, f);
}

static int soc_camera_enum_input(struct file *file, void *priv,
Expand Down

0 comments on commit 4a21dde

Please sign in to comment.