Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 137943
b: refs/heads/master
c: c8329ac
h: refs/heads/master
i:
  137941: 7c1f1de
  137939: b282e85
  137935: 3758088
v: v3
  • Loading branch information
Guennadi Liakhovetski authored and Mauro Carvalho Chehab committed Mar 30, 2009
1 parent e06546f commit 1766d7a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c354b400c0eac1cc0009958754797538857ce640
refs/heads/master: c8329accf7e75a8a8fbe4ad0a15a3eacf221f380
19 changes: 19 additions & 0 deletions trunk/drivers/media/video/sh_mobile_ceu_camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -586,11 +586,29 @@ static int sh_mobile_ceu_get_formats(struct soc_camera_device *icd, int idx,
if (ret < 0)
return 0;

/* Beginning of a pass */
if (!idx)
icd->host_priv = NULL;

switch (icd->formats[idx].fourcc) {
case V4L2_PIX_FMT_UYVY:
case V4L2_PIX_FMT_VYUY:
case V4L2_PIX_FMT_YUYV:
case V4L2_PIX_FMT_YVYU:
if (icd->host_priv)
goto add_single_format;

/*
* Our case is simple so far: for any of the above four camera
* formats we add all our four synthesized NV* formats, so,
* just marking the device with a single flag suffices. If
* the format generation rules are more complex, you would have
* to actually hang your already added / counted formats onto
* the host_priv pointer and check whether the format you're
* going to add now is already there.
*/
icd->host_priv = (void *)sh_mobile_ceu_formats;

n = ARRAY_SIZE(sh_mobile_ceu_formats);
formats += n;
for (k = 0; xlate && k < n; k++) {
Expand All @@ -603,6 +621,7 @@ static int sh_mobile_ceu_get_formats(struct soc_camera_device *icd, int idx,
icd->formats[idx].name);
}
default:
add_single_format:
/* Generic pass-through */
formats++;
if (xlate) {
Expand Down

0 comments on commit 1766d7a

Please sign in to comment.