aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/mt9v022.c
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2009-08-25 10:46:54 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-09-18 23:19:06 -0400
commit08590b9613f7f624fe3a052586eea2dbb3584b38 (patch)
treea893d250a4edf84e93794be59e2b1d859314c972 /drivers/media/video/mt9v022.c
parent961801bbb3448a86f0cc93747cecbfae686d81d1 (diff)
V4L/DVB (12529): soc-camera: switch to s_crop v4l2-subdev video operation
Remove set_crop soc-camera device method and switch to s_crop from v4l2-subdev video operations. Also extend non-i2c drivers to also hold a pointer to their v4l2-subdev instance in control device driver-data, i.e., in dev_get_drvdata((struct device *)to_soc_camera_control(icd)) Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/mt9v022.c')
-rw-r--r--drivers/media/video/mt9v022.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/drivers/media/video/mt9v022.c b/drivers/media/video/mt9v022.c
index d2b0981ec1c1..e609ff51aa66 100644
--- a/drivers/media/video/mt9v022.c
+++ b/drivers/media/video/mt9v022.c
@@ -248,10 +248,11 @@ static unsigned long mt9v022_query_bus_param(struct soc_camera_device *icd)
248 width_flag; 248 width_flag;
249} 249}
250 250
251static int mt9v022_set_crop(struct soc_camera_device *icd, 251static int mt9v022_s_crop(struct v4l2_subdev *sd, struct v4l2_crop *a)
252 struct v4l2_rect *rect)
253{ 252{
254 struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); 253 struct v4l2_rect *rect = &a->c;
254 struct i2c_client *client = sd->priv;
255 struct soc_camera_device *icd = client->dev.platform_data;
255 int ret; 256 int ret;
256 257
257 /* Like in example app. Contradicts the datasheet though */ 258 /* Like in example app. Contradicts the datasheet though */
@@ -297,11 +298,13 @@ static int mt9v022_s_fmt(struct v4l2_subdev *sd, struct v4l2_format *f)
297 struct mt9v022 *mt9v022 = to_mt9v022(client); 298 struct mt9v022 *mt9v022 = to_mt9v022(client);
298 struct soc_camera_device *icd = client->dev.platform_data; 299 struct soc_camera_device *icd = client->dev.platform_data;
299 struct v4l2_pix_format *pix = &f->fmt.pix; 300 struct v4l2_pix_format *pix = &f->fmt.pix;
300 struct v4l2_rect rect = { 301 struct v4l2_crop a = {
301 .left = icd->rect_current.left, 302 .c = {
302 .top = icd->rect_current.top, 303 .left = icd->rect_current.left,
303 .width = pix->width, 304 .top = icd->rect_current.top,
304 .height = pix->height, 305 .width = pix->width,
306 .height = pix->height,
307 },
305 }; 308 };
306 309
307 /* The caller provides a supported format, as verified per call to 310 /* The caller provides a supported format, as verified per call to
@@ -325,7 +328,7 @@ static int mt9v022_s_fmt(struct v4l2_subdev *sd, struct v4l2_format *f)
325 } 328 }
326 329
327 /* No support for scaling on this camera, just crop. */ 330 /* No support for scaling on this camera, just crop. */
328 return mt9v022_set_crop(icd, &rect); 331 return mt9v022_s_crop(sd, &a);
329} 332}
330 333
331static int mt9v022_try_fmt(struct v4l2_subdev *sd, struct v4l2_format *f) 334static int mt9v022_try_fmt(struct v4l2_subdev *sd, struct v4l2_format *f)
@@ -454,7 +457,6 @@ static const struct v4l2_queryctrl mt9v022_controls[] = {
454 457
455static struct soc_camera_ops mt9v022_ops = { 458static struct soc_camera_ops mt9v022_ops = {
456 .init = mt9v022_init, 459 .init = mt9v022_init,
457 .set_crop = mt9v022_set_crop,
458 .set_bus_param = mt9v022_set_bus_param, 460 .set_bus_param = mt9v022_set_bus_param,
459 .query_bus_param = mt9v022_query_bus_param, 461 .query_bus_param = mt9v022_query_bus_param,
460 .controls = mt9v022_controls, 462 .controls = mt9v022_controls,
@@ -700,6 +702,7 @@ static struct v4l2_subdev_video_ops mt9v022_subdev_video_ops = {
700 .s_stream = mt9v022_s_stream, 702 .s_stream = mt9v022_s_stream,
701 .s_fmt = mt9v022_s_fmt, 703 .s_fmt = mt9v022_s_fmt,
702 .try_fmt = mt9v022_try_fmt, 704 .try_fmt = mt9v022_try_fmt,
705 .s_crop = mt9v022_s_crop,
703}; 706};
704 707
705static struct v4l2_subdev_ops mt9v022_subdev_ops = { 708static struct v4l2_subdev_ops mt9v022_subdev_ops = {