Skip to content

Commit

Permalink
V4L/DVB (10616): tw9910: color format check is added on set_fmt
Browse files Browse the repository at this point in the history
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Kuninori Morimoto authored and Mauro Carvalho Chehab committed Mar 30, 2009
1 parent 2c32cc0 commit ac829d6
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions drivers/media/video/tw9910.c
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,19 @@ static int tw9910_set_fmt(struct soc_camera_device *icd, __u32 pixfmt,
struct tw9910_priv *priv = container_of(icd, struct tw9910_priv, icd);
int ret = -EINVAL;
u8 val;
int i;

/*
* check color format
*/
for (i = 0 ; i < ARRAY_SIZE(tw9910_color_fmt) ; i++) {
if (pixfmt == tw9910_color_fmt[i].fourcc) {
ret = 0;
break;
}
}
if (ret < 0)
goto tw9910_set_fmt_error;

/*
* select suitable norm
Expand Down

0 comments on commit ac829d6

Please sign in to comment.