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 16682c8477d14d378b761bf58e1b1be89912c1ff..30f9db1351b91a26fb2369695eebddf4a4d014c3 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 efda1aa95ca023d0fde2cb6ac7585444170f9659..1395986a07bb80faa85c938ece6bf917c303e0a3 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 af8cca9842154cd70082b06025b74c6325dfbeee..ef353a244e33ff2802d4c90ddda963ed512f25ff 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 beb722065152e57fabec16cfbe9d8c790843cdf1..20a8853ba1e29a815386698c10756a5250c1e098 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 17a34b4a819d32187589cbd045853ec3999995aa..5d1b218bb7f0832804b334f0061e92ee91f1854d 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 161bc7c8535d92ae14c35c45fcd3e597076da131..fefff7fd7d686c98dd60680e9df6543f4696e9fa 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 6ad998ad1b167f931f42727aa620efbf2b6e782f..4cc51e00187440a1fe97a83cd013cfd615f50a2b 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 1bfb0d53059ee803c4499d6bfea58cf652550586..a1a85ff838c527cbc38f867c41cae1ab220208c5 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 b53c36dfa4692d44b6634d75e7427af555e5f02c..ea1ff270bc2db11468b461a9ca247a6c2d14bf5b 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 762f06919329a679b0ef1617ea0d94b65176bf3d..6d922b17ea94211e66b441a7bccc20fe48d463d4 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 39f420db9c70e50897774b9c4e7a589d33ca462b..c6c41b03c0ef385e1ee5bf7a13de5a94685c8387 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 14377af7c888898b2c19e969c2475fe558ebdac3..fafd372527b28e259774973fefd219cbff27eda4 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 c639489896883417cfe4179fe0568f7a27f6677a..eb91b8240083d8c3d600528c6372e19a34013e08 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 755de2289c395bba5a84baf25407cdb0352709ba..a07d3145d1b46c904ecf2600c072f05e0d121f5e 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 02398d0bc649100d25e9f57cae37523a0a8c8495..f0cb49a6167b02c15b2c89a889d9fed2691e557d 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 f5b234e4599dcc53fb842d2206a0f2ef44c88b08..4f746e02de22c5e364c9ffe1c93679b95ff35c76 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 6164102e6f9f9947533a416a7cd90bd3f8ed4715..8d25ca0490f742e9e4a45812d13e362943412eac 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 77f1e0243d6ef791cfe14c6e3b5d8e83af98ac11..c5256903e59ff91d58576070fc6f60a779590fb7 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 4802d30e47dea151682cf9443bfb584e682ccc32..4ff179302b4f4ed4fab6d183d5bd5ba60a511fd3 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;