diff options
Diffstat (limited to 'drivers/media/video/mt9m001.c')
-rw-r--r-- | drivers/media/video/mt9m001.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/drivers/media/video/mt9m001.c b/drivers/media/video/mt9m001.c index 2d1034dad495..a6703d25227f 100644 --- a/drivers/media/video/mt9m001.c +++ b/drivers/media/video/mt9m001.c | |||
@@ -284,8 +284,8 @@ static unsigned long mt9m001_query_bus_param(struct soc_camera_device *icd) | |||
284 | return soc_camera_apply_sensor_flags(icl, flags); | 284 | return soc_camera_apply_sensor_flags(icl, flags); |
285 | } | 285 | } |
286 | 286 | ||
287 | static int mt9m001_set_fmt(struct soc_camera_device *icd, | 287 | static int mt9m001_set_crop(struct soc_camera_device *icd, |
288 | __u32 pixfmt, struct v4l2_rect *rect) | 288 | struct v4l2_rect *rect) |
289 | { | 289 | { |
290 | struct mt9m001 *mt9m001 = container_of(icd, struct mt9m001, icd); | 290 | struct mt9m001 *mt9m001 = container_of(icd, struct mt9m001, icd); |
291 | int ret; | 291 | int ret; |
@@ -324,6 +324,20 @@ static int mt9m001_set_fmt(struct soc_camera_device *icd, | |||
324 | return ret; | 324 | return ret; |
325 | } | 325 | } |
326 | 326 | ||
327 | static int mt9m001_set_fmt(struct soc_camera_device *icd, | ||
328 | struct v4l2_format *f) | ||
329 | { | ||
330 | struct v4l2_rect rect = { | ||
331 | .left = icd->x_current, | ||
332 | .top = icd->y_current, | ||
333 | .width = f->fmt.pix.width, | ||
334 | .height = f->fmt.pix.height, | ||
335 | }; | ||
336 | |||
337 | /* No support for scaling so far, just crop. TODO: use skipping */ | ||
338 | return mt9m001_set_crop(icd, &rect); | ||
339 | } | ||
340 | |||
327 | static int mt9m001_try_fmt(struct soc_camera_device *icd, | 341 | static int mt9m001_try_fmt(struct soc_camera_device *icd, |
328 | struct v4l2_format *f) | 342 | struct v4l2_format *f) |
329 | { | 343 | { |
@@ -449,6 +463,7 @@ static struct soc_camera_ops mt9m001_ops = { | |||
449 | .release = mt9m001_release, | 463 | .release = mt9m001_release, |
450 | .start_capture = mt9m001_start_capture, | 464 | .start_capture = mt9m001_start_capture, |
451 | .stop_capture = mt9m001_stop_capture, | 465 | .stop_capture = mt9m001_stop_capture, |
466 | .set_crop = mt9m001_set_crop, | ||
452 | .set_fmt = mt9m001_set_fmt, | 467 | .set_fmt = mt9m001_set_fmt, |
453 | .try_fmt = mt9m001_try_fmt, | 468 | .try_fmt = mt9m001_try_fmt, |
454 | .set_bus_param = mt9m001_set_bus_param, | 469 | .set_bus_param = mt9m001_set_bus_param, |