diff options
author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2016-02-25 02:25:42 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2016-04-14 01:11:05 +0300 |
commit | 076e834fee91db7e9df4fe2d3ecf3ed67eadbe88 (patch) | |
tree | c3aaa96646a710e32c2e069171bc8f6d1998ac62 /drivers/media/platform/vsp1/vsp1_lif.c | |
parent | c431cbbb446851ecb17095812e049119b2be17ed (diff) | |
download | linux-076e834fee91db7e9df4fe2d3ecf3ed67eadbe88.tar.xz |
[media] v4l: vsp1: Factorize frame size enumeration code
Most of the entities can't perform scaling and implement the same frame
size enumeration function. Factorize the code into a single
implementation.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/platform/vsp1/vsp1_lif.c')
-rw-r--r-- | drivers/media/platform/vsp1/vsp1_lif.c | 29 |
1 files changed, 3 insertions, 26 deletions
diff --git a/drivers/media/platform/vsp1/vsp1_lif.c b/drivers/media/platform/vsp1/vsp1_lif.c index 59a8017f39af..579e142b4e94 100644 --- a/drivers/media/platform/vsp1/vsp1_lif.c +++ b/drivers/media/platform/vsp1/vsp1_lif.c @@ -54,32 +54,9 @@ static int lif_enum_frame_size(struct v4l2_subdev *subdev, struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_frame_size_enum *fse) { - struct vsp1_lif *lif = to_lif(subdev); - struct v4l2_subdev_pad_config *config; - struct v4l2_mbus_framefmt *format; - - config = vsp1_entity_get_pad_config(&lif->entity, cfg, fse->which); - if (!config) - return -EINVAL; - - format = vsp1_entity_get_pad_format(&lif->entity, config, LIF_PAD_SINK); - - if (fse->index || fse->code != format->code) - return -EINVAL; - - if (fse->pad == LIF_PAD_SINK) { - fse->min_width = LIF_MIN_SIZE; - fse->max_width = LIF_MAX_SIZE; - fse->min_height = LIF_MIN_SIZE; - fse->max_height = LIF_MAX_SIZE; - } else { - fse->min_width = format->width; - fse->max_width = format->width; - fse->min_height = format->height; - fse->max_height = format->height; - } - - return 0; + return vsp1_subdev_enum_frame_size(subdev, cfg, fse, LIF_MIN_SIZE, + LIF_MIN_SIZE, LIF_MAX_SIZE, + LIF_MAX_SIZE); } static int lif_set_format(struct v4l2_subdev *subdev, |