Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 131853
b: refs/heads/master
c: 0ad675e
h: refs/heads/master
i:
  131851: fab038e
v: v3
  • Loading branch information
Guennadi Liakhovetski authored and Mauro Carvalho Chehab committed Feb 27, 2009
1 parent 8aec794 commit ee3aea2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 22 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: 7662b00c378fe638e84a853418cd833303fc050c
refs/heads/master: 0ad675eb4533402fd7b03b25d1d4a0ab7a43ae6d
26 changes: 13 additions & 13 deletions trunk/drivers/media/video/pxa_camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 pxa_camera_dev *pcdev = ici->priv;
const struct soc_camera_data_format *host_fmt, *cam_fmt = NULL;
const struct soc_camera_format_xlate *xlate;
const struct soc_camera_data_format *cam_fmt = NULL;
const struct soc_camera_format_xlate *xlate = NULL;
struct soc_camera_sense sense = {
.master_clock = pcdev->mclk,
.pixel_clock_max = pcdev->ciclk / 4,
};
int ret, buswidth;
int ret;

xlate = soc_camera_xlate_by_fourcc(icd, pixfmt);
if (!xlate) {
dev_warn(&ici->dev, "Format %x not found\n", pixfmt);
return -EINVAL;
}
if (pixfmt) {
xlate = soc_camera_xlate_by_fourcc(icd, pixfmt);
if (!xlate) {
dev_warn(&ici->dev, "Format %x not found\n", pixfmt);
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 (pcdev->platform_flags & PXA_CAMERA_PCLK_EN)
Expand Down Expand Up @@ -1201,8 +1201,8 @@ static int pxa_camera_set_fmt(struct soc_camera_device *icd,
}

if (pixfmt && !ret) {
icd->buswidth = buswidth;
icd->current_fmt = host_fmt;
icd->buswidth = xlate->buswidth;
icd->current_fmt = xlate->host_fmt;
}

return ret;
Expand Down
13 changes: 5 additions & 8 deletions trunk/drivers/media/video/sh_mobile_ceu_camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -603,21 +603,18 @@ static int sh_mobile_ceu_set_fmt(struct soc_camera_device *icd,
const struct soc_camera_format_xlate *xlate;
int ret;

if (!pixfmt)
return icd->ops->set_fmt(icd, pixfmt, rect);

xlate = soc_camera_xlate_by_fourcc(icd, pixfmt);
if (!xlate) {
dev_warn(&ici->dev, "Format %x not found\n", pixfmt);
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->current_fmt = xlate->host_fmt;
pcdev->camera_fmt = xlate->cam_fmt;
Expand Down

0 comments on commit ee3aea2

Please sign in to comment.