Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 219040
b: refs/heads/master
c: 515d93f
h: refs/heads/master
v: v3
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Oct 21, 2010
1 parent a0c3867 commit 3feae41
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 127 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: 8f56aaa3e65d675b756fac67b8abc8f2acaaf2f2
refs/heads/master: 515d93fb238e201901610bceddedc4027f565d5e
126 changes: 0 additions & 126 deletions trunk/drivers/media/video/tvp7002.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,19 +330,6 @@ static const struct i2c_reg_value tvp7002_parms_720P50[] = {
{ TVP7002_EOR, 0xff, TVP7002_RESERVED }
};

/* Struct list for available formats */
static const struct v4l2_fmtdesc tvp7002_fmt_list[] = {
{
.index = 0,
.type = V4L2_BUF_TYPE_VIDEO_CAPTURE,
.flags = 0,
.description = "8-bit UYVY 4:2:2 Format",
.pixelformat = V4L2_PIX_FMT_UYVY,
},
};

#define NUM_FORMATS ARRAY_SIZE(tvp7002_fmt_list)

/* Preset definition for handling device operation */
struct tvp7002_preset_definition {
u32 preset;
Expand Down Expand Up @@ -439,7 +426,6 @@ struct tvp7002 {
int ver;
int streaming;

struct v4l2_pix_format pix;
const struct tvp7002_preset_definition *current_preset;
u8 gain;
};
Expand Down Expand Up @@ -725,85 +711,6 @@ static int tvp7002_mbus_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *f
return 0;
}

/*
* tvp7002_try_fmt_cap() - V4L2 decoder interface handler for try_fmt
* @sd: pointer to standard V4L2 sub-device structure
* @f: pointer to standard V4L2 VIDIOC_TRY_FMT ioctl structure
*
* Implement the VIDIOC_TRY_FMT ioctl for the CAPTURE buffer type. This
* ioctl is used to negotiate the image capture size and pixel format
* without actually making it take effect.
*/
static int tvp7002_try_fmt_cap(struct v4l2_subdev *sd, struct v4l2_format *f)
{
struct tvp7002 *device = to_tvp7002(sd);
struct v4l2_dv_enum_preset e_preset;
struct v4l2_pix_format *pix;
int error = 0;

pix = &f->fmt.pix;

/* Calculate height and width based on current standard */
error = v4l_fill_dv_preset_info(device->current_preset->preset, &e_preset);
if (error)
return -EINVAL;

pix->width = e_preset.width;
pix->height = e_preset.height;
pix->pixelformat = V4L2_PIX_FMT_UYVY;
pix->field = device->current_preset->scanmode;
pix->bytesperline = pix->width * 2;
pix->sizeimage = pix->bytesperline * pix->height;
pix->colorspace = device->current_preset->color_space;
pix->priv = 0;

v4l2_dbg(1, debug, sd, "Try FMT: pixelformat - %s, bytesperline - %d"
"Width - %d, Height - %d", "8-bit UYVY 4:2:2 Format",
pix->bytesperline, pix->width, pix->height);
return error;
}

/*
* tvp7002_s_fmt() - V4L2 decoder interface handler for s_fmt
* @sd: pointer to standard V4L2 sub-device structure
* @f: pointer to standard V4L2 VIDIOC_S_FMT ioctl structure
*
* If the requested format is supported, configures the HW to use that
* format, returns error code if format not supported or HW can't be
* correctly configured.
*/
static int tvp7002_s_fmt(struct v4l2_subdev *sd, struct v4l2_format *f)
{
struct tvp7002 *decoder = to_tvp7002(sd);
int rval;

rval = tvp7002_try_fmt_cap(sd, f);
if (!rval)
decoder->pix = f->fmt.pix;
return rval;
}

/*
* tvp7002_g_fmt() - V4L2 decoder interface handler for tvp7002_g_fmt
* @sd: pointer to standard V4L2 sub-device structure
* @f: pointer to standard V4L2 v4l2_format structure
*
* Returns the decoder's current pixel format in the v4l2_format
* parameter.
*/
static int tvp7002_g_fmt(struct v4l2_subdev *sd, struct v4l2_format *f)
{
struct tvp7002 *decoder = to_tvp7002(sd);

f->fmt.pix = decoder->pix;

v4l2_dbg(1, debug, sd, "Current FMT: bytesperline - %d"
"Width - %d, Height - %d",
decoder->pix.bytesperline,
decoder->pix.width, decoder->pix.height);
return 0;
}

/*
* tvp7002_query_dv_preset() - query DV preset
* @sd: pointer to standard V4L2 sub-device structure
Expand Down Expand Up @@ -924,25 +831,6 @@ static int tvp7002_s_register(struct v4l2_subdev *sd,
}
#endif

/*
* tvp7002_enum_fmt() - Enum supported formats
* @sd: pointer to standard V4L2 sub-device structure
* @fmtdesc: pointer to format struct
*
* Enumerate supported formats.
*/

static int tvp7002_enum_fmt(struct v4l2_subdev *sd,
struct v4l2_fmtdesc *fmtdesc)
{
/* Check requested format index is within range */
if (fmtdesc->index < 0 || fmtdesc->index >= NUM_FORMATS)
return -EINVAL;
*fmtdesc = tvp7002_fmt_list[fmtdesc->index];

return 0;
}

/*
* tvp7002_enum_mbus_fmt() - Enum supported mediabus formats
* @sd: pointer to standard V4L2 sub-device structure
Expand Down Expand Up @@ -1077,9 +965,6 @@ static const struct v4l2_subdev_video_ops tvp7002_video_ops = {
.s_dv_preset = tvp7002_s_dv_preset,
.query_dv_preset = tvp7002_query_dv_preset,
.s_stream = tvp7002_s_stream,
.g_fmt = tvp7002_g_fmt,
.s_fmt = tvp7002_s_fmt,
.enum_fmt = tvp7002_enum_fmt,
.g_mbus_fmt = tvp7002_mbus_fmt,
.try_mbus_fmt = tvp7002_mbus_fmt,
.s_mbus_fmt = tvp7002_mbus_fmt,
Expand All @@ -1094,17 +979,6 @@ static const struct v4l2_subdev_ops tvp7002_ops = {

static struct tvp7002 tvp7002_dev = {
.streaming = 0,

.pix = {
.width = 1280,
.height = 720,
.pixelformat = V4L2_PIX_FMT_UYVY,
.field = V4L2_FIELD_NONE,
.bytesperline = 1280 * 2,
.sizeimage = 1280 * 2 * 720,
.colorspace = V4L2_COLORSPACE_REC709,
},

.current_preset = tvp7002_presets,
.gain = 0,
};
Expand Down

0 comments on commit 3feae41

Please sign in to comment.