aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/mt9m001.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/mt9m001.c')
-rw-r--r--drivers/media/video/mt9m001.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/drivers/media/video/mt9m001.c b/drivers/media/video/mt9m001.c
index 8b36a74b1be0..6e762cd06e3f 100644
--- a/drivers/media/video/mt9m001.c
+++ b/drivers/media/video/mt9m001.c
@@ -194,11 +194,12 @@ static unsigned long mt9m001_query_bus_param(struct soc_camera_device *icd)
194 return soc_camera_apply_sensor_flags(icl, flags); 194 return soc_camera_apply_sensor_flags(icl, flags);
195} 195}
196 196
197static int mt9m001_set_crop(struct soc_camera_device *icd, 197static int mt9m001_s_crop(struct v4l2_subdev *sd, struct v4l2_crop *a)
198 struct v4l2_rect *rect)
199{ 198{
200 struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); 199 struct v4l2_rect *rect = &a->c;
200 struct i2c_client *client = sd->priv;
201 struct mt9m001 *mt9m001 = to_mt9m001(client); 201 struct mt9m001 *mt9m001 = to_mt9m001(client);
202 struct soc_camera_device *icd = client->dev.platform_data;
202 int ret; 203 int ret;
203 const u16 hblank = 9, vblank = 25; 204 const u16 hblank = 9, vblank = 25;
204 205
@@ -239,15 +240,17 @@ static int mt9m001_s_fmt(struct v4l2_subdev *sd, struct v4l2_format *f)
239{ 240{
240 struct i2c_client *client = sd->priv; 241 struct i2c_client *client = sd->priv;
241 struct soc_camera_device *icd = client->dev.platform_data; 242 struct soc_camera_device *icd = client->dev.platform_data;
242 struct v4l2_rect rect = { 243 struct v4l2_crop a = {
243 .left = icd->rect_current.left, 244 .c = {
244 .top = icd->rect_current.top, 245 .left = icd->rect_current.left,
245 .width = f->fmt.pix.width, 246 .top = icd->rect_current.top,
246 .height = f->fmt.pix.height, 247 .width = f->fmt.pix.width,
248 .height = f->fmt.pix.height,
249 },
247 }; 250 };
248 251
249 /* No support for scaling so far, just crop. TODO: use skipping */ 252 /* No support for scaling so far, just crop. TODO: use skipping */
250 return mt9m001_set_crop(icd, &rect); 253 return mt9m001_s_crop(sd, &a);
251} 254}
252 255
253static int mt9m001_try_fmt(struct v4l2_subdev *sd, struct v4l2_format *f) 256static int mt9m001_try_fmt(struct v4l2_subdev *sd, struct v4l2_format *f)
@@ -361,7 +364,6 @@ static const struct v4l2_queryctrl mt9m001_controls[] = {
361static struct soc_camera_ops mt9m001_ops = { 364static struct soc_camera_ops mt9m001_ops = {
362 .init = mt9m001_init, 365 .init = mt9m001_init,
363 .release = mt9m001_release, 366 .release = mt9m001_release,
364 .set_crop = mt9m001_set_crop,
365 .set_bus_param = mt9m001_set_bus_param, 367 .set_bus_param = mt9m001_set_bus_param,
366 .query_bus_param = mt9m001_query_bus_param, 368 .query_bus_param = mt9m001_query_bus_param,
367 .controls = mt9m001_controls, 369 .controls = mt9m001_controls,
@@ -575,6 +577,7 @@ static struct v4l2_subdev_video_ops mt9m001_subdev_video_ops = {
575 .s_stream = mt9m001_s_stream, 577 .s_stream = mt9m001_s_stream,
576 .s_fmt = mt9m001_s_fmt, 578 .s_fmt = mt9m001_s_fmt,
577 .try_fmt = mt9m001_try_fmt, 579 .try_fmt = mt9m001_try_fmt,
580 .s_crop = mt9m001_s_crop,
578}; 581};
579 582
580static struct v4l2_subdev_ops mt9m001_subdev_ops = { 583static struct v4l2_subdev_ops mt9m001_subdev_ops = {