aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/smiapp
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/smiapp
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/smiapp')
-rw-r--r--drivers/media/video/smiapp/smiapp-core.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/drivers/media/video/smiapp/smiapp-core.c b/drivers/media/video/smiapp/smiapp-core.c
index 37622bb6c66..9bbb5d3f003 100644
--- a/drivers/media/video/smiapp/smiapp-core.c
+++ b/drivers/media/video/smiapp/smiapp-core.c
@@ -1630,7 +1630,7 @@ static void smiapp_propagate(struct v4l2_subdev *subdev,
1630 smiapp_get_crop_compose(subdev, fh, crops, &comp, which); 1630 smiapp_get_crop_compose(subdev, fh, crops, &comp, which);
1631 1631
1632 switch (target) { 1632 switch (target) {
1633 case V4L2_SUBDEV_SEL_TGT_CROP: 1633 case V4L2_SEL_TGT_CROP:
1634 comp->width = crops[SMIAPP_PAD_SINK]->width; 1634 comp->width = crops[SMIAPP_PAD_SINK]->width;
1635 comp->height = crops[SMIAPP_PAD_SINK]->height; 1635 comp->height = crops[SMIAPP_PAD_SINK]->height;
1636 if (which == V4L2_SUBDEV_FORMAT_ACTIVE) { 1636 if (which == V4L2_SUBDEV_FORMAT_ACTIVE) {
@@ -1646,7 +1646,7 @@ static void smiapp_propagate(struct v4l2_subdev *subdev,
1646 } 1646 }
1647 } 1647 }
1648 /* Fall through */ 1648 /* Fall through */
1649 case V4L2_SUBDEV_SEL_TGT_COMPOSE: 1649 case V4L2_SEL_TGT_COMPOSE:
1650 *crops[SMIAPP_PAD_SRC] = *comp; 1650 *crops[SMIAPP_PAD_SRC] = *comp;
1651 break; 1651 break;
1652 default: 1652 default:
@@ -1722,7 +1722,7 @@ static int smiapp_set_format(struct v4l2_subdev *subdev,
1722 if (fmt->which == V4L2_SUBDEV_FORMAT_ACTIVE) 1722 if (fmt->which == V4L2_SUBDEV_FORMAT_ACTIVE)
1723 ssd->sink_fmt = *crops[ssd->sink_pad]; 1723 ssd->sink_fmt = *crops[ssd->sink_pad];
1724 smiapp_propagate(subdev, fh, fmt->which, 1724 smiapp_propagate(subdev, fh, fmt->which,
1725 V4L2_SUBDEV_SEL_TGT_CROP); 1725 V4L2_SEL_TGT_CROP);
1726 1726
1727 mutex_unlock(&sensor->mutex); 1727 mutex_unlock(&sensor->mutex);
1728 1728
@@ -1957,7 +1957,7 @@ static int smiapp_set_compose(struct v4l2_subdev *subdev,
1957 1957
1958 *comp = sel->r; 1958 *comp = sel->r;
1959 smiapp_propagate(subdev, fh, sel->which, 1959 smiapp_propagate(subdev, fh, sel->which,
1960 V4L2_SUBDEV_SEL_TGT_COMPOSE); 1960 V4L2_SEL_TGT_COMPOSE);
1961 1961
1962 if (sel->which == V4L2_SUBDEV_FORMAT_ACTIVE) 1962 if (sel->which == V4L2_SUBDEV_FORMAT_ACTIVE)
1963 return smiapp_update_mode(sensor); 1963 return smiapp_update_mode(sensor);
@@ -1973,8 +1973,8 @@ static int __smiapp_sel_supported(struct v4l2_subdev *subdev,
1973 1973
1974 /* We only implement crop in three places. */ 1974 /* We only implement crop in three places. */
1975 switch (sel->target) { 1975 switch (sel->target) {
1976 case V4L2_SUBDEV_SEL_TGT_CROP: 1976 case V4L2_SEL_TGT_CROP:
1977 case V4L2_SUBDEV_SEL_TGT_CROP_BOUNDS: 1977 case V4L2_SEL_TGT_CROP_BOUNDS:
1978 if (ssd == sensor->pixel_array 1978 if (ssd == sensor->pixel_array
1979 && sel->pad == SMIAPP_PA_PAD_SRC) 1979 && sel->pad == SMIAPP_PA_PAD_SRC)
1980 return 0; 1980 return 0;
@@ -1987,8 +1987,8 @@ static int __smiapp_sel_supported(struct v4l2_subdev *subdev,
1987 == SMIAPP_DIGITAL_CROP_CAPABILITY_INPUT_CROP) 1987 == SMIAPP_DIGITAL_CROP_CAPABILITY_INPUT_CROP)
1988 return 0; 1988 return 0;
1989 return -EINVAL; 1989 return -EINVAL;
1990 case V4L2_SUBDEV_SEL_TGT_COMPOSE: 1990 case V4L2_SEL_TGT_COMPOSE:
1991 case V4L2_SUBDEV_SEL_TGT_COMPOSE_BOUNDS: 1991 case V4L2_SEL_TGT_COMPOSE_BOUNDS:
1992 if (sel->pad == ssd->source_pad) 1992 if (sel->pad == ssd->source_pad)
1993 return -EINVAL; 1993 return -EINVAL;
1994 if (ssd == sensor->binner) 1994 if (ssd == sensor->binner)
@@ -2050,7 +2050,7 @@ static int smiapp_set_crop(struct v4l2_subdev *subdev,
2050 2050
2051 if (ssd != sensor->pixel_array && sel->pad == SMIAPP_PAD_SINK) 2051 if (ssd != sensor->pixel_array && sel->pad == SMIAPP_PAD_SINK)
2052 smiapp_propagate(subdev, fh, sel->which, 2052 smiapp_propagate(subdev, fh, sel->which,
2053 V4L2_SUBDEV_SEL_TGT_CROP); 2053 V4L2_SEL_TGT_CROP);
2054 2054
2055 return 0; 2055 return 0;
2056} 2056}
@@ -2084,7 +2084,7 @@ static int __smiapp_get_selection(struct v4l2_subdev *subdev,
2084 } 2084 }
2085 2085
2086 switch (sel->target) { 2086 switch (sel->target) {
2087 case V4L2_SUBDEV_SEL_TGT_CROP_BOUNDS: 2087 case V4L2_SEL_TGT_CROP_BOUNDS:
2088 if (ssd == sensor->pixel_array) { 2088 if (ssd == sensor->pixel_array) {
2089 sel->r.width = 2089 sel->r.width =
2090 sensor->limits[SMIAPP_LIMIT_X_ADDR_MAX] + 1; 2090 sensor->limits[SMIAPP_LIMIT_X_ADDR_MAX] + 1;
@@ -2096,11 +2096,11 @@ static int __smiapp_get_selection(struct v4l2_subdev *subdev,
2096 sel->r = *comp; 2096 sel->r = *comp;
2097 } 2097 }
2098 break; 2098 break;
2099 case V4L2_SUBDEV_SEL_TGT_CROP: 2099 case V4L2_SEL_TGT_CROP:
2100 case V4L2_SUBDEV_SEL_TGT_COMPOSE_BOUNDS: 2100 case V4L2_SEL_TGT_COMPOSE_BOUNDS:
2101 sel->r = *crops[sel->pad]; 2101 sel->r = *crops[sel->pad];
2102 break; 2102 break;
2103 case V4L2_SUBDEV_SEL_TGT_COMPOSE: 2103 case V4L2_SEL_TGT_COMPOSE:
2104 sel->r = *comp; 2104 sel->r = *comp;
2105 break; 2105 break;
2106 } 2106 }
@@ -2147,10 +2147,10 @@ static int smiapp_set_selection(struct v4l2_subdev *subdev,
2147 sel->r.height); 2147 sel->r.height);
2148 2148
2149 switch (sel->target) { 2149 switch (sel->target) {
2150 case V4L2_SUBDEV_SEL_TGT_CROP: 2150 case V4L2_SEL_TGT_CROP:
2151 ret = smiapp_set_crop(subdev, fh, sel); 2151 ret = smiapp_set_crop(subdev, fh, sel);
2152 break; 2152 break;
2153 case V4L2_SUBDEV_SEL_TGT_COMPOSE: 2153 case V4L2_SEL_TGT_COMPOSE:
2154 ret = smiapp_set_compose(subdev, fh, sel); 2154 ret = smiapp_set_compose(subdev, fh, sel);
2155 break; 2155 break;
2156 default: 2156 default: