diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2010-08-06 15:42:55 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-10-20 23:04:39 -0400 |
commit | b8c75ed898408cc7ca599a20ce27c40c425bd143 (patch) | |
tree | c2bf2eb4e832a09d29ed41bfe5699f807f376ad2 | |
parent | 515d93fb238e201901610bceddedc4027f565d5e (diff) |
V4L/DVB: go7007: convert to use the mediabus API
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/staging/go7007/go7007-v4l2.c | 19 | ||||
-rw-r--r-- | drivers/staging/go7007/s2250-board.c | 7 |
2 files changed, 13 insertions, 13 deletions
diff --git a/drivers/staging/go7007/go7007-v4l2.c b/drivers/staging/go7007/go7007-v4l2.c index 46b4b9f6855b..2b27d8da70a2 100644 --- a/drivers/staging/go7007/go7007-v4l2.c +++ b/drivers/staging/go7007/go7007-v4l2.c | |||
@@ -252,23 +252,22 @@ static int set_capture_size(struct go7007 *go, struct v4l2_format *fmt, int try) | |||
252 | go->modet_map[i] = 0; | 252 | go->modet_map[i] = 0; |
253 | 253 | ||
254 | if (go->board_info->sensor_flags & GO7007_SENSOR_SCALING) { | 254 | if (go->board_info->sensor_flags & GO7007_SENSOR_SCALING) { |
255 | struct v4l2_format res; | 255 | struct v4l2_mbus_framefmt mbus_fmt; |
256 | 256 | ||
257 | if (fmt != NULL) { | 257 | mbus_fmt.code = V4L2_MBUS_FMT_FIXED; |
258 | res = *fmt; | 258 | if (fmt != NULL) |
259 | } else { | 259 | mbus_fmt.width = fmt->fmt.pix.width; |
260 | res.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; | 260 | else |
261 | res.fmt.pix.width = width; | 261 | mbus_fmt.width = width; |
262 | } | ||
263 | 262 | ||
264 | if (height > sensor_height / 2) { | 263 | if (height > sensor_height / 2) { |
265 | res.fmt.pix.height = height / 2; | 264 | mbus_fmt.height = height / 2; |
266 | go->encoder_v_halve = 0; | 265 | go->encoder_v_halve = 0; |
267 | } else { | 266 | } else { |
268 | res.fmt.pix.height = height; | 267 | mbus_fmt.height = height; |
269 | go->encoder_v_halve = 1; | 268 | go->encoder_v_halve = 1; |
270 | } | 269 | } |
271 | call_all(&go->v4l2_dev, video, s_fmt, &res); | 270 | call_all(&go->v4l2_dev, video, s_mbus_fmt, &mbus_fmt); |
272 | } else { | 271 | } else { |
273 | if (width <= sensor_width / 4) { | 272 | if (width <= sensor_width / 4) { |
274 | go->encoder_h_halve = 1; | 273 | go->encoder_h_halve = 1; |
diff --git a/drivers/staging/go7007/s2250-board.c b/drivers/staging/go7007/s2250-board.c index 93f26048e3b4..db8ac51279f9 100644 --- a/drivers/staging/go7007/s2250-board.c +++ b/drivers/staging/go7007/s2250-board.c | |||
@@ -479,12 +479,13 @@ static int s2250_g_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl) | |||
479 | return 0; | 479 | return 0; |
480 | } | 480 | } |
481 | 481 | ||
482 | static int s2250_s_fmt(struct v4l2_subdev *sd, struct v4l2_format *fmt) | 482 | static int s2250_s_mbus_fmt(struct v4l2_subdev *sd, |
483 | struct v4l2_mbus_framefmt *fmt) | ||
483 | { | 484 | { |
484 | struct s2250 *state = to_state(sd); | 485 | struct s2250 *state = to_state(sd); |
485 | struct i2c_client *client = v4l2_get_subdevdata(sd); | 486 | struct i2c_client *client = v4l2_get_subdevdata(sd); |
486 | 487 | ||
487 | if (fmt->fmt.pix.height < 640) { | 488 | if (fmt->height < 640) { |
488 | write_reg_fp(client, 0x12b, state->reg12b_val | 0x400); | 489 | write_reg_fp(client, 0x12b, state->reg12b_val | 0x400); |
489 | write_reg_fp(client, 0x140, 0x060); | 490 | write_reg_fp(client, 0x140, 0x060); |
490 | } else { | 491 | } else { |
@@ -555,7 +556,7 @@ static const struct v4l2_subdev_audio_ops s2250_audio_ops = { | |||
555 | 556 | ||
556 | static const struct v4l2_subdev_video_ops s2250_video_ops = { | 557 | static const struct v4l2_subdev_video_ops s2250_video_ops = { |
557 | .s_routing = s2250_s_video_routing, | 558 | .s_routing = s2250_s_video_routing, |
558 | .s_fmt = s2250_s_fmt, | 559 | .s_mbus_fmt = s2250_s_mbus_fmt, |
559 | }; | 560 | }; |
560 | 561 | ||
561 | static const struct v4l2_subdev_ops s2250_ops = { | 562 | static const struct v4l2_subdev_ops s2250_ops = { |