media: soc_camera: ov9750 add enum_frame_size support

users can get available frame size to fix
cheese/obs-studio player crush bug.

Change-Id: Ia5f12d6289d431195def181819777ca9a0968498
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
This commit is contained in:
Lin Jinhan
2018-12-07 17:30:42 +08:00
committed by Tao Huang
parent 51a22ca3c7
commit e79c0b958c
3 changed files with 30 additions and 0 deletions

View File

@@ -953,6 +953,7 @@ static struct v4l2_subdev_pad_ops ov9750_camera_module_pad_ops = {
.enum_frame_interval = ov_camera_module_enum_frameintervals,
.get_fmt = ov_camera_module_g_fmt,
.set_fmt = ov_camera_module_s_fmt,
.enum_frame_size = ov_camera_module_enum_frame_size,
};
static struct v4l2_subdev_ops ov9750_camera_module_ops = {

View File

@@ -339,6 +339,30 @@ int ov_camera_module_g_fmt(struct v4l2_subdev *sd,
/* ======================================================================== */
int ov_camera_module_enum_frame_size(
struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg,
struct v4l2_subdev_frame_size_enum *fse)
{
struct ov_camera_module *cam_mod = to_ov_camera_module(sd);
if (fse->index >= cam_mod->custom.num_configs)
return -EINVAL;
fse->code =
cam_mod->custom.configs[fse->index].frm_fmt.code;
fse->max_width =
cam_mod->custom.configs[fse->index].frm_fmt.width;
fse->max_height =
cam_mod->custom.configs[fse->index].frm_fmt.height;
pltfrm_camera_module_pr_debug(&cam_mod->sd, "%dx%d",
fse->max_width, fse->max_height);
return 0;
}
/* ======================================================================== */
int ov_camera_module_s_frame_interval(
struct v4l2_subdev *sd,
struct v4l2_subdev_frame_interval *interval)

View File

@@ -276,6 +276,11 @@ int ov_camera_module_s_ext_ctrls(
struct v4l2_subdev *sd,
struct v4l2_ext_controls *ctrls);
int ov_camera_module_enum_frame_size(
struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg,
struct v4l2_subdev_frame_size_enum *fse);
int ov_camera_module_enum_frameintervals(
struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg,