aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/s5p-fimc
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@iki.fi>2012-05-18 08:31:18 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-07-06 19:15:48 -0400
commit5689b28890f4a7c4e12290dbf2c29a9d23047335 (patch)
treea7df462fdb85c8d59dd1713a184a9d3f39e53e7e /drivers/media/video/s5p-fimc
parent1ec0ed083988ae433305d7f4158fda8c3a1a23b9 (diff)
[media] v4l: Unify selection targets across V4L2 and V4L2 subdev interfaces
Change the users of V4L2_SUBDEV_SEL_TGT_* targets to use V4L2_SEL_TGT_* instead. The common definitions are moved to a new header file, include/linux/v4l2-common.h. Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/s5p-fimc')
-rw-r--r--drivers/media/video/s5p-fimc/fimc-capture.c18
-rw-r--r--drivers/media/video/s5p-fimc/fimc-lite.c11
2 files changed, 14 insertions, 15 deletions
diff --git a/drivers/media/video/s5p-fimc/fimc-capture.c b/drivers/media/video/s5p-fimc/fimc-capture.c
index a3cd78d33913..521e3715b9ee 100644
--- a/drivers/media/video/s5p-fimc/fimc-capture.c
+++ b/drivers/media/video/s5p-fimc/fimc-capture.c
@@ -1429,9 +1429,9 @@ static int fimc_subdev_get_selection(struct v4l2_subdev *sd,
1429 mutex_lock(&fimc->lock); 1429 mutex_lock(&fimc->lock);
1430 1430
1431 switch (sel->target) { 1431 switch (sel->target) {
1432 case V4L2_SUBDEV_SEL_TGT_COMPOSE_BOUNDS: 1432 case V4L2_SEL_TGT_COMPOSE_BOUNDS:
1433 f = &ctx->d_frame; 1433 f = &ctx->d_frame;
1434 case V4L2_SUBDEV_SEL_TGT_CROP_BOUNDS: 1434 case V4L2_SEL_TGT_CROP_BOUNDS:
1435 r->width = f->o_width; 1435 r->width = f->o_width;
1436 r->height = f->o_height; 1436 r->height = f->o_height;
1437 r->left = 0; 1437 r->left = 0;
@@ -1439,10 +1439,10 @@ static int fimc_subdev_get_selection(struct v4l2_subdev *sd,
1439 mutex_unlock(&fimc->lock); 1439 mutex_unlock(&fimc->lock);
1440 return 0; 1440 return 0;
1441 1441
1442 case V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL: 1442 case V4L2_SEL_TGT_CROP:
1443 try_sel = v4l2_subdev_get_try_crop(fh, sel->pad); 1443 try_sel = v4l2_subdev_get_try_crop(fh, sel->pad);
1444 break; 1444 break;
1445 case V4L2_SUBDEV_SEL_TGT_COMPOSE_ACTUAL: 1445 case V4L2_SEL_TGT_COMPOSE:
1446 try_sel = v4l2_subdev_get_try_compose(fh, sel->pad); 1446 try_sel = v4l2_subdev_get_try_compose(fh, sel->pad);
1447 f = &ctx->d_frame; 1447 f = &ctx->d_frame;
1448 break; 1448 break;
@@ -1486,9 +1486,9 @@ static int fimc_subdev_set_selection(struct v4l2_subdev *sd,
1486 fimc_capture_try_selection(ctx, r, V4L2_SEL_TGT_CROP); 1486 fimc_capture_try_selection(ctx, r, V4L2_SEL_TGT_CROP);
1487 1487
1488 switch (sel->target) { 1488 switch (sel->target) {
1489 case V4L2_SUBDEV_SEL_TGT_COMPOSE_BOUNDS: 1489 case V4L2_SEL_TGT_COMPOSE_BOUNDS:
1490 f = &ctx->d_frame; 1490 f = &ctx->d_frame;
1491 case V4L2_SUBDEV_SEL_TGT_CROP_BOUNDS: 1491 case V4L2_SEL_TGT_CROP_BOUNDS:
1492 r->width = f->o_width; 1492 r->width = f->o_width;
1493 r->height = f->o_height; 1493 r->height = f->o_height;
1494 r->left = 0; 1494 r->left = 0;
@@ -1496,10 +1496,10 @@ static int fimc_subdev_set_selection(struct v4l2_subdev *sd,
1496 mutex_unlock(&fimc->lock); 1496 mutex_unlock(&fimc->lock);
1497 return 0; 1497 return 0;
1498 1498
1499 case V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL: 1499 case V4L2_SEL_TGT_CROP:
1500 try_sel = v4l2_subdev_get_try_crop(fh, sel->pad); 1500 try_sel = v4l2_subdev_get_try_crop(fh, sel->pad);
1501 break; 1501 break;
1502 case V4L2_SUBDEV_SEL_TGT_COMPOSE_ACTUAL: 1502 case V4L2_SEL_TGT_COMPOSE:
1503 try_sel = v4l2_subdev_get_try_compose(fh, sel->pad); 1503 try_sel = v4l2_subdev_get_try_compose(fh, sel->pad);
1504 f = &ctx->d_frame; 1504 f = &ctx->d_frame;
1505 break; 1505 break;
@@ -1515,7 +1515,7 @@ static int fimc_subdev_set_selection(struct v4l2_subdev *sd,
1515 set_frame_crop(f, r->left, r->top, r->width, r->height); 1515 set_frame_crop(f, r->left, r->top, r->width, r->height);
1516 set_bit(ST_CAPT_APPLY_CFG, &fimc->state); 1516 set_bit(ST_CAPT_APPLY_CFG, &fimc->state);
1517 spin_unlock_irqrestore(&fimc->slock, flags); 1517 spin_unlock_irqrestore(&fimc->slock, flags);
1518 if (sel->target == V4L2_SUBDEV_SEL_TGT_COMPOSE_ACTUAL) 1518 if (sel->target == V4L2_SEL_TGT_COMPOSE)
1519 ctx->state |= FIMC_COMPOSE; 1519 ctx->state |= FIMC_COMPOSE;
1520 } 1520 }
1521 1521
diff --git a/drivers/media/video/s5p-fimc/fimc-lite.c b/drivers/media/video/s5p-fimc/fimc-lite.c
index 52ede56e0758..8785089c4460 100644
--- a/drivers/media/video/s5p-fimc/fimc-lite.c
+++ b/drivers/media/video/s5p-fimc/fimc-lite.c
@@ -1086,9 +1086,9 @@ static int fimc_lite_subdev_get_selection(struct v4l2_subdev *sd,
1086 struct fimc_lite *fimc = v4l2_get_subdevdata(sd); 1086 struct fimc_lite *fimc = v4l2_get_subdevdata(sd);
1087 struct flite_frame *f = &fimc->inp_frame; 1087 struct flite_frame *f = &fimc->inp_frame;
1088 1088
1089 if ((sel->target != V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL && 1089 if ((sel->target != V4L2_SEL_TGT_CROP &&
1090 sel->target != V4L2_SUBDEV_SEL_TGT_CROP_BOUNDS) || 1090 sel->target != V4L2_SEL_TGT_CROP_BOUNDS) ||
1091 sel->pad != FLITE_SD_PAD_SINK) 1091 sel->pad != FLITE_SD_PAD_SINK)
1092 return -EINVAL; 1092 return -EINVAL;
1093 1093
1094 if (sel->which == V4L2_SUBDEV_FORMAT_TRY) { 1094 if (sel->which == V4L2_SUBDEV_FORMAT_TRY) {
@@ -1097,7 +1097,7 @@ static int fimc_lite_subdev_get_selection(struct v4l2_subdev *sd,
1097 } 1097 }
1098 1098
1099 mutex_lock(&fimc->lock); 1099 mutex_lock(&fimc->lock);
1100 if (sel->target == V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL) { 1100 if (sel->target == V4L2_SEL_TGT_CROP) {
1101 sel->r = f->rect; 1101 sel->r = f->rect;
1102 } else { 1102 } else {
1103 sel->r.left = 0; 1103 sel->r.left = 0;
@@ -1122,8 +1122,7 @@ static int fimc_lite_subdev_set_selection(struct v4l2_subdev *sd,
1122 struct flite_frame *f = &fimc->inp_frame; 1122 struct flite_frame *f = &fimc->inp_frame;
1123 int ret = 0; 1123 int ret = 0;
1124 1124
1125 if (sel->target != V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL || 1125 if (sel->target != V4L2_SEL_TGT_CROP || sel->pad != FLITE_SD_PAD_SINK)
1126 sel->pad != FLITE_SD_PAD_SINK)
1127 return -EINVAL; 1126 return -EINVAL;
1128 1127
1129 mutex_lock(&fimc->lock); 1128 mutex_lock(&fimc->lock);