Commit a20cb11b authored by Enrico Scholz's avatar Enrico Scholz

onsemi-core: implemented ENUM_FRAMESIZES

Signed-off-by: Enrico Scholz's avatarEnrico Scholz <enrico.scholz@sigma-chemnitz.de>
parent b42aef63
...@@ -1927,6 +1927,38 @@ static int onsemi_enum_mbus_code(struct v4l2_subdev *sd, ...@@ -1927,6 +1927,38 @@ static int onsemi_enum_mbus_code(struct v4l2_subdev *sd,
return 0; return 0;
} }
static int onsemi_enum_frame_size(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg,
struct v4l2_subdev_frame_size_enum *fse)
{
struct onsemi_core *onsemi = sd_to_onsemi(sd);
struct onsemi_v4l_parm *parm = onsemi->v4l_parm;
struct onsemi_businfo const *info;
unsigned int max_w;
unsigned int max_h;
if (fse->index > 0)
return -EINVAL;
info = onsemi_get_businfo(onsemi, fse->pad);
if (!info)
return -EINVAL;
/* TODO: check fse->code? */
max_w = onsemi->limits->x.max - onsemi->limits->x.min + 1;
max_h = onsemi->limits->y.max - onsemi->limits->y.min + 1;
max_w /= parm->x_scale;
max_h /= parm->y_scale;
fse->min_width = 2; /* TODO: calculate this value somehow */
fse->max_width = max_w;
fse->min_height = 2; /* TODO: calculate this value somehow */
fse->max_height = max_h;
return 0;
}
static int onsemi_mbus_to_bpp(struct onsemi_core const *onsemi, static int onsemi_mbus_to_bpp(struct onsemi_core const *onsemi,
struct onsemi_businfo const *info, struct onsemi_businfo const *info,
unsigned int code, unsigned int *bpp) unsigned int code, unsigned int *bpp)
...@@ -2795,6 +2827,7 @@ static struct v4l2_subdev_video_ops const onsemi_subdev_video_ops = { ...@@ -2795,6 +2827,7 @@ static struct v4l2_subdev_video_ops const onsemi_subdev_video_ops = {
}; };
static struct v4l2_subdev_pad_ops const onsemi_subdev_pad_ops = { static struct v4l2_subdev_pad_ops const onsemi_subdev_pad_ops = {
.enum_frame_size = onsemi_enum_frame_size,
.enum_mbus_code = onsemi_enum_mbus_code, .enum_mbus_code = onsemi_enum_mbus_code,
.set_fmt = onsemi_set_fmt, .set_fmt = onsemi_set_fmt,
.get_fmt = onsemi_get_fmt, .get_fmt = onsemi_get_fmt,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment