Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 193116
b: refs/heads/master
c: d37dad4
h: refs/heads/master
v: v3
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed May 19, 2010
1 parent ab33e54 commit 1380df2
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 26 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: 1dbf85397a686488b4be412af1cc069ae63a5ecc
refs/heads/master: d37dad497c77149e99cb3f4086cfc3b8d8150135
66 changes: 41 additions & 25 deletions trunk/drivers/media/video/tvp5150.c
Original file line number Diff line number Diff line change
Expand Up @@ -891,29 +891,26 @@ static int tvp5150_s_routing(struct v4l2_subdev *sd,
return 0;
}

static int tvp5150_s_fmt(struct v4l2_subdev *sd, struct v4l2_format *fmt)
static int tvp5150_s_raw_fmt(struct v4l2_subdev *sd, struct v4l2_vbi_format *fmt)
{
/* this is for capturing 36 raw vbi lines
if there's a way to cut off the beginning 2 vbi lines
with the tvp5150 then the vbi line count could be lowered
to 17 lines/field again, although I couldn't find a register
which could do that cropping */
if (fmt->sample_format == V4L2_PIX_FMT_GREY)
tvp5150_write(sd, TVP5150_LUMA_PROC_CTL_1, 0x70);
if (fmt->count[0] == 18 && fmt->count[1] == 18) {
tvp5150_write(sd, TVP5150_VERT_BLANKING_START, 0x00);
tvp5150_write(sd, TVP5150_VERT_BLANKING_STOP, 0x01);
}
return 0;
}

static int tvp5150_s_sliced_fmt(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_format *svbi)
{
struct v4l2_sliced_vbi_format *svbi;
int i;

/* raw vbi */
if (fmt->type == V4L2_BUF_TYPE_VBI_CAPTURE) {
/* this is for capturing 36 raw vbi lines
if there's a way to cut off the beginning 2 vbi lines
with the tvp5150 then the vbi line count could be lowered
to 17 lines/field again, although I couldn't find a register
which could do that cropping */
if (fmt->fmt.vbi.sample_format == V4L2_PIX_FMT_GREY)
tvp5150_write(sd, TVP5150_LUMA_PROC_CTL_1, 0x70);
if (fmt->fmt.vbi.count[0] == 18 && fmt->fmt.vbi.count[1] == 18) {
tvp5150_write(sd, TVP5150_VERT_BLANKING_START, 0x00);
tvp5150_write(sd, TVP5150_VERT_BLANKING_STOP, 0x01);
}
return 0;
}
if (fmt->type != V4L2_BUF_TYPE_SLICED_VBI_CAPTURE)
return -EINVAL;
svbi = &fmt->fmt.sliced;
if (svbi->service_set != 0) {
for (i = 0; i <= 23; i++) {
svbi->service_lines[1][i] = 0;
Expand All @@ -937,14 +934,24 @@ static int tvp5150_s_fmt(struct v4l2_subdev *sd, struct v4l2_format *fmt)
return 0;
}

static int tvp5150_g_fmt(struct v4l2_subdev *sd, struct v4l2_format *fmt)
static int tvp5150_s_fmt(struct v4l2_subdev *sd, struct v4l2_format *fmt)
{
struct v4l2_sliced_vbi_format *svbi;
int i, mask = 0;
switch (fmt->type) {
case V4L2_BUF_TYPE_VBI_CAPTURE:
return tvp5150_s_raw_fmt(sd, &fmt->fmt.vbi);

if (fmt->type != V4L2_BUF_TYPE_SLICED_VBI_CAPTURE)
case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE:
return tvp5150_s_sliced_fmt(sd, &fmt->fmt.sliced);

default:
return -EINVAL;
svbi = &fmt->fmt.sliced;
}
}

static int tvp5150_g_sliced_fmt(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_format *svbi)
{
int i, mask = 0;

memset(svbi, 0, sizeof(*svbi));

for (i = 0; i <= 23; i++) {
Expand All @@ -956,6 +963,12 @@ static int tvp5150_g_fmt(struct v4l2_subdev *sd, struct v4l2_format *fmt)
return 0;
}

static int tvp5150_g_fmt(struct v4l2_subdev *sd, struct v4l2_format *fmt)
{
if (fmt->type != V4L2_BUF_TYPE_SLICED_VBI_CAPTURE)
return -EINVAL;
return tvp5150_g_sliced_fmt(sd, &fmt->fmt.sliced);
}

static int tvp5150_g_chip_ident(struct v4l2_subdev *sd,
struct v4l2_dbg_chip_ident *chip)
Expand Down Expand Up @@ -1050,6 +1063,9 @@ static const struct v4l2_subdev_video_ops tvp5150_video_ops = {

static const struct v4l2_subdev_vbi_ops tvp5150_vbi_ops = {
.g_sliced_vbi_cap = tvp5150_g_sliced_vbi_cap,
.g_sliced_fmt = tvp5150_g_sliced_fmt,
.s_sliced_fmt = tvp5150_s_sliced_fmt,
.s_raw_fmt = tvp5150_s_raw_fmt,
};

static const struct v4l2_subdev_ops tvp5150_ops = {
Expand Down

0 comments on commit 1380df2

Please sign in to comment.