Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 199954
b: refs/heads/master
c: ea01b11
h: refs/heads/master
v: v3
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Jun 1, 2010
1 parent 96519ce commit 5b94272
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 21 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: 260bb38a21a19edc8a328f3ac8dd45c184d01216
refs/heads/master: ea01b11a07961aabbaec58d572b24f3df4b8065c
37 changes: 17 additions & 20 deletions trunk/drivers/media/video/mt9v011.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,27 +392,25 @@ static int mt9v011_s_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
return 0;
}

static int mt9v011_enum_fmt(struct v4l2_subdev *sd, struct v4l2_fmtdesc *fmt)
static int mt9v011_enum_mbus_fmt(struct v4l2_subdev *sd, unsigned index,
enum v4l2_mbus_pixelcode *code)
{
if (fmt->index > 0)
if (index > 0)
return -EINVAL;

fmt->flags = 0;
strcpy(fmt->description, "8 bpp Bayer GRGR..BGBG");
fmt->pixelformat = V4L2_PIX_FMT_SGRBG8;

*code = V4L2_MBUS_FMT_SGRBG8_1X8;
return 0;
}

static int mt9v011_try_fmt(struct v4l2_subdev *sd, struct v4l2_format *fmt)
static int mt9v011_try_mbus_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *fmt)
{
struct v4l2_pix_format *pix = &fmt->fmt.pix;

if (pix->pixelformat != V4L2_PIX_FMT_SGRBG8)
if (fmt->code != V4L2_MBUS_FMT_SGRBG8_1X8)
return -EINVAL;

v4l_bound_align_image(&pix->width, 48, 639, 1,
&pix->height, 32, 480, 1, 0);
v4l_bound_align_image(&fmt->width, 48, 639, 1,
&fmt->height, 32, 480, 1, 0);
fmt->field = V4L2_FIELD_NONE;
fmt->colorspace = V4L2_COLORSPACE_SRGB;

return 0;
}
Expand Down Expand Up @@ -455,18 +453,17 @@ static int mt9v011_s_parm(struct v4l2_subdev *sd, struct v4l2_streamparm *parms)
return 0;
}

static int mt9v011_s_fmt(struct v4l2_subdev *sd, struct v4l2_format *fmt)
static int mt9v011_s_mbus_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *fmt)
{
struct v4l2_pix_format *pix = &fmt->fmt.pix;
struct mt9v011 *core = to_mt9v011(sd);
int rc;

rc = mt9v011_try_fmt(sd, fmt);
rc = mt9v011_try_mbus_fmt(sd, fmt);
if (rc < 0)
return -EINVAL;

core->width = pix->width;
core->height = pix->height;
core->width = fmt->width;
core->height = fmt->height;

set_res(sd);

Expand Down Expand Up @@ -549,9 +546,9 @@ static const struct v4l2_subdev_core_ops mt9v011_core_ops = {
};

static const struct v4l2_subdev_video_ops mt9v011_video_ops = {
.enum_fmt = mt9v011_enum_fmt,
.try_fmt = mt9v011_try_fmt,
.s_fmt = mt9v011_s_fmt,
.enum_mbus_fmt = mt9v011_enum_mbus_fmt,
.try_mbus_fmt = mt9v011_try_mbus_fmt,
.s_mbus_fmt = mt9v011_s_mbus_fmt,
.g_parm = mt9v011_g_parm,
.s_parm = mt9v011_s_parm,
};
Expand Down

0 comments on commit 5b94272

Please sign in to comment.