From: Guennadi Liakhovetski Date: Wed, 9 May 2012 21:12:28 +0000 (-0300) Subject: [media] V4L: sh_mobile_ceu_camera: don't fail TRY_FMT X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=fec0f72f5f7bceb75234417999a149abe24da347;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [media] V4L: sh_mobile_ceu_camera: don't fail TRY_FMT 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 Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/sh_mobile_ceu_camera.c b/drivers/media/video/sh_mobile_ceu_camera.c index 2ffeb21dfe33..61f7f91de931 100644 --- a/drivers/media/video/sh_mobile_ceu_camera.c +++ b/drivers/media/video/sh_mobile_ceu_camera.c @@ -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 */