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

V4L/DVB (10663): soc-camera: fix S_CROP breakage on PXA and SuperH

Recent format-negotiation patches caused S_CROP breakage in pxa_camera.c
and sh_mobile_ceu_camera.c drivers, fix it.
Signed-off-by: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 7662b00c
...@@ -1155,23 +1155,23 @@ static int pxa_camera_set_fmt(struct soc_camera_device *icd, ...@@ -1155,23 +1155,23 @@ static int pxa_camera_set_fmt(struct soc_camera_device *icd,
{ {
struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
struct pxa_camera_dev *pcdev = ici->priv; struct pxa_camera_dev *pcdev = ici->priv;
const struct soc_camera_data_format *host_fmt, *cam_fmt = NULL; const struct soc_camera_data_format *cam_fmt = NULL;
const struct soc_camera_format_xlate *xlate; const struct soc_camera_format_xlate *xlate = NULL;
struct soc_camera_sense sense = { struct soc_camera_sense sense = {
.master_clock = pcdev->mclk, .master_clock = pcdev->mclk,
.pixel_clock_max = pcdev->ciclk / 4, .pixel_clock_max = pcdev->ciclk / 4,
}; };
int ret, buswidth; int ret;
if (pixfmt) {
xlate = soc_camera_xlate_by_fourcc(icd, pixfmt); xlate = soc_camera_xlate_by_fourcc(icd, pixfmt);
if (!xlate) { if (!xlate) {
dev_warn(&ici->dev, "Format %x not found\n", pixfmt); dev_warn(&ici->dev, "Format %x not found\n", pixfmt);
return -EINVAL; return -EINVAL;
} }
buswidth = xlate->buswidth;
host_fmt = xlate->host_fmt;
cam_fmt = xlate->cam_fmt; cam_fmt = xlate->cam_fmt;
}
/* If PCLK is used to latch data from the sensor, check sense */ /* If PCLK is used to latch data from the sensor, check sense */
if (pcdev->platform_flags & PXA_CAMERA_PCLK_EN) if (pcdev->platform_flags & PXA_CAMERA_PCLK_EN)
...@@ -1201,8 +1201,8 @@ static int pxa_camera_set_fmt(struct soc_camera_device *icd, ...@@ -1201,8 +1201,8 @@ static int pxa_camera_set_fmt(struct soc_camera_device *icd,
} }
if (pixfmt && !ret) { if (pixfmt && !ret) {
icd->buswidth = buswidth; icd->buswidth = xlate->buswidth;
icd->current_fmt = host_fmt; icd->current_fmt = xlate->host_fmt;
} }
return ret; return ret;
......
...@@ -603,21 +603,18 @@ static int sh_mobile_ceu_set_fmt(struct soc_camera_device *icd, ...@@ -603,21 +603,18 @@ static int sh_mobile_ceu_set_fmt(struct soc_camera_device *icd,
const struct soc_camera_format_xlate *xlate; const struct soc_camera_format_xlate *xlate;
int ret; int ret;
if (!pixfmt)
return icd->ops->set_fmt(icd, pixfmt, rect);
xlate = soc_camera_xlate_by_fourcc(icd, pixfmt); xlate = soc_camera_xlate_by_fourcc(icd, pixfmt);
if (!xlate) { if (!xlate) {
dev_warn(&ici->dev, "Format %x not found\n", pixfmt); dev_warn(&ici->dev, "Format %x not found\n", pixfmt);
return -EINVAL; return -EINVAL;
} }
switch (pixfmt) {
case 0: /* Only geometry change */
ret = icd->ops->set_fmt(icd, pixfmt, rect);
break;
default:
ret = icd->ops->set_fmt(icd, xlate->cam_fmt->fourcc, rect); ret = icd->ops->set_fmt(icd, xlate->cam_fmt->fourcc, rect);
}
if (pixfmt && !ret) { if (!ret) {
icd->buswidth = xlate->buswidth; icd->buswidth = xlate->buswidth;
icd->current_fmt = xlate->host_fmt; icd->current_fmt = xlate->host_fmt;
pcdev->camera_fmt = xlate->cam_fmt; pcdev->camera_fmt = xlate->cam_fmt;
......
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