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>
This commit is contained in:
Родитель
515d93fb23
Коммит
b8c75ed898
|
@ -252,23 +252,22 @@ static int set_capture_size(struct go7007 *go, struct v4l2_format *fmt, int try)
|
||||||
go->modet_map[i] = 0;
|
go->modet_map[i] = 0;
|
||||||
|
|
||||||
if (go->board_info->sensor_flags & GO7007_SENSOR_SCALING) {
|
if (go->board_info->sensor_flags & GO7007_SENSOR_SCALING) {
|
||||||
struct v4l2_format res;
|
struct v4l2_mbus_framefmt mbus_fmt;
|
||||||
|
|
||||||
if (fmt != NULL) {
|
mbus_fmt.code = V4L2_MBUS_FMT_FIXED;
|
||||||
res = *fmt;
|
if (fmt != NULL)
|
||||||
} else {
|
mbus_fmt.width = fmt->fmt.pix.width;
|
||||||
res.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
else
|
||||||
res.fmt.pix.width = width;
|
mbus_fmt.width = width;
|
||||||
}
|
|
||||||
|
|
||||||
if (height > sensor_height / 2) {
|
if (height > sensor_height / 2) {
|
||||||
res.fmt.pix.height = height / 2;
|
mbus_fmt.height = height / 2;
|
||||||
go->encoder_v_halve = 0;
|
go->encoder_v_halve = 0;
|
||||||
} else {
|
} else {
|
||||||
res.fmt.pix.height = height;
|
mbus_fmt.height = height;
|
||||||
go->encoder_v_halve = 1;
|
go->encoder_v_halve = 1;
|
||||||
}
|
}
|
||||||
call_all(&go->v4l2_dev, video, s_fmt, &res);
|
call_all(&go->v4l2_dev, video, s_mbus_fmt, &mbus_fmt);
|
||||||
} else {
|
} else {
|
||||||
if (width <= sensor_width / 4) {
|
if (width <= sensor_width / 4) {
|
||||||
go->encoder_h_halve = 1;
|
go->encoder_h_halve = 1;
|
||||||
|
|
|
@ -479,12 +479,13 @@ static int s2250_g_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int s2250_s_fmt(struct v4l2_subdev *sd, struct v4l2_format *fmt)
|
static int s2250_s_mbus_fmt(struct v4l2_subdev *sd,
|
||||||
|
struct v4l2_mbus_framefmt *fmt)
|
||||||
{
|
{
|
||||||
struct s2250 *state = to_state(sd);
|
struct s2250 *state = to_state(sd);
|
||||||
struct i2c_client *client = v4l2_get_subdevdata(sd);
|
struct i2c_client *client = v4l2_get_subdevdata(sd);
|
||||||
|
|
||||||
if (fmt->fmt.pix.height < 640) {
|
if (fmt->height < 640) {
|
||||||
write_reg_fp(client, 0x12b, state->reg12b_val | 0x400);
|
write_reg_fp(client, 0x12b, state->reg12b_val | 0x400);
|
||||||
write_reg_fp(client, 0x140, 0x060);
|
write_reg_fp(client, 0x140, 0x060);
|
||||||
} else {
|
} else {
|
||||||
|
@ -555,7 +556,7 @@ static const struct v4l2_subdev_audio_ops s2250_audio_ops = {
|
||||||
|
|
||||||
static const struct v4l2_subdev_video_ops s2250_video_ops = {
|
static const struct v4l2_subdev_video_ops s2250_video_ops = {
|
||||||
.s_routing = s2250_s_video_routing,
|
.s_routing = s2250_s_video_routing,
|
||||||
.s_fmt = s2250_s_fmt,
|
.s_mbus_fmt = s2250_s_mbus_fmt,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct v4l2_subdev_ops s2250_ops = {
|
static const struct v4l2_subdev_ops s2250_ops = {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче