media: v4l: Remove support for crop default target in subdev drivers
authorSakari Ailus <sakari.ailus@linux.intel.com>
Mon, 24 Sep 2018 14:38:11 +0000 (10:38 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Wed, 3 Oct 2018 15:58:24 +0000 (11:58 -0400)
The V4L2 sub-device API does not support the crop default target. A number
of drivers apparently still did support this, likely as it was needed by
the SoC camera framework. Drop support for the default crop rectaingle in
sub-device drivers, and use the bounds rectangle in SoC camera instead.

Reported-by: Helmut Grohne <h.grohne@intenta.de>
Suggested-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
19 files changed:
drivers/media/i2c/ak881x.c
drivers/media/i2c/mt9m111.c
drivers/media/i2c/mt9t112.c
drivers/media/i2c/ov2640.c
drivers/media/i2c/ov6650.c
drivers/media/i2c/ov772x.c
drivers/media/i2c/rj54n1cb0c.c
drivers/media/i2c/soc_camera/mt9m001.c
drivers/media/i2c/soc_camera/mt9t112.c
drivers/media/i2c/soc_camera/mt9v022.c
drivers/media/i2c/soc_camera/ov5642.c
drivers/media/i2c/soc_camera/ov772x.c
drivers/media/i2c/soc_camera/ov9640.c
drivers/media/i2c/soc_camera/ov9740.c
drivers/media/i2c/soc_camera/rj54n1cb0c.c
drivers/media/i2c/tvp5150.c
drivers/media/platform/soc_camera/soc_scale_crop.c
drivers/staging/media/imx074/imx074.c
drivers/staging/media/mt9t031/mt9t031.c

index 16682c8..30f9db1 100644 (file)
@@ -136,7 +136,6 @@ static int ak881x_get_selection(struct v4l2_subdev *sd,
 
        switch (sel->target) {
        case V4L2_SEL_TGT_CROP_BOUNDS:
-       case V4L2_SEL_TGT_CROP_DEFAULT:
                sel->r.left = 0;
                sel->r.top = 0;
                sel->r.width = 720;
index efda1aa..1395986 100644 (file)
@@ -445,7 +445,6 @@ static int mt9m111_get_selection(struct v4l2_subdev *sd,
 
        switch (sel->target) {
        case V4L2_SEL_TGT_CROP_BOUNDS:
-       case V4L2_SEL_TGT_CROP_DEFAULT:
                sel->r.left = MT9M111_MIN_DARK_COLS;
                sel->r.top = MT9M111_MIN_DARK_ROWS;
                sel->r.width = MT9M111_MAX_WIDTH;
index af8cca9..ef353a2 100644 (file)
@@ -888,12 +888,6 @@ static int mt9t112_get_selection(struct v4l2_subdev *sd,
                sel->r.width = MAX_WIDTH;
                sel->r.height = MAX_HEIGHT;
                return 0;
-       case V4L2_SEL_TGT_CROP_DEFAULT:
-               sel->r.left = 0;
-               sel->r.top = 0;
-               sel->r.width = VGA_WIDTH;
-               sel->r.height = VGA_HEIGHT;
-               return 0;
        case V4L2_SEL_TGT_CROP:
                sel->r = priv->frame;
                return 0;
index beb7220..20a8853 100644 (file)
@@ -1010,7 +1010,6 @@ static int ov2640_get_selection(struct v4l2_subdev *sd,
 
        switch (sel->target) {
        case V4L2_SEL_TGT_CROP_BOUNDS:
-       case V4L2_SEL_TGT_CROP_DEFAULT:
        case V4L2_SEL_TGT_CROP:
                sel->r.left = 0;
                sel->r.top = 0;
index 17a34b4..5d1b218 100644 (file)
@@ -449,7 +449,6 @@ static int ov6650_get_selection(struct v4l2_subdev *sd,
 
        switch (sel->target) {
        case V4L2_SEL_TGT_CROP_BOUNDS:
-       case V4L2_SEL_TGT_CROP_DEFAULT:
                sel->r.left = DEF_HSTRT << 1;
                sel->r.top = DEF_VSTRT << 1;
                sel->r.width = W_CIF;
index 161bc7c..fefff7f 100644 (file)
@@ -1147,7 +1147,6 @@ static int ov772x_get_selection(struct v4l2_subdev *sd,
        sel->r.top = 0;
        switch (sel->target) {
        case V4L2_SEL_TGT_CROP_BOUNDS:
-       case V4L2_SEL_TGT_CROP_DEFAULT:
        case V4L2_SEL_TGT_CROP:
                sel->r.width = priv->win->rect.width;
                sel->r.height = priv->win->rect.height;
index 6ad998a..4cc51e0 100644 (file)
@@ -589,7 +589,6 @@ static int rj54n1_get_selection(struct v4l2_subdev *sd,
 
        switch (sel->target) {
        case V4L2_SEL_TGT_CROP_BOUNDS:
-       case V4L2_SEL_TGT_CROP_DEFAULT:
                sel->r.left = RJ54N1_COLUMN_SKIP;
                sel->r.top = RJ54N1_ROW_SKIP;
                sel->r.width = RJ54N1_MAX_WIDTH;
index 1bfb0d5..a1a85ff 100644 (file)
@@ -243,7 +243,6 @@ static int mt9m001_get_selection(struct v4l2_subdev *sd,
 
        switch (sel->target) {
        case V4L2_SEL_TGT_CROP_BOUNDS:
-       case V4L2_SEL_TGT_CROP_DEFAULT:
                sel->r.left = MT9M001_COLUMN_SKIP;
                sel->r.top = MT9M001_ROW_SKIP;
                sel->r.width = MT9M001_MAX_WIDTH;
index b53c36d..ea1ff27 100644 (file)
@@ -884,12 +884,6 @@ static int mt9t112_get_selection(struct v4l2_subdev *sd,
                sel->r.width = MAX_WIDTH;
                sel->r.height = MAX_HEIGHT;
                return 0;
-       case V4L2_SEL_TGT_CROP_DEFAULT:
-               sel->r.left = 0;
-               sel->r.top = 0;
-               sel->r.width = VGA_WIDTH;
-               sel->r.height = VGA_HEIGHT;
-               return 0;
        case V4L2_SEL_TGT_CROP:
                sel->r = priv->frame;
                return 0;
index 762f069..6d922b1 100644 (file)
@@ -368,7 +368,6 @@ static int mt9v022_get_selection(struct v4l2_subdev *sd,
 
        switch (sel->target) {
        case V4L2_SEL_TGT_CROP_BOUNDS:
-       case V4L2_SEL_TGT_CROP_DEFAULT:
                sel->r.left = MT9V022_COLUMN_SKIP;
                sel->r.top = MT9V022_ROW_SKIP;
                sel->r.width = MT9V022_MAX_WIDTH;
index 39f420d..c6c41b0 100644 (file)
@@ -896,7 +896,6 @@ static int ov5642_get_selection(struct v4l2_subdev *sd,
 
        switch (sel->target) {
        case V4L2_SEL_TGT_CROP_BOUNDS:
-       case V4L2_SEL_TGT_CROP_DEFAULT:
                sel->r.left = 0;
                sel->r.top = 0;
                sel->r.width = OV5642_MAX_WIDTH;
index 14377af..fafd372 100644 (file)
@@ -862,7 +862,6 @@ static int ov772x_get_selection(struct v4l2_subdev *sd,
        sel->r.top = 0;
        switch (sel->target) {
        case V4L2_SEL_TGT_CROP_BOUNDS:
-       case V4L2_SEL_TGT_CROP_DEFAULT:
                sel->r.width = OV772X_MAX_WIDTH;
                sel->r.height = OV772X_MAX_HEIGHT;
                return 0;
index c639489..eb91b82 100644 (file)
@@ -554,7 +554,6 @@ static int ov9640_get_selection(struct v4l2_subdev *sd,
        sel->r.top = 0;
        switch (sel->target) {
        case V4L2_SEL_TGT_CROP_BOUNDS:
-       case V4L2_SEL_TGT_CROP_DEFAULT:
        case V4L2_SEL_TGT_CROP:
                sel->r.width = W_SXGA;
                sel->r.height = H_SXGA;
index 755de22..a07d314 100644 (file)
@@ -730,7 +730,6 @@ static int ov9740_get_selection(struct v4l2_subdev *sd,
 
        switch (sel->target) {
        case V4L2_SEL_TGT_CROP_BOUNDS:
-       case V4L2_SEL_TGT_CROP_DEFAULT:
        case V4L2_SEL_TGT_CROP:
                sel->r.left = 0;
                sel->r.top = 0;
index 02398d0..f0cb49a 100644 (file)
@@ -591,7 +591,6 @@ static int rj54n1_get_selection(struct v4l2_subdev *sd,
 
        switch (sel->target) {
        case V4L2_SEL_TGT_CROP_BOUNDS:
-       case V4L2_SEL_TGT_CROP_DEFAULT:
                sel->r.left = RJ54N1_COLUMN_SKIP;
                sel->r.top = RJ54N1_ROW_SKIP;
                sel->r.width = RJ54N1_MAX_WIDTH;
index f5b234e..4f746e0 100644 (file)
@@ -1082,7 +1082,6 @@ static int tvp5150_get_selection(struct v4l2_subdev *sd,
 
        switch (sel->target) {
        case V4L2_SEL_TGT_CROP_BOUNDS:
-       case V4L2_SEL_TGT_CROP_DEFAULT:
                sel->r.left = 0;
                sel->r.top = 0;
                sel->r.width = TVP5150_H_MAX;
index 6164102..8d25ca0 100644 (file)
@@ -52,7 +52,7 @@ int soc_camera_client_g_rect(struct v4l2_subdev *sd, struct v4l2_rect *rect)
                return ret;
        }
 
-       sdsel.target = V4L2_SEL_TGT_CROP_DEFAULT;
+       sdsel.target = V4L2_SEL_TGT_CROP_BOUNDS;
        ret = v4l2_subdev_call(sd, pad, get_selection, NULL, &sdsel);
        if (!ret)
                *rect = sdsel.r;
index 77f1e02..c525690 100644 (file)
@@ -223,7 +223,6 @@ static int imx074_get_selection(struct v4l2_subdev *sd,
 
        switch (sel->target) {
        case V4L2_SEL_TGT_CROP_BOUNDS:
-       case V4L2_SEL_TGT_CROP_DEFAULT:
        case V4L2_SEL_TGT_CROP:
                return 0;
        default:
index 4802d30..4ff1793 100644 (file)
@@ -330,7 +330,6 @@ static int mt9t031_get_selection(struct v4l2_subdev *sd,
 
        switch (sel->target) {
        case V4L2_SEL_TGT_CROP_BOUNDS:
-       case V4L2_SEL_TGT_CROP_DEFAULT:
                sel->r.left = MT9T031_COLUMN_SKIP;
                sel->r.top = MT9T031_ROW_SKIP;
                sel->r.width = MT9T031_MAX_WIDTH;