From ab7ef22419927910e563170db41f0a428d20b0a2 Mon Sep 17 00:00:00 2001 From: Sylwester Nawrocki Date: Tue, 18 Sep 2012 06:18:43 -0300 Subject: [media] m5mols: Implement .get_frame_desc subdev callback .get_frame_desc can be used by host interface driver to query properties of captured frames, e.g. required memory buffer size. Signed-off-by: Sylwester Nawrocki Signed-off-by: Kyungmin Park Signed-off-by: Mauro Carvalho Chehab --- drivers/media/i2c/m5mols/m5mols_capture.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/media/i2c/m5mols/m5mols_capture.c') diff --git a/drivers/media/i2c/m5mols/m5mols_capture.c b/drivers/media/i2c/m5mols/m5mols_capture.c index cb243bd278ce..ab34ccedf31e 100644 --- a/drivers/media/i2c/m5mols/m5mols_capture.c +++ b/drivers/media/i2c/m5mols/m5mols_capture.c @@ -105,6 +105,7 @@ static int m5mols_capture_info(struct m5mols_info *info) int m5mols_start_capture(struct m5mols_info *info) { + unsigned int framesize = info->cap.buf_size - M5MOLS_JPEG_TAGS_SIZE; struct v4l2_subdev *sd = &info->sd; int ret; @@ -120,6 +121,8 @@ int m5mols_start_capture(struct m5mols_info *info) ret = m5mols_write(sd, CAPP_YUVOUT_MAIN, REG_JPEG); if (!ret) ret = m5mols_write(sd, CAPP_MAIN_IMAGE_SIZE, info->resolution); + if (!ret) + ret = m5mols_write(sd, CAPP_JPEG_SIZE_MAX, framesize); if (!ret) ret = m5mols_set_mode(info, REG_CAPTURE); if (!ret) -- cgit v1.2.1