[media] smiapp: Support V4L2_SEL_TGT_NATIVE_SIZE
authorSakari Ailus <sakari.ailus@iki.fi>
Thu, 6 Nov 2014 19:54:33 +0000 (16:54 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Thu, 4 Dec 2014 14:39:35 +0000 (12:39 -0200)
Add support for selection target V4L2_SEL_TGT_NATIVE_SIZE. It is equivalent
of what V4L2_SEL_TGT_CROP_BOUNDS used to be. Support for
V4L2_SEL_TGT_CROP_BOUNDS is still supported by the driver as a compatibility
interface.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/i2c/smiapp/smiapp-core.c

index 022ad44b5e6cab86bc2611b2fe2a3837f9894324..65e4e059216ff4c7c14a520459820528b2c62d87 100644 (file)
@@ -2092,6 +2092,11 @@ static int __smiapp_sel_supported(struct v4l2_subdev *subdev,
                    == SMIAPP_DIGITAL_CROP_CAPABILITY_INPUT_CROP)
                        return 0;
                return -EINVAL;
+       case V4L2_SEL_TGT_NATIVE_SIZE:
+               if (ssd == sensor->pixel_array
+                   && sel->pad == SMIAPP_PA_PAD_SRC)
+                       return 0;
+               return -EINVAL;
        case V4L2_SEL_TGT_COMPOSE:
        case V4L2_SEL_TGT_COMPOSE_BOUNDS:
                if (sel->pad == ssd->source_pad)
@@ -2190,6 +2195,7 @@ static int __smiapp_get_selection(struct v4l2_subdev *subdev,
 
        switch (sel->target) {
        case V4L2_SEL_TGT_CROP_BOUNDS:
+       case V4L2_SEL_TGT_NATIVE_SIZE:
                if (ssd == sensor->pixel_array) {
                        sel->r.left = sel->r.top = 0;
                        sel->r.width =