Skip to content

Commit

Permalink
[media] V4L: sh_mobile_ceu_camera: don't fail TRY_FMT
Browse files Browse the repository at this point in the history
VIDIOC_TRY_FMT shouldn't fail if the user requests an unsupported pixel
format. Instead the driver should replace it with a supported one. Fix the
sh_mobile_ceu_camera driver accordingly.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Guennadi Liakhovetski authored and Mauro Carvalho Chehab committed May 15, 2012
1 parent 9633c08 commit fec0f72
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/media/video/sh_mobile_ceu_camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -1858,8 +1858,12 @@ static int sh_mobile_ceu_try_fmt(struct soc_camera_device *icd,

xlate = soc_camera_xlate_by_fourcc(icd, pixfmt);
if (!xlate) {
dev_warn(icd->parent, "Format %x not found\n", pixfmt);
return -EINVAL;
xlate = icd->current_fmt;
dev_dbg(icd->parent, "Format %x not found, keeping %x\n",
pixfmt, xlate->host_fmt->fourcc);
pixfmt = xlate->host_fmt->fourcc;
pix->pixelformat = pixfmt;
pix->colorspace = icd->colorspace;
}

/* FIXME: calculate using depth and bus width */
Expand Down

0 comments on commit fec0f72

Please sign in to comment.