Commit 3193ceea authored by Marek Vasut's avatar Marek Vasut Committed by Mauro Carvalho Chehab

media: mt9p031: Implement crop bounds get selection

Implement V4L2_SEL_TGT_CROP_BOUNDS query in get_selection subdev op
for this sensor. This is required e.g. to bind it to STM32MP15x DCMI.
Signed-off-by: default avatarMarek Vasut <marex@denx.de>
Cc: Stefan Riedmueller <s.riedmueller@phytec.de>
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent f076057f
...@@ -623,12 +623,22 @@ static int mt9p031_get_selection(struct v4l2_subdev *subdev, ...@@ -623,12 +623,22 @@ static int mt9p031_get_selection(struct v4l2_subdev *subdev,
{ {
struct mt9p031 *mt9p031 = to_mt9p031(subdev); struct mt9p031 *mt9p031 = to_mt9p031(subdev);
if (sel->target != V4L2_SEL_TGT_CROP) switch (sel->target) {
return -EINVAL; case V4L2_SEL_TGT_CROP_BOUNDS:
sel->r.left = MT9P031_COLUMN_START_MIN;
sel->r.top = MT9P031_ROW_START_MIN;
sel->r.width = MT9P031_WINDOW_WIDTH_MAX;
sel->r.height = MT9P031_WINDOW_HEIGHT_MAX;
return 0;
sel->r = *__mt9p031_get_pad_crop(mt9p031, sd_state, sel->pad, case V4L2_SEL_TGT_CROP:
sel->which); sel->r = *__mt9p031_get_pad_crop(mt9p031, sd_state,
return 0; sel->pad, sel->which);
return 0;
default:
return -EINVAL;
}
} }
static int mt9p031_set_selection(struct v4l2_subdev *subdev, static int mt9p031_set_selection(struct v4l2_subdev *subdev,
......
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