diff options
Diffstat (limited to 'drivers/media/video/mt9m111.c')
| -rw-r--r-- | drivers/media/video/mt9m111.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/media/video/mt9m111.c b/drivers/media/video/mt9m111.c index 758a4db27d65..c71af4e0e517 100644 --- a/drivers/media/video/mt9m111.c +++ b/drivers/media/video/mt9m111.c | |||
| @@ -447,6 +447,9 @@ static int mt9m111_s_crop(struct v4l2_subdev *sd, struct v4l2_crop *a) | |||
| 447 | dev_dbg(&client->dev, "%s left=%d, top=%d, width=%d, height=%d\n", | 447 | dev_dbg(&client->dev, "%s left=%d, top=%d, width=%d, height=%d\n", |
| 448 | __func__, rect.left, rect.top, rect.width, rect.height); | 448 | __func__, rect.left, rect.top, rect.width, rect.height); |
| 449 | 449 | ||
| 450 | if (a->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) | ||
| 451 | return -EINVAL; | ||
| 452 | |||
| 450 | ret = mt9m111_make_rect(client, &rect); | 453 | ret = mt9m111_make_rect(client, &rect); |
| 451 | if (!ret) | 454 | if (!ret) |
| 452 | mt9m111->rect = rect; | 455 | mt9m111->rect = rect; |
| @@ -466,12 +469,14 @@ static int mt9m111_g_crop(struct v4l2_subdev *sd, struct v4l2_crop *a) | |||
| 466 | 469 | ||
| 467 | static int mt9m111_cropcap(struct v4l2_subdev *sd, struct v4l2_cropcap *a) | 470 | static int mt9m111_cropcap(struct v4l2_subdev *sd, struct v4l2_cropcap *a) |
| 468 | { | 471 | { |
| 472 | if (a->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) | ||
| 473 | return -EINVAL; | ||
| 474 | |||
| 469 | a->bounds.left = MT9M111_MIN_DARK_COLS; | 475 | a->bounds.left = MT9M111_MIN_DARK_COLS; |
| 470 | a->bounds.top = MT9M111_MIN_DARK_ROWS; | 476 | a->bounds.top = MT9M111_MIN_DARK_ROWS; |
| 471 | a->bounds.width = MT9M111_MAX_WIDTH; | 477 | a->bounds.width = MT9M111_MAX_WIDTH; |
| 472 | a->bounds.height = MT9M111_MAX_HEIGHT; | 478 | a->bounds.height = MT9M111_MAX_HEIGHT; |
| 473 | a->defrect = a->bounds; | 479 | a->defrect = a->bounds; |
| 474 | a->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; | ||
| 475 | a->pixelaspect.numerator = 1; | 480 | a->pixelaspect.numerator = 1; |
| 476 | a->pixelaspect.denominator = 1; | 481 | a->pixelaspect.denominator = 1; |
| 477 | 482 | ||
| @@ -487,6 +492,7 @@ static int mt9m111_g_fmt(struct v4l2_subdev *sd, | |||
| 487 | mf->width = mt9m111->rect.width; | 492 | mf->width = mt9m111->rect.width; |
| 488 | mf->height = mt9m111->rect.height; | 493 | mf->height = mt9m111->rect.height; |
| 489 | mf->code = mt9m111->fmt->code; | 494 | mf->code = mt9m111->fmt->code; |
| 495 | mf->colorspace = mt9m111->fmt->colorspace; | ||
| 490 | mf->field = V4L2_FIELD_NONE; | 496 | mf->field = V4L2_FIELD_NONE; |
| 491 | 497 | ||
| 492 | return 0; | 498 | return 0; |
